From ffc5c0f676f7fede185d99b81f668fc241d436c9 Mon Sep 17 00:00:00 2001 From: Reinier Battenberg Date: Thu, 12 Jan 2017 05:41:59 +0100 Subject: [PATCH 001/555] Fix anchor for not toc targets (#653) Clicking on toc items generated from the documentation.yaml file didnt work. The target id was not properly slugged. Always slug your target. Very important. --- default_theme/note._ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default_theme/note._ b/default_theme/note._ index f98b2a444..0a83e5ba7 100644 --- a/default_theme/note._ +++ b/default_theme/note._ @@ -1,6 +1,6 @@
-

+

<%- note.name %>

From 98f86d70eaf8a27aa0c01eceeae0134c736069c6 Mon Sep 17 00:00:00 2001 From: Dano Alexander Date: Thu, 12 Jan 2017 07:17:41 -0800 Subject: [PATCH 002/555] Fix typo (#656) --- docs/FAQ.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index dea82a42d..29f748fa1 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -32,7 +32,7 @@ application. `documentation` aims to modernize and simplify the process of generating JavaScript documentation. -* Beatiful defaults for HTML & Markdown output +* Beautiful defaults for HTML & Markdown output * Supports CommonJS `require()` syntax so that node modules can be documented by giving their `main` file * Extensively documented internally: all public and private functions in `documentation` From 898faa07ce5473e4886b89312777bcb3df414e32 Mon Sep 17 00:00:00 2001 From: Erik Arvidsson Date: Thu, 12 Jan 2017 09:51:48 -0800 Subject: [PATCH 003/555] Fix expectations after #653 (#657) --- test/fixture/html/nested.config-output.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index 626338271..d4a3b7cd0 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -218,7 +218,7 @@

-

+

Highlighted section

From 631c6925d4137f4fac82b66d92898138958a70d3 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 27 Jan 2017 16:14:19 -0500 Subject: [PATCH 004/555] feat(core): Switch to Promises everywhere. Adopt Node v4 ES6 (#648) * feat(core): Switch to Promises everywhere. Adopt Node v4 ES6 Big changes: * Uses template strings where appropriate * Config and argument parsing is unified and there is no such thing as formatterOptions anymore. All user-passed options go through mergeConfig. * The node API surface changed (again): `buildSync` is removed, building operations return Promises. * Now using Flow for internal type annotations. More changes: * Remove buildSync command * feat(inference): Partially implement object shorthand support * Refs #649 * Use Flow annotations to enforce types * Keep flow but switch to comment syntax * Clarify types * More flow improvements * Turn server into class * LinkerStack becomes class too * Fix comment description type * Run flow on lint * Many more flow fixes * More intense flow refactoring * Simplify inference steps * Update inference tests, flow errors down to 1 * Continue refining types * Fix more flow issues * Use 'use strict' everywhere * Make 'ast' property configurable * Fix many tests * Fix more tests * Fix more tests * Fix augments * Test Markdown meta support * Improve test coverage * Switch back from for of to for for speed --- .eslintrc | 18 +- .flowconfig | 12 + README.md | 30 +- bin/documentation.js | 33 +- declarations/comment.js | 131 ++ default_theme/index._ | 6 +- default_theme/index.js | 44 +- index.js | 364 ++- lib/commands/build.js | 96 +- lib/commands/index.js | 11 +- lib/commands/lint.js | 21 +- lib/commands/readme.js | 84 +- lib/commands/serve.js | 61 +- lib/commands/shared_options.js | 68 +- lib/extractors/comments.js | 22 +- lib/extractors/exported.js | 28 +- lib/filter_access.js | 4 +- lib/flow_doctrine.js | 13 +- lib/garbage_collect.js | 4 +- lib/git/find_git.js | 8 +- lib/git/url_prefix.js | 16 +- lib/github.js | 16 +- lib/hierarchy.js | 62 +- lib/infer/access.js | 10 +- lib/infer/augments.js | 43 +- lib/infer/finders.js | 6 +- lib/infer/kind.js | 93 +- lib/infer/membership.js | 40 +- lib/infer/name.js | 157 +- lib/infer/params.js | 247 +- lib/infer/properties.js | 101 +- lib/infer/return.js | 60 +- lib/infer/should_skip_inference.js | 17 +- lib/infer/type.js | 67 +- lib/inline_tokenizer.js | 6 +- lib/input/dependency.js | 67 +- lib/input/shallow.js | 24 +- lib/is_jsdoc_comment.js | 7 +- lib/lint.js | 19 +- lib/load_config.js | 56 - lib/merge_config.js | 87 + lib/module_filters.js | 14 +- lib/nest.js | 48 +- lib/output/highlighter.js | 4 +- lib/output/html.js | 40 +- lib/output/json.js | 23 +- lib/output/markdown.js | 26 +- lib/output/markdown_ast.js | 164 +- lib/output/util/format_type.js | 6 +- lib/output/util/formatters.js | 17 +- lib/output/util/linker_stack.js | 133 +- lib/output/util/reroute_links.js | 8 +- lib/parse.js | 57 +- lib/parse_markdown.js | 4 +- lib/parsers/javascript.js | 29 +- lib/parsers/parse_to_ast.js | 4 +- lib/parsers/polyglot.js | 12 +- lib/serve/error_page.js | 6 +- lib/serve/server.js | 208 +- lib/smart_glob.js | 17 +- lib/sort.js | 75 +- lib/walk.js | 7 +- package.json | 16 +- test/bin-readme.js | 11 + test/bin.js | 17 + test/fixture/_external-deps-included.json | 24 + test/fixture/_multi-file-input.json | 25 +- test/fixture/boolean-literal-type.output.json | 11 +- .../boolean-literal-type.output.md.json | 11 +- test/fixture/class.config.output.md | 1 + test/fixture/class.output.json | 28 +- test/fixture/class.output.md.json | 33 +- test/fixture/config-malformed.json | 1 + test/fixture/custom_theme/index.js | 2 +- ...exported-export-default-object.output.json | 16 + ...orted-export-default-object.output.md.json | 22 +- ...-exported-export-default-value.output.json | 8 + ...ported-export-default-value.output.md.json | 11 +- test/fixture/document-exported.output.json | 261 ++- test/fixture/document-exported.output.md.json | 330 +-- test/fixture/es6-class.output.json | 35 +- test/fixture/es6-class.output.md.json | 44 +- test/fixture/es6-default2.output.json | 13 +- test/fixture/es6-default2.output.md.json | 11 +- test/fixture/es6-import.output.json | 37 +- test/fixture/es6-import.output.md.json | 33 +- test/fixture/es6.output-toc.md | 4 +- test/fixture/es6.output.json | 184 +- test/fixture/es6.output.md | 4 +- test/fixture/es6.output.md.json | 242 +- test/fixture/event.output.json | 13 +- test/fixture/event.output.md.json | 11 +- test/fixture/example-caption.output.json | 53 +- test/fixture/example-caption.output.md.json | 11 +- test/fixture/external.output.json | 8 + test/fixture/external.output.md.json | 11 +- test/fixture/factory.output.json | 30 +- test/fixture/factory.output.md.json | 33 +- test/fixture/html/nested.config-output.html | 414 +++- test/fixture/html/nested.output.files | 414 +++- test/fixture/infer-private.output.json | 16 + test/fixture/infer-private.output.md.json | 22 +- test/fixture/inheritance.output.json | 30 +- test/fixture/inheritance.output.md.json | 22 +- test/fixture/inline-link.output.json | 16 + test/fixture/inline-link.output.md.json | 22 +- test/fixture/internal.output.json | 8 + test/fixture/internal.output.md.json | 11 +- test/fixture/literal_types.output.json | 19 +- test/fixture/literal_types.output.md.json | 22 +- test/fixture/memberedclass.output.json | 24 + test/fixture/memberedclass.output.md.json | 33 +- test/fixture/merge-infered-type.output.json | 8 + .../fixture/merge-infered-type.output.md.json | 11 +- test/fixture/meta.input.js | 12 + .../typedef.output.json => meta.output.json} | 174 +- test/fixture/meta.output.md | 19 + ...ple.output.md.json => meta.output.md.json} | 295 ++- test/fixture/multisignature.output.json | 29 +- test/fixture/multisignature.output.md.json | 22 +- test/fixture/nearby_params.output.json | 15 +- test/fixture/nearby_params.output.md.json | 11 +- test/fixture/nest_params.output.json | 26 +- test/fixture/nest_params.output.md.json | 22 +- .../newline-in-description.output.json | 14 +- .../newline-in-description.output.md.json | 11 +- test/fixture/no-name.output.json | 14 +- test/fixture/no-name.output.md.json | 11 +- .../optional-record-field-type.output.json | 11 +- .../optional-record-field-type.output.md.json | 11 +- test/fixture/params.output.json | 102 +- test/fixture/params.output.md | 4 +- test/fixture/params.output.md.json | 121 +- test/fixture/polyglot/blend.json | 10 +- test/fixture/react-jsx.output.json | 8 + test/fixture/react-jsx.output.md.json | 11 +- test/fixture/simple-hashbang.output.json | 8 + test/fixture/simple-hashbang.output.md.json | 11 +- test/fixture/simple-two.output.json | 17 +- test/fixture/simple-two.output.md.json | 11 +- test/fixture/simple.output.github.json | 11 +- test/fixture/simple.output.github.md | 2 +- test/fixture/simple.output.json | 8 + test/fixture/simple.output.md.json | 11 +- test/fixture/sort-order-alpha.output.json | 208 +- test/fixture/sort-order-alpha.output.md | 32 +- test/fixture/sort-order-alpha.output.md.json | 148 +- test/fixture/sorting/output.json | 24 + test/fixture/string-literal-key.output.json | 16 + .../fixture/string-literal-key.output.md.json | 22 +- test/fixture/sync/alias.input.js | 8 - test/fixture/sync/alias.output.json | 125 - test/fixture/sync/alias.output.md | 16 - test/fixture/sync/alias.output.md.json | 149 -- test/fixture/sync/empty-example.input.js | 8 - test/fixture/sync/empty-example.output.json | 105 - test/fixture/sync/empty-example.output.md | 9 - .../fixture/sync/empty-example.output.md.json | 63 - test/fixture/sync/flow-types.input.js | 72 - test/fixture/sync/flow-types.output.json | 1436 ------------ test/fixture/sync/flow-types.output.md | 110 - test/fixture/sync/flow-types.output.md.json | 2034 ----------------- test/fixture/sync/lots-of-options.input.js | 23 - test/fixture/sync/lots-of-options.output.json | 1293 ----------- test/fixture/sync/lots-of-options.output.md | 29 - .../sync/lots-of-options.output.md.json | 1429 ------------ test/fixture/sync/meta.input.js | 11 - test/fixture/sync/meta.output.json | 183 -- test/fixture/sync/meta.output.md | 21 - test/fixture/sync/meta.output.md.json | 230 -- test/fixture/sync/multiexample.input.js | 16 - test/fixture/sync/multiexample.output.json | 348 --- test/fixture/sync/multiexample.output.md | 26 - test/fixture/sync/rename.input.js | 6 - test/fixture/sync/rename.output.json | 99 - test/fixture/sync/rename.output.md | 9 - test/fixture/sync/rename.output.md.json | 63 - test/fixture/sync/throws.input.js | 15 - test/fixture/sync/throws.output.json | 315 --- test/fixture/sync/throws.output.md | 24 - test/fixture/sync/throws.output.md.json | 304 --- test/fixture/sync/trailing-only.input.js | 7 - test/fixture/sync/trailing-only.output.json | 163 -- test/fixture/sync/trailing-only.output.md | 9 - .../fixture/sync/trailing-only.output.md.json | 127 - test/fixture/sync/trailing.input.js | 18 - test/fixture/sync/trailing.output.json | 426 ---- test/fixture/sync/trailing.output.md | 23 - test/fixture/sync/trailing.output.md.json | 299 --- test/fixture/sync/typedef.input.js | 8 - test/fixture/sync/typedef.output.md | 16 - test/fixture/sync/typedef.output.md.json | 244 -- test/fixture/system-import.output.json | 8 + test/fixture/system-import.output.md.json | 11 +- test/fixture/this-class.output.json | 49 +- test/fixture/this-class.output.md.json | 55 +- test/fixture/type_application.output.json | 12 +- test/fixture/type_application.output.md.json | 11 +- .../var-function-param-return.output.json | 11 +- .../var-function-param-return.output.md.json | 11 +- test/format_type.js | 6 +- test/lib/flow_doctrine.js | 3 +- test/lib/git/mock_repo.js | 1 + test/lib/github.js | 20 +- test/lib/hierarchy.js | 2 +- test/lib/infer/access.js | 4 +- test/lib/infer/kind.js | 4 +- test/lib/infer/membership.js | 29 +- test/lib/infer/name.js | 8 +- test/lib/infer/params.js | 6 +- test/lib/infer/type.js | 6 +- test/lib/input/shallow.js | 38 +- test/lib/lint.js | 2 +- test/lib/load_config.js | 39 - test/lib/merge_config.js | 69 + test/lib/nest.js | 6 +- test/lib/output/util/formatters.js | 1 + test/lib/parse.js | 13 +- test/lib/parsers/javascript.js | 4 +- test/lib/parsers/polyglot.js | 53 +- test/lib/server.js | 4 +- test/linker.js | 11 +- test/normalize.js | 1 + test/test.js | 131 +- test/utils.js | 1 + 225 files changed, 4506 insertions(+), 13383 deletions(-) create mode 100644 .flowconfig create mode 100644 declarations/comment.js delete mode 100644 lib/load_config.js create mode 100644 lib/merge_config.js create mode 100644 test/fixture/config-malformed.json create mode 100644 test/fixture/meta.input.js rename test/fixture/{sync/typedef.output.json => meta.output.json} (59%) create mode 100644 test/fixture/meta.output.md rename test/fixture/{sync/multiexample.output.md.json => meta.output.md.json} (62%) delete mode 100644 test/fixture/sync/alias.input.js delete mode 100644 test/fixture/sync/alias.output.json delete mode 100644 test/fixture/sync/alias.output.md delete mode 100644 test/fixture/sync/alias.output.md.json delete mode 100644 test/fixture/sync/empty-example.input.js delete mode 100644 test/fixture/sync/empty-example.output.json delete mode 100644 test/fixture/sync/empty-example.output.md delete mode 100644 test/fixture/sync/empty-example.output.md.json delete mode 100644 test/fixture/sync/flow-types.input.js delete mode 100644 test/fixture/sync/flow-types.output.json delete mode 100644 test/fixture/sync/flow-types.output.md delete mode 100644 test/fixture/sync/flow-types.output.md.json delete mode 100644 test/fixture/sync/lots-of-options.input.js delete mode 100644 test/fixture/sync/lots-of-options.output.json delete mode 100644 test/fixture/sync/lots-of-options.output.md delete mode 100644 test/fixture/sync/lots-of-options.output.md.json delete mode 100644 test/fixture/sync/meta.input.js delete mode 100644 test/fixture/sync/meta.output.json delete mode 100644 test/fixture/sync/meta.output.md delete mode 100644 test/fixture/sync/meta.output.md.json delete mode 100644 test/fixture/sync/multiexample.input.js delete mode 100644 test/fixture/sync/multiexample.output.json delete mode 100644 test/fixture/sync/multiexample.output.md delete mode 100644 test/fixture/sync/rename.input.js delete mode 100644 test/fixture/sync/rename.output.json delete mode 100644 test/fixture/sync/rename.output.md delete mode 100644 test/fixture/sync/rename.output.md.json delete mode 100644 test/fixture/sync/throws.input.js delete mode 100644 test/fixture/sync/throws.output.json delete mode 100644 test/fixture/sync/throws.output.md delete mode 100644 test/fixture/sync/throws.output.md.json delete mode 100644 test/fixture/sync/trailing-only.input.js delete mode 100644 test/fixture/sync/trailing-only.output.json delete mode 100644 test/fixture/sync/trailing-only.output.md delete mode 100644 test/fixture/sync/trailing-only.output.md.json delete mode 100644 test/fixture/sync/trailing.input.js delete mode 100644 test/fixture/sync/trailing.output.json delete mode 100644 test/fixture/sync/trailing.output.md delete mode 100644 test/fixture/sync/trailing.output.md.json delete mode 100644 test/fixture/sync/typedef.input.js delete mode 100644 test/fixture/sync/typedef.output.md delete mode 100644 test/fixture/sync/typedef.output.md.json delete mode 100644 test/lib/load_config.js create mode 100644 test/lib/merge_config.js diff --git a/.eslintrc b/.eslintrc index aa5b80ed0..375296eae 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,6 +1,12 @@ { "root": true, - "parser": "espree", + "parser": "babel-eslint", + "parserOptions": { + "sourceType": "script" + }, + "plugins": [ + "flowtype" + ], "rules": { "space-in-parens": 2, "space-before-blocks": 2, @@ -21,8 +27,8 @@ "no-new": 2, "key-spacing": 2, "no-multi-spaces": 2, - "valid-jsdoc": 2, "brace-style": 2, + "object-shorthand": ["error", "always", { "avoidQuotes": true }], "no-throw-literal": 2, "no-self-compare": 2, "no-void": 2, @@ -32,13 +38,15 @@ "quotes": [2, "single"], "indent": [2, 2], "curly": 2, + "strict": [2, "global"], "no-shadow": 0, - "no-undef": 2 + "no-undef": 2, + "flowtype/define-flow-type": 1, + "flowtype/use-flow-type": 1 }, "extends": "eslint:recommended", "env": { "node": true, - "es6": true, - "browser": true + "es6": true } } diff --git a/.flowconfig b/.flowconfig new file mode 100644 index 000000000..74fcf1e7d --- /dev/null +++ b/.flowconfig @@ -0,0 +1,12 @@ +[ignore] +.*node_modules/.cache/.* +.*node_modules/conventional-changelog-core/test/fixtures/.* +.*/test/fixture/.* + +[include] + +[libs] +declarations/ + +[options] +module.ignore_non_literal_requires=true diff --git a/README.md b/README.md index 59d8f9753..37e9f46b7 100644 --- a/README.md +++ b/README.md @@ -46,21 +46,21 @@ lets you run `documentation` as a [Gulp](http://gulpjs.com/) build task. ## Examples -* [HTML output with default template](http://documentation.js.org/html-example/) -* [Markdown](https://github.com/documentationjs/documentation/blob/master/docs/NODE_API.md) -* [JSON](http://documentation.js.org/html-example/index.json) +- [HTML output with default template](http://documentation.js.org/html-example/) +- [Markdown](https://github.com/documentationjs/documentation/blob/master/docs/NODE_API.md) +- [JSON](http://documentation.js.org/html-example/index.json) ## Documentation -* [Getting Started](docs/GETTING_STARTED.md): start here -* [Usage](docs/USAGE.md): how to use documentation.js -* [Recipes](docs/RECIPES.md): tricks for writing effective JSDoc docs -* [Node API](docs/NODE_API.md): documentation.js's self-generated documentation -* [Configuring documentation.js](docs/CONFIG.md) -* [FAQ](docs/FAQ.md) -* [Troubleshooting](docs/TROUBLESHOOTING.md) -* [Theming](docs/THEMING.md): tips for theming documentation output in HTML -* [See also](https://github.com/documentationjs/documentation/wiki/See-also): a list of projects similar to documentation.js +- [Getting Started](docs/GETTING_STARTED.md): start here +- [Usage](docs/USAGE.md): how to use documentation.js +- [Recipes](docs/RECIPES.md): tricks for writing effective JSDoc docs +- [Node API](docs/NODE_API.md): documentation.js's self-generated documentation +- [Configuring documentation.js](docs/CONFIG.md) +- [FAQ](docs/FAQ.md) +- [Troubleshooting](docs/TROUBLESHOOTING.md) +- [Theming](docs/THEMING.md): tips for theming documentation output in HTML +- [See also](https://github.com/documentationjs/documentation/wiki/See-also): a list of projects similar to documentation.js ## User Guide @@ -116,9 +116,9 @@ _We have plenty of [issues](https://github.com/documentationjs/documentation/issues) that we'd love help with._ -* Robust and complete `JSDoc` support, including typedefs. -* Strong support for HTML and Markdown output -* Documentation coverage, statistics, and validation +- Robust and complete `JSDoc` support, including typedefs. +- Strong support for HTML and Markdown output +- Documentation coverage, statistics, and validation documentation is an OPEN Open Source Project. This means that: diff --git a/bin/documentation.js b/bin/documentation.js index fc275553d..5bd322670 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -24,28 +24,29 @@ var argv = yargs .version(function () { return require('../package').version; }) - .usage('Usage:\n\n' + - '# generate markdown docs for index.js and files it references\n' + - '$0 build index.js -f md\n\n' + + .usage(`Usage: - '# generate html docs for all files in src\n' + - '$0 build src/** -f html -o docs\n\n' + + # generate markdown docs for index.js and files it references + $0 build index.js -f md - '# document index.js, ignoring any files it requires or imports\n' + - '$0 build index.js -f md --shallow\n\n' + + # generate html docs for all files in src + $0 build src/** -f html -o docs - '# build, serve, and live-update html docs for app.js\n' + - '$0 serve app.js\n\n' + + # document index.js, ignoring any files it requires or imports + $0 build index.js -f md --shallow - '# validate JSDoc syntax in util.js\n' + - '$0 lint util.js\n\n' + + # build, serve, and live-update html docs for app.js + $0 serve app.js - '# update the API section of README.md with docs from index.js\n' + - '$0 readme index.js --section=API\n\n' + + # validate JSDoc syntax in util.js + $0 lint util.js - '# build docs for all values exported by index.js\n' + - '$0 build --document-exported index.js' - ) + # update the API section of README.md with docs from index.js + $0 readme index.js --section=API + + # build docs for all values exported by index.js + $0 build --document-exported index.js +`) .recommendCommands() .help() .argv; diff --git a/declarations/comment.js b/declarations/comment.js new file mode 100644 index 000000000..a737ef123 --- /dev/null +++ b/declarations/comment.js @@ -0,0 +1,131 @@ +declare type DocumentationConfig = { + polyglot?: boolean, + inferPrivate?: boolean, + noPackage?: boolean, + toc?: Array, + paths?: { [key: string]: number }, + defaultGlobals?: boolean, + defaultGlobalsEnvs?: Array, + external?: Array, + theme: string, + requireExtension?: Array, + parseExtension: Array +}; + +declare type InputsConfig = { + inputs: Array, + config: DocumentationConfig +}; + +declare type CommentError = { + message: string, + commentLineNumber?: number +}; + +declare type DoctrineType = { + elements?: Array, + expression?: DoctrineType, + applications?: Array, + type: string, + name?: string +}; + +declare type CommentLoc = { + start: { + line: number + }, + end: { + line: number + } +}; + +declare type SourceFile = { + source?: string, + file: string +}; + +declare type CommentContext = { + sortKey: string, + file: string, + ast: Object, + loc: CommentLoc, + code: string, + github?: CommentContextGitHub +}; + +declare type CommentContextGitHub = { + path: string, + url: string +}; + +declare type CommentTag = { + name?: string, + title: string, + description?: Object, + default?: any, + lineNumber?: number, + type?: DoctrineType, + properties?: Array +}; + +declare type CommentMembers = { + static: Array, + instance: Array, + events: Array +}; + +declare type CommentExample = { + caption?: string, + description?: Object +}; + +declare type Remark = { + type: string, + children: Array +}; + +declare type Comment = { + errors: Array, + tags: Array, + + augments: Array, + errors: Array, + examples: Array, + params: Array, + properties: Array, + returns: Array, + sees: Array, + throws: Array, + todos: Array, + + description?: Remark, + summary?: Remark, + deprecated?: Remark, + classdesc?: Remark, + + members: CommentMembers, + + name?: string, + kind?: string, + memberof?: string, + scope?: string, + access?: string, + alias?: string, + + copyright?: string, + author?: string, + license?: string, + version?: string, + since?: string, + lends?: string, + override?: boolean, + + type?: DoctrineType, + + context: CommentContext, + + path?: Array<{ + name: string, + scope: string + }> +}; diff --git a/default_theme/index._ b/default_theme/index._ index 8cc488f59..1934773aa 100644 --- a/default_theme/index._ +++ b/default_theme/index._ @@ -2,7 +2,7 @@ - <%- options.name %> <%- options.version %> | Documentation + <%- config['project-name'] %> <%- config['project-version'] %> | Documentation @@ -13,8 +13,8 @@
-

<%- options.name %>

-
<%- options.version %>
+

<%- config['project-name'] %>

+
<%- config['project-version'] %>
*/, config/*: DocumentationConfig */) { - var linkerStack = createLinkerStack(options) + var linkerStack = new LinkerStack(config) .namespaceResolver(comments, function (namespace) { var slugger = new GithubSlugger(); return '#' + slugger.slug(namespace); @@ -21,15 +21,15 @@ module.exports = function (comments, options, callback) { var formatters = createFormatters(linkerStack.link); - hljs.configure(options.hljs || {}); + hljs.configure(config.hljs || {}); var sharedImports = { imports: { - slug: function (str) { + slug(str) { var slugger = new GithubSlugger(); return slugger.slug(str); }, - shortSignature: function (section) { + shortSignature(section) { var prefix = ''; if (section.kind === 'class') { prefix = 'new '; @@ -38,7 +38,7 @@ module.exports = function (comments, options, callback) { } return prefix + section.name + formatters.parameters(section, true); }, - signature: function (section) { + signature(section) { var returns = ''; var prefix = ''; if (section.kind === 'class') { @@ -46,13 +46,13 @@ module.exports = function (comments, options, callback) { } else if (section.kind !== 'function') { return section.name; } - if (section.returns) { + if (section.returns.length) { returns = ': ' + formatters.type(section.returns[0].type); } return prefix + section.name + formatters.parameters(section) + returns; }, - md: function (ast, inline) { + md(ast, inline) { if (inline && ast && ast.children.length && ast.children[0].type === 'paragraph') { ast = { type: 'root', @@ -63,8 +63,8 @@ module.exports = function (comments, options, callback) { }, formatType: formatters.type, autolink: formatters.autolink, - highlight: function (example) { - if (options.hljs && options.hljs.highlightAuto) { + highlight(example) { + if (config.hljs && config.hljs.highlightAuto) { return hljs.highlightAuto(example).value; } return hljs.highlight('js', example).value; @@ -79,14 +79,16 @@ module.exports = function (comments, options, callback) { var pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports); // push assets into the pipeline as well. - vfs.src([__dirname + '/assets/**'], { base: __dirname }) - .pipe(concat(function (files) { - callback(null, files.concat(new File({ - path: 'index.html', - contents: new Buffer(pageTemplate({ - docs: comments, - options: options - }), 'utf8') - }))); - })); + return new Promise(resolve => { + vfs.src([__dirname + '/assets/**'], { base: __dirname }) + .pipe(concat(function (files) { + resolve(files.concat(new File({ + path: 'index.html', + contents: new Buffer(pageTemplate({ + docs: comments, + config: config + }), 'utf8') + }))); + })); + }); }; diff --git a/index.js b/index.js index f79a7e30c..6ae6d0987 100644 --- a/index.js +++ b/index.js @@ -24,9 +24,7 @@ var fs = require('fs'), garbageCollect = require('./lib/garbage_collect'), lintComments = require('./lib/lint').lintComments, markdownAST = require('./lib/output/markdown_ast'), - loadConfig = require('./lib/load_config'); - -var parseExtensions = ['js', 'jsx', 'es5', 'es6']; + mergeConfig = require('./lib/merge_config'); /** * Build a pipeline of comment handlers. @@ -37,7 +35,7 @@ var parseExtensions = ['js', 'jsx', 'es5', 'es6']; */ function pipeline() { var elements = arguments; - return function (comment) { + return comment => { for (var i = 0; comment && i < elements.length; i++) { if (elements[i]) { comment = elements[i](comment); @@ -47,194 +45,109 @@ function pipeline() { }; } -/** - * Given an array of indexes and options for whether to resolve shallow - * or deep dependencies, resolve dependencies. - * - * @param {Array|string} indexes files to process - * @param {Object} options options - * @param {Function} callback called with results - * @returns {undefined} - */ -function expandInputs(indexes, options, callback) { - var inputFn; - if (options.polyglot || options.shallow || options.documentExported) { - inputFn = shallow; - } else { - inputFn = dependency; - } - options.parseExtensions = parseExtensions - .concat(options.parseExtension || []); - inputFn(indexes, options, callback); -} -/** - * Given an options object, it expands the `config` field - * if it exists. - * - * @param {Object} options - options to process - * @returns {undefined} - */ -function expandConfig(options) { - if (options && typeof options.config === 'string') { - Object.assign(options, loadConfig(options.config)); - } -} -/** - * Generate JavaScript documentation as a list of parsed JSDoc - * comments, given a root file as a path. - * - * @param {Array|string} indexes files to process - * @param {Object} options options - * @param {Array} options.external a string regex / glob match pattern - * that defines what external modules will be whitelisted and included in the - * generated documentation. - * @param {boolean} [options.polyglot=false] parse comments with a regex rather than - * a proper parser. This enables support of non-JavaScript languages but - * reduces documentation's ability to infer structure of code. - * @param {boolean} [options.shallow=false] whether to avoid dependency parsing - * even in JavaScript code. With the polyglot option set, this has no effect. - * @param {Array} [options.order=[]] optional array that - * defines sorting order of documentation - * @param {Array} [options.access=[]] an array of access levels - * to output in documentation - * @param {Object} [options.hljs] hljs optional options - * @param {boolean} [options.hljs.highlightAuto=false] hljs automatically detect language - * @param {Array} [options.hljs.languages] languages for hljs to choose from - * @param {string} [options.inferPrivate] a valid regular expression string - * to infer whether a code element should be private, given its naming structure. - * For instance, you can specify `inferPrivate: '^_'` to automatically treat - * methods named like `_myMethod` as private. - * @param {string|Array} [options.extension] treat additional file extensions - * as JavaScript, extending the default set of `js`, `es6`, and `jsx`. - * @param {Function} callback to be called when the documentation generation - * is complete, with (err, result) argumentsj - * @returns {undefined} calls callback - * @public - * @example - * var documentation = require('documentation'); - * - * documentation.build(['index.js'], { - * - * // only output comments with an explicit @public tag - * access: ['public'] - * - * }, function (err, res) { - * - * // res is an array of parsed comments with inferred properties - * // and more: everything you need to build documentation or - * // any other kind of code data. - * - * }); - */ -function build(indexes, options, callback) { - options = options || {}; +function configure(indexes, args)/*: Promise */ { + let mergedConfig = mergeConfig(args); - expandConfig(options); + return mergedConfig.then(config => { - if (typeof indexes === 'string') { - indexes = [indexes]; - } + let expandedInputs = expandInputs(indexes, config); - return expandInputs(indexes, options, function (error, inputs) { - if (error) { - return callback(error); - } - - var result; - try { - result = buildSync(inputs, options); - } catch (e) { - return callback(e); - } - callback(null, result); + return expandedInputs.then(inputs => { + return { + inputs, + config + }; + }); }); } /** - * Generate JavaScript documentation given a list of inputs. This internal - * method does not support require-following and it returns its results - * synchronously, rather than by calling a callback. - * - * @param {Array} indexes files to process - * @param {Object} options options - * @param {string} config path to configuration file to load - * @param {Array} options.external a string regex / glob match pattern - * that defines what external modules will be whitelisted and included in the - * generated documentation. - * @param {boolean} [options.polyglot=false] parse comments with a regex rather than - * a proper parser. This enables support of non-JavaScript languages but - * reduces documentation's ability to infer structure of code. - * @param {boolean} [options.shallow=false] whether to avoid dependency parsing - * even in JavaScript code. With the polyglot option set, this has no effect. - * @param {Array} [options.order=[]] optional array that - * defines sorting order of documentation - * @param {Array} [options.access=[]] an array of access levels - * to output in documentation - * @param {Object} [options.hljs] hljs optional options - * @param {boolean} [options.hljs.highlightAuto=false] hljs automatically detect language - * @param {Array} [options.hljs.languages] languages for hljs to choose from - * @param {string} [options.inferPrivate] a valid regular expression string - * to infer whether a code element should be private, given its naming structure. - * For instance, you can specify `inferPrivate: '^_'` to automatically treat - * methods named like `_myMethod` as private. - * @param {string|Array} [options.extension] treat additional file extensions - * as JavaScript, extending the default set of `js`, `es6`, and `jsx`. - * @returns {Object} list of results - * @public - * @example - * var documentation = require('documentation'); + * Given an array of indexes and options for whether to resolve shallow + * or deep dependencies, resolve dependencies. * - * var results = documentation.buildSync(['index.js']); - * // results is an array of parsed comments with inferred properties - * // and more: everything you need to build documentation or - * // any other kind of code data. + * @param {Array|string} indexes files to process + * @param {Object} config options + * @returns {Promise>} promise with results */ -function buildSync(indexes, options) { - options = options || {}; - options.hljs = options.hljs || {}; +function expandInputs(indexes/*: string|Array */, + config /*: DocumentationConfig */) { + // Ensure that indexes is an array of strings + indexes = [].concat(indexes); + + if (config.polyglot || config.shallow || config.documentExported) { + return shallow(indexes, config); + } - expandConfig(options); + return dependency(indexes, config); +} + +function buildInternal(inputsAndConfig) { + let config = inputsAndConfig.config; + let inputs = inputsAndConfig.inputs; - if (!options.access) { - options.access = ['public', 'undefined', 'protected']; + if (!config.access) { + config.access = ['public', 'undefined', 'protected']; } - var parseFn = (options.polyglot) ? polyglot : parseJavaScript; + var parseFn = (config.polyglot) ? polyglot : parseJavaScript; var buildPipeline = pipeline( - inferName(), - inferAccess(options.inferPrivate), - inferAugments(), - inferKind(), - inferParams(), - inferProperties(), - inferReturn(), + inferName, + inferAccess(config.inferPrivate), + inferAugments, + inferKind, + inferParams, + inferProperties, + inferReturn, inferMembership(), - inferType(), + inferType, nest, - options.github && github, + config.github && github, garbageCollect); - return filterAccess(options.access, + let extractedComments = _.flatMap(inputs, function (sourceFile) { + if (!sourceFile.source) { + sourceFile.source = fs.readFileSync(sourceFile.file, 'utf8'); + } + + return parseFn(sourceFile, config).map(buildPipeline); + }).filter(Boolean); + + return filterAccess(config.access, hierarchy( - sort( - _.flatMap(indexes, function (index) { - var indexObject = null; + sort(extractedComments, config))); +} + +function lintInternal(inputsAndConfig) { + let inputs = inputsAndConfig.inputs; + let config = inputsAndConfig.config; + + let parseFn = (config.polyglot) ? polyglot : parseJavaScript; - if (typeof index === 'string') { - indexObject = { - source: fs.readFileSync(index, 'utf8'), - file: index - }; - } else { - indexObject = index; - } + let lintPipeline = pipeline( + lintComments, + inferName, + inferAccess(config.inferPrivate), + inferAugments, + inferKind, + inferParams, + inferProperties, + inferReturn, + inferMembership(), + inferType, + nest); + + let extractedComments = _.flatMap(inputs, sourceFile => { + if (!sourceFile.source) { + sourceFile.source = fs.readFileSync(sourceFile.file, 'utf8'); + } + + return parseFn(sourceFile, config).map(lintPipeline); + }).filter(Boolean); - return parseFn(indexObject, options).map(buildPipeline); - }) - .filter(Boolean), options))); + return formatLint(hierarchy(extractedComments)); } /** @@ -243,30 +156,25 @@ function buildSync(indexes, options) { * of lint information intended for human-readable output. * * @param {Array|string} indexes files to process - * @param {Object} options options - * @param {Array} options.external a string regex / glob match pattern + * @param {Object} args args + * @param {Array} args.external a string regex / glob match pattern * that defines what external modules will be whitelisted and included in the * generated documentation. - * @param {boolean} [options.polyglot=false] parse comments with a regex rather than + * @param {boolean} [args.polyglot=false] parse comments with a regex rather than * a proper parser. This enables support of non-JavaScript languages but * reduces documentation's ability to infer structure of code. - * @param {boolean} [options.shallow=false] whether to avoid dependency parsing + * @param {boolean} [args.shallow=false] whether to avoid dependency parsing * even in JavaScript code. With the polyglot option set, this has no effect. - * @param {string} [options.inferPrivate] a valid regular expression string + * @param {string} [args.inferPrivate] a valid regular expression string * to infer whether a code element should be private, given its naming structure. * For instance, you can specify `inferPrivate: '^_'` to automatically treat * methods named like `_myMethod` as private. - * @param {string|Array} [options.extension] treat additional file extensions + * @param {string|Array} [args.extension] treat additional file extensions * as JavaScript, extending the default set of `js`, `es6`, and `jsx`. - * @param {Function} callback to be called when the documentation generation - * is complete, with (err, result) arguments - * @returns {undefined} calls callback + * @returns {Promise} promise with lint results * @public * @example - * documentation.lint('file.js', {}, function (err, lintOutput) { - * if (err) { - * throw err; - * } + * documentation.lint('file.js').then(lintOutput => { * if (lintOutput) { * console.log(lintOutput); * process.exit(1); @@ -275,47 +183,56 @@ function buildSync(indexes, options) { * } * }); */ -function lint(indexes, options, callback) { - options = options || {}; - - expandConfig(options); +let lint = (indexes, args) => configure(indexes, args) + .then(lintInternal); - if (typeof indexes === 'string') { - indexes = [indexes]; - } - - var parseFn = (options.polyglot) ? polyglot : parseJavaScript; - - var lintPipeline = pipeline( - lintComments, - inferName(), - inferAccess(options.inferPrivate), - inferAugments(), - inferKind(), - inferParams(), - inferProperties(), - inferReturn(), - inferMembership(), - inferType(), - nest); - - return expandInputs(indexes, options, function (error, inputs) { - if (error) { - return callback(error); - } - callback(null, - formatLint(hierarchy( - inputs - .reduce(function (memo, file) { - return memo.concat(parseFn(file, options).map(lintPipeline)); - }, []) - .filter(Boolean)))); - }); -} +/** + * Generate JavaScript documentation as a list of parsed JSDoc + * comments, given a root file as a path. + * + * @param {Array|string} indexes files to process + * @param {Object} args args + * @param {Array} args.external a string regex / glob match pattern + * that defines what external modules will be whitelisted and included in the + * generated documentation. + * @param {boolean} [args.polyglot=false] parse comments with a regex rather than + * a proper parser. This enables support of non-JavaScript languages but + * reduces documentation's ability to infer structure of code. + * @param {boolean} [args.shallow=false] whether to avoid dependency parsing + * even in JavaScript code. With the polyglot option set, this has no effect. + * @param {Array} [args.order=[]] optional array that + * defines sorting order of documentation + * @param {Array} [args.access=[]] an array of access levels + * to output in documentation + * @param {Object} [args.hljs] hljs optional args + * @param {boolean} [args.hljs.highlightAuto=false] hljs automatically detect language + * @param {Array} [args.hljs.languages] languages for hljs to choose from + * @param {string} [args.inferPrivate] a valid regular expression string + * to infer whether a code element should be private, given its naming structure. + * For instance, you can specify `inferPrivate: '^_'` to automatically treat + * methods named like `_myMethod` as private. + * @param {string|Array} [args.extension] treat additional file extensions + * as JavaScript, extending the default set of `js`, `es6`, and `jsx`. + * @returns {Promise} results + * @public + * @example + * var documentation = require('documentation'); + * + * documentation.build(['index.js'], { + * // only output comments with an explicit @public tag + * access: ['public'] + * }).then(res => { + * // res is an array of parsed comments with inferred properties + * // and more: everything you need to build documentation or + * // any other kind of code data. + * }); + */ +let build = (indexes, args) => configure(indexes, args) + .then(buildInternal); /** * Documentation's formats are modular methods that take comments - * and options as input and call a callback with writable objects, + * and config as input and return Promises with results, * like stringified JSON, markdown strings, or Vinyl objects for HTML * output. * @public @@ -323,21 +240,18 @@ function lint(indexes, options, callback) { var formats = { html: require('./lib/output/html'), md: require('./lib/output/markdown'), - remark: function (comments, options, callback) { - markdownAST(comments, options, function (err, res) { - callback(err, JSON.stringify(res, null, 2)); - }); - }, + remark: (comments/*: Array */, config/*: DocumentationConfig */) => + markdownAST(comments, config) + .then(res => JSON.stringify(res, null, 2)), json: require('./lib/output/json') }; module.exports.lint = lint; module.exports.expandInputs = expandInputs; -module.exports.buildSync = buildSync; module.exports.build = build; module.exports.formats = formats; module.exports.util = { createFormatters: require('./lib/output/util/formatters'), - createLinkerStack: require('./lib/output/util/linker_stack') + LinkerStack: require('./lib/output/util/linker_stack') }; diff --git a/lib/commands/build.js b/lib/commands/build.js index 633973dc1..c22a5d88a 100644 --- a/lib/commands/build.js +++ b/lib/commands/build.js @@ -1,7 +1,10 @@ +/* @flow */ 'use strict'; + var streamArray = require('stream-array'), sharedOptions = require('./shared_options'), + path = require('path'), fs = require('fs'), vfs = require('vinyl-fs'), extend = require('extend'), @@ -21,23 +24,13 @@ module.exports.describe = 'build documentation'; module.exports.builder = extend({}, sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, { - format: { - alias: 'f', - default: 'json', - choices: ['json', 'md', 'remark', 'html'] - }, - 'markdown-toc': { - describe: 'include a table of contents in markdown output', - default: true, - type: 'boolean' - }, + example: 'documentation build foo.js -f md > API.md', output: { describe: 'output location. omit for stdout, otherwise is a filename ' + 'for single-file outputs and a directory name for multi-file outputs like html', default: 'stdout', alias: 'o' - }, - example: 'documentation build foo.js -f md > API.md' + } }); /* @@ -48,44 +41,49 @@ module.exports.builder = extend({}, * The former case, with the callback, is used by the `serve` command, which is * just a thin wrapper around this one. */ -module.exports.handler = function build(argv, callback) { +module.exports.handler = function build(argv/*: Object*/) { + var watcher; argv._handled = true; - argv = sharedOptions.expandInputs(argv); - if (argv.f === 'html' && argv.o === 'stdout') { - throw new Error('The HTML output mode requires a destination directory set with -o'); - } - - var generator = documentation.build - .bind(null, argv.input, argv, onDocumented); - function onDocumented(err, comments) { - if (err) { - if (typeof callback === 'function') { - return callback(err); - } - throw err; + if (!argv.input.length) { + try { + argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + } catch (e) { + throw new Error('documentation was given no files and was not run in a module directory'); } + } - var formatterOptions = { - name: argv.name || (argv.package || {}).name, - version: argv['project-version'] || (argv.package || {}).version, - theme: argv.theme, - paths: argv.paths, - markdownToc: argv.markdownToc, - hljs: argv.hljs || {} - }; + if (argv.f === 'html' && argv.o === 'stdout') { + throw new Error('The HTML output mode requires a destination directory set with -o'); + } - documentation.formats[argv.format](comments, formatterOptions, onFormatted); + function generator() { + return documentation.build(argv.input, argv) + .then(comments => + documentation.formats[argv.format](comments, argv) + .then(onFormatted)) + .catch(err => { + /* eslint no-console: 0 */ + if (err instanceof Error) { + console.error(err.stack); + } else { + console.error(err); + } + process.exit(1); + }); } - function onFormatted(err, output) { + function onFormatted(output) { if (argv.watch) { updateWatcher(); } - if (typeof callback === 'function') { - callback(null, output); - } else if (argv.output === 'stdout') { + if (argv.output === 'stdout') { + if (argv.watch) { + // In watch mode, clear the screen first to make updated outputs + // obvious. + process.stdout.write('\u001b[2J'); + } process.stdout.write(output); } else if (Array.isArray(output)) { streamArray(output).pipe(vfs.dest(argv.output)); @@ -94,19 +92,15 @@ module.exports.handler = function build(argv, callback) { } } - if (argv.watch) { - var watcher = chokidar.watch(argv.input); - watcher.on('all', debounce(generator, 300)); - } - generator(); - function updateWatcher() { - documentation.expandInputs(argv.input, argv, addNewFiles); + if (!watcher) { + watcher = chokidar.watch(argv.input); + watcher.on('all', debounce(generator, 300)); + } + documentation.expandInputs(argv.input, argv).then(files => + watcher.add(files.map(data => + typeof data === 'string' ? data : data.file))); } - function addNewFiles(err, files) { - watcher.add(files.map(function (data) { - return typeof data === 'string' ? data : data.file; - })); - } + return generator(); }; diff --git a/lib/commands/index.js b/lib/commands/index.js index 3bce6d3ae..8f09831ff 100644 --- a/lib/commands/index.js +++ b/lib/commands/index.js @@ -1,3 +1,6 @@ +/* @flow */ +'use strict'; + /* * Maps command name to a command plugin module. Each command plugin module * must export a function that takes (documentation, parsedArgs), where @@ -10,8 +13,8 @@ */ module.exports = { - 'build': require('./build'), - 'serve': require('./serve'), - 'lint': require('./lint'), - 'readme': require('./readme') + build: require('./build'), + serve: require('./serve'), + lint: require('./lint'), + readme: require('./readme') }; diff --git a/lib/commands/lint.js b/lib/commands/lint.js index 60020a6af..1e7acad44 100644 --- a/lib/commands/lint.js +++ b/lib/commands/lint.js @@ -1,7 +1,9 @@ +/* @flow */ 'use strict'; var documentation = require('../../'); -var sharedOptions = require('./shared_options'); +var fs = require('fs'); +var path = require('path'); /* eslint no-console: 0 */ @@ -17,18 +19,25 @@ module.exports.builder = {}; * @returns {undefined} has side-effects * @private */ -module.exports.handler = function (argv) { +module.exports.handler = function (argv/*: Object*/) { argv._handled = true; - argv = sharedOptions.expandInputs(argv); - documentation.lint(argv.input, argv, function (err, lintOutput) { - if (err) { - throw err; + if (!argv.input.length) { + try { + argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + } catch (e) { + throw new Error('documentation was given no files and was not run in a module directory'); } + } + documentation.lint(argv.input, argv).then(lintOutput => { if (lintOutput) { console.log(lintOutput); process.exit(1); } else { process.exit(0); } + }).catch(err => { + /* eslint no-console: 0 */ + console.error(err); + process.exit(1); }); }; diff --git a/lib/commands/readme.js b/lib/commands/readme.js index 7c4986709..b72c6b46f 100644 --- a/lib/commands/readme.js +++ b/lib/commands/readme.js @@ -1,12 +1,14 @@ +/* @flow */ 'use strict'; + var fs = require('fs'); var remark = require('remark'); -var sharedOptions = require('./shared_options'); +var path = require('path'); +var documentation = require('../../'); var inject = require('mdast-util-inject'); var chalk = require('chalk'); var disparity = require('disparity'); -var build = require('./build'); module.exports.command = 'readme [input..]'; module.exports.description = 'inject documentation into your README.md'; @@ -19,6 +21,7 @@ module.exports.description = 'inject documentation into your README.md'; module.exports.builder = { usage: 'Usage: documentation readme [--readme-file=README.md] --section "API"' + ' [--compare-only] [other documentationjs options]', + example: 'documentation readme index.js -s "API Docs" --github', 'readme-file': { describe: 'The markdown file into which to inject documentation', default: 'README.md' @@ -38,8 +41,7 @@ module.exports.builder = { alias: 'q', describe: 'Quiet mode: do not print messages or README diff to stdout.', default: false - }, - example: 'documentation readme index.js -s "API Docs" --github' + } }; function noop() {} @@ -50,57 +52,59 @@ function noop() {} * @param {Object} argv args from the CLI option parser * @return {undefined} has the side-effect of writing a file or printing to stdout */ -module.exports.handler = function readme(argv) { +module.exports.handler = function readme(argv/*: Object*/) { argv._handled = true; - argv = sharedOptions.expandInputs(argv); - argv.format = 'remark'; - /* eslint no-console: 0 */ - var log = argv.q ? noop : console.log.bind(console, '[documentation-readme] '); - var readmeFile = argv['readme-file']; - - build.handler(argv, onAst); - function onAst(err, docsAst) { - if (err) { - throw err; + if (!argv.input.length) { + try { + argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + } catch (e) { + throw new Error('documentation was given no files and was not run in a module directory'); } - var readmeContent = fs.readFileSync(readmeFile, 'utf8'); - remark().use(plugin, { - section: argv.section, - toInject: JSON.parse(docsAst) - }).process(readmeContent, onInjected.bind(null, readmeContent)); } - function onInjected(readmeContent, err, file) { + argv.format = 'remark'; + /* eslint no-console: 0 */ + var log = argv.q ? noop : console.log.bind(console, '[documentation-readme] '); - if (err) { - throw err; - } + var readmeContent = fs.readFileSync(argv.readmeFile, 'utf8'); - var diffOutput = disparity.unified(readmeContent, file.contents, { - paths: [readmeFile, readmeFile] - }); - if (!diffOutput.length) { - log(readmeFile + ' is up to date.'); - process.exit(0); - } + documentation.build(argv.input, argv) + .then(comments => + documentation.formats.remark(comments, argv)) + .then(docsAst => remark().use(plugin, { + section: argv.section, + toInject: JSON.parse(docsAst) + }).process(readmeContent)) + .then(file => { + var diffOutput = disparity.unified(readmeContent, file.contents, { + paths: [argv.readmeFile, argv.readmeFile] + }); + if (!diffOutput.length) { + log(`${argv.readmeFile} is up to date.`); + process.exit(0); + } - if (argv.d) { - log(chalk.bold(readmeFile + ' needs the following updates:'), '\n' + diffOutput); - process.exit(1); - } else { - log(chalk.bold('Updating ' + readmeFile), '\n' + diffOutput); - } + if (argv.d) { + log(chalk.bold(`${argv.readmeFile} needs the following updates:`), `\n${diffOutput}`); + process.exit(1); + } else { + log(chalk.bold(`Updating ${argv.readmeFile}`), `\n${diffOutput}`); + } - fs.writeFileSync(readmeFile, file.contents); - } + fs.writeFileSync(argv.readmeFile, file.contents); + }) + .catch(err => { + console.error(err); + process.exit(1); + }); }; // wrap the inject utility as an remark plugin function plugin(remark, options) { return function transform(targetAst, file, next) { if (!inject(options.section, targetAst, options.toInject)) { - return next(new Error('Heading ' + options.section + ' not found.')); + return next(new Error(`Heading ${options.section} not found.`)); } next(); }; diff --git a/lib/commands/serve.js b/lib/commands/serve.js index 410cbcc0e..c25349a07 100644 --- a/lib/commands/serve.js +++ b/lib/commands/serve.js @@ -1,11 +1,15 @@ +/* @flow */ 'use strict'; var errorPage = require('../../lib/serve/error_page'), + fs = require('fs'), extend = require('extend'), + path = require('path'), + chokidar = require('chokidar'), sharedOptions = require('./shared_options'), - Server = require('../../lib/serve/server'); - -var build = require('./build').handler; + Server = require('../../lib/serve/server'), + debounce = require('debounce'), + documentation = require('../../'); module.exports.command = 'serve [input..]'; module.exports.description = 'generate, update, and display HTML documentation'; @@ -34,16 +38,53 @@ module.exports.builder = extend( * @param {Object} argv cli input * @returns {undefined} has side effects */ -module.exports.handler = function serve(argv) { +module.exports.handler = function serve(argv/*: Object*/) { argv._handled = true; + + if (!argv.input.length) { + try { + argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + } catch (e) { + throw new Error('documentation was given no files and was not run in a module directory'); + } + } + var server = new Server(argv.port); + var watcher; + server.on('listening', function () { - process.stdout.write('documentation.js serving on port ' + argv.port + '\n'); + process.stdout.write(`documentation.js serving on port ${argv.port}\n`); }); - build(extend({}, { format: 'html' }, argv), function (err, output) { - if (err) { - return server.setFiles([errorPage(err)]).start(); + + function updateWatcher() { + if (!watcher) { + watcher = chokidar.watch(argv.input); + watcher.on('all', debounce(updateServer, 300)); } - server.setFiles(output).start(); - }); + + documentation.expandInputs(argv.input, argv) + .then(files => { + watcher.add(files.map(data => + typeof data === 'string' ? data : data.file)); + }).catch(err => { + /* eslint no-console: 0 */ + return server.setFiles([errorPage(err)]).start(); + }); + } + + function updateServer() { + documentation.build(argv.input, argv) + .then(comments => + documentation.formats.html(comments, argv)) + .then(files => { + if (argv.watch) { + updateWatcher(); + } + server.setFiles(files).start(); + }).catch(err => { + return server.setFiles([errorPage(err)]).start(); + }); + } + + updateServer(); }; diff --git a/lib/commands/shared_options.js b/lib/commands/shared_options.js index 192757f27..d50c45930 100644 --- a/lib/commands/shared_options.js +++ b/lib/commands/shared_options.js @@ -1,13 +1,11 @@ -var path = require('path'); +/* @flow */ +'use strict'; /** * Adds shared options to any command that runs documentation - * - * @param {Object} parser yargs object - * @returns {Object} same yargs object with options - * @private */ module.exports.sharedInputOptions = { + strict: true, 'shallow': { describe: 'shallow mode turns off dependency resolution, ' + 'only processing the specified files (or the main script specified in package.json)', @@ -19,26 +17,28 @@ module.exports.sharedInputOptions = { alias: 'c', type: 'string' }, + 'no-package': { + describe: 'dont find and use package.json for project- configuration option defaults', + alias: 'np', + type: 'boolean', + default: false + }, 'external': { describe: 'a string / glob match pattern that defines which external ' + 'modules will be whitelisted and included in the generated documentation.', default: null }, - 'requireExtension': { + 'require-extension': { describe: 'additional extensions to include in require() and import\'s search algorithm.' + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', - coerce: function (value) { - // Ensure that the value is an array - return [].concat(value); - }, + // Ensure that the value is an array + coerce: (value/*: string | Array*/) => [].concat(value), alias: 're' }, - 'parseExtension': { + 'parse-extension': { describe: 'additional extensions to parse as source code.', - coerce: function (value) { - // Ensure that the value is an array - return [].concat(value); - }, + // Ensure that the value is an array + coerce: (value/*: string | Array*/) => [].concat(value), alias: 'pe' }, 'polyglot': { @@ -85,40 +85,34 @@ module.exports.sharedInputOptions = { /** * Adds shared options to any command that runs documentation - * - * @param {Object} parser yargs object - * @returns {Object} same yargs object with options - * @private */ module.exports.sharedOutputOptions = { theme: { describe: 'specify a theme: this must be a valid theme module', alias: 't' }, - name: { + 'project-name': { describe: 'project name. by default, inferred from package.json' }, + 'project-version': { + describe: 'project version. by default, inferred from package.json' + }, + 'project-homepage': { + describe: 'project homepage. by default, inferred from package.json' + }, + format: { + alias: 'f', + default: 'json', + choices: ['json', 'md', 'remark', 'html'] + }, watch: { describe: 'watch input files and rebuild documentation when they change', alias: 'w', type: 'boolean' }, - 'project-version': { - describe: 'project version. by default, inferred from package.json' - } -}; - -module.exports.expandInputs = function (argv) { - if (argv.input === undefined || argv.input.length == 0) { - try { - var p = require(path.resolve('package.json')); - argv.package = p; - argv.input = [p.main || 'index.js']; - return argv; - } catch (e) { - throw new Error('documentation was given no files and was not run in a module directory'); - } - } else { - return argv; + 'markdown-toc': { + describe: 'include a table of contents in markdown output', + default: true, + type: 'boolean' } }; diff --git a/lib/extractors/comments.js b/lib/extractors/comments.js index 720bfef5f..b0da981b3 100644 --- a/lib/extractors/comments.js +++ b/lib/extractors/comments.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var traverse = require('babel-traverse').default, isJSDocComment = require('../../lib/is_jsdoc_comment'); @@ -5,15 +7,19 @@ var traverse = require('babel-traverse').default, * Iterate through the abstract syntax tree, finding a different kind of comment * each time, and optionally including context. This is how we find * JSDoc annotations that will become part of documentation - * @param {string} type comment type to find - * @param {boolean} includeContext to include context in the nodes - * @param {Object} ast the babel-parsed syntax tree - * @param {Object} data the filename and the source of the file the comment is in - * @param {Function} addComment a method that creates a new comment if necessary - * @returns {Array} comments + * @param type comment type to find + * @param includeContext to include context in the nodes + * @param ast the babel-parsed syntax tree + * @param data the filename and the source of the file the comment is in + * @param addComment a method that creates a new comment if necessary + * @returns comments * @private */ -function walkComments(type, includeContext, ast, data, addComment) { +function walkComments(type/*: string*/, + includeContext/*: boolean*/, + ast/*: Object*/, + data/*: Object*/, + addComment/*: Function*/)/*: Array*/ { var newResults = []; traverse(ast, { @@ -23,7 +29,7 @@ function walkComments(type, includeContext, ast, data, addComment) { * @returns {undefined} causes side effects * @private */ - enter: function (path) { + enter(path) { /** * Parse a comment with doctrine and decorate the result with file position and code context. * diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js index 89bb9d7a0..9b80aa00a 100644 --- a/lib/extractors/exported.js +++ b/lib/extractors/exported.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var traverse = require('babel-traverse').default, isJSDocComment = require('../../lib/is_jsdoc_comment'), t = require('babel-types'), @@ -17,7 +19,9 @@ var traverse = require('babel-traverse').default, * @returns {Array} comments * @private */ -function walkExported(ast, data, addComment) { +function walkExported(ast/*: Object */, data/*: { + file: string +} */, addComment/*: Function */) { var newResults = []; var filename = data.file; var dataCache = Object.create(null); @@ -55,10 +59,10 @@ function walkExported(ast, data, addComment) { } traverse(ast, { - Statement: function (path) { + Statement(path) { path.skip(); }, - ExportDeclaration: function (path) { + ExportDeclaration(path) { var declaration = path.get('declaration'); if (t.isDeclaration(declaration)) { traverseExportedSubtree(declaration, data, addComments); @@ -80,7 +84,7 @@ function walkExported(ast, data, addComment) { var specifiers = path.get('specifiers'); var source = path.node.source; var exportKind = path.node.exportKind; - specifiers.forEach(function (specifier) { + specifiers.forEach(specifier => { var specData = data; var local, exported; if (t.isExportDefaultSpecifier(specifier)) { @@ -131,11 +135,11 @@ function traverseExportedSubtree(path, data, addComments, overrideName) { if (path.isClass() || path.isObjectExpression()) { path.traverse({ - Property: function (path) { + Property(path) { addComments(data, path); path.skip(); }, - Method: function (path) { + Method(path) { addComments(data, path); path.skip(); } @@ -158,7 +162,7 @@ function getCachedData(dataCache, filePath) { file: path, source: input }, - ast: ast + ast }; dataCache[path] = value; } @@ -174,10 +178,10 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename) var rv; traverse(ast, { - Statement: function (path) { + Statement(path) { path.skip(); }, - ExportDeclaration: function (path) { + ExportDeclaration(path) { if (name === 'default' && path.isExportDefaultDeclaration()) { rv = path.get('declaration'); path.stop(); @@ -247,7 +251,7 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename) return { ast: rv, - data: data + data }; } @@ -256,10 +260,10 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename) function findLocalType(scope, local) { var rv; scope.path.traverse({ - Statement: function (path) { + Statement(path) { path.skip(); }, - TypeAlias: function (path) { + TypeAlias(path) { if (path.node.id.name === local) { rv = path; path.stop(); diff --git a/lib/filter_access.js b/lib/filter_access.js index d32564b64..c5ce346a1 100644 --- a/lib/filter_access.js +++ b/lib/filter_access.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var walk = require('./walk'); @@ -11,7 +13,7 @@ var walk = require('./walk'); * @param {Array} comments parsed comments (can be nested) * @return {Array} filtered comments */ -function filterAccess(levels, comments) { +function filterAccess(levels/*: Array*/, comments/*: Array*/) { levels = levels || ['public', 'undefined', 'protected']; function filter(comment) { diff --git a/lib/flow_doctrine.js b/lib/flow_doctrine.js index 6300be392..a7e46c07b 100644 --- a/lib/flow_doctrine.js +++ b/lib/flow_doctrine.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var namedTypes = { 'NumberTypeAnnotation': 'number', @@ -47,12 +49,13 @@ function propertyToField(property) { * @param {Object} type babel-parsed flow type * @returns {Object} doctrine compatible type */ -function flowDoctrine(type) { +function flowDoctrine(type/*: Object */)/*: DoctrineType*/ { if (type.type in namedTypes) { - return { + let doctrineType = { type: 'NameExpression', name: namedTypes[type.type] }; + return doctrineType; } if (type.type in oneToOne) { @@ -94,7 +97,7 @@ function flowDoctrine(type) { case 'FunctionTypeAnnotation': return { type: 'FunctionType', - params: type.params.map(function (param) { + params: type.params.map(param => { return { type: 'ParameterType', name: param.name.name, @@ -141,6 +144,10 @@ function flowDoctrine(type) { value: type.value }; } + + return { + type: 'AllLiteral' + }; } module.exports = flowDoctrine; diff --git a/lib/garbage_collect.js b/lib/garbage_collect.js index 79b8ed36b..94816c729 100644 --- a/lib/garbage_collect.js +++ b/lib/garbage_collect.js @@ -1,4 +1,6 @@ -function garbageCollect(comment) { +/* @flow */ +'use strict'; +function garbageCollect(comment/*: Comment*/) { delete comment.context.code; delete comment.context.ast; return comment; diff --git a/lib/git/find_git.js b/lib/git/find_git.js index 097ac2c4d..beb029449 100644 --- a/lib/git/find_git.js +++ b/lib/git/find_git.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var path = require('path'); var fs = require('fs'); @@ -6,10 +8,10 @@ var fs = require('fs'); /** * Given a full path to a single file, iterate upwards through the filesystem * to find a directory with a .git file indicating that it is a git repository - * @param {string} filename any file within a repository - * @returns {string|undefined} repository path + * @param filename any file within a repository + * @returns repository path */ -function findGit(filename) { +function findGit(filename/*: string*/) { var paths = filename.split(path.sep); for (var i = paths.length; i > 0; i--) { var p = path.resolve(paths.slice(0, i).join(path.sep) + path.sep + '.git'); diff --git a/lib/git/url_prefix.js b/lib/git/url_prefix.js index 8c12da93d..c35b6cb49 100644 --- a/lib/git/url_prefix.js +++ b/lib/git/url_prefix.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var fs = require('fs'); var path = require('path'); var gitUrlParse = require('git-url-parse'); @@ -16,10 +18,8 @@ var getRemoteOrigin = require('remote-origin-url'); */ function parsePackedRefs(packedRefs, branchName) { return packedRefs.split(/\n/) - .filter(function (line) { - return line[0] !== '#' && line[0] !== '^'; - }) - .reduce(function (memo, line) { + .filter(line => line[0] !== '#' && line[0] !== '^') + .reduce((memo, line) => { memo[line.split(' ')[1]] = line.split(' ')[0]; return memo; }, {})[branchName]; @@ -33,7 +33,8 @@ function parsePackedRefs(packedRefs, branchName) { * @returns {string} base HTTPS url of the GitHub repository * @throws {Error} if the root is not a git repo */ -function getGithubURLPrefix(root) { +function getGithubURLPrefix(root/*: string*/) { + var sha; try { var head = fs.readFileSync(path.join(root, '.git', 'HEAD'), 'utf8'); var branch = head.match(/ref\: (.*)/); @@ -41,7 +42,6 @@ function getGithubURLPrefix(root) { var branchName = branch[1]; var branchFileName = path.join(root, '.git', branchName); var packedRefsName = path.join(root, '.git', 'packed-refs'); - var sha; if (fs.existsSync(branchFileName)) { sha = fs.readFileSync(branchFileName, 'utf8'); } else if (fs.existsSync(packedRefsName)) { @@ -54,7 +54,9 @@ function getGithubURLPrefix(root) { } else { sha = head; } - return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + '/blob/' + sha.trim() + '/'; + if (sha) { + return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + '/blob/' + sha.trim() + '/'; + } } catch (e) { return null; } diff --git a/lib/github.js b/lib/github.js index 0e7a7ed6f..9c80a77e2 100644 --- a/lib/github.js +++ b/lib/github.js @@ -1,4 +1,6 @@ 'use strict'; +/* @flow */ + var path = require('path'); var findGit = require('../lib/git/find_git'); @@ -11,7 +13,7 @@ var getGithubURLPrefix = require('../lib/git/url_prefix'); * @param {Object} comment parsed comment * @return {Object} comment with github inferred */ -module.exports = function (comment) { +module.exports = function (comment/*: Comment*/) { var repoPath = findGit(comment.context.file); var root = repoPath ? path.dirname(repoPath) : '.'; var urlPrefix = getGithubURLPrefix(root); @@ -20,11 +22,13 @@ module.exports = function (comment) { .join('/'); if (urlPrefix) { - comment.context.path = fileRelativePath; - comment.context.github = urlPrefix + - fileRelativePath + - '#L' + comment.context.loc.start.line + '-' + - 'L' + comment.context.loc.end.line; + comment.context.github = { + url: urlPrefix + + fileRelativePath + + '#L' + comment.context.loc.start.line + '-' + + 'L' + comment.context.loc.end.line, + path: fileRelativePath + }; } return comment; }; diff --git a/lib/hierarchy.js b/lib/hierarchy.js index a597fc770..422d31362 100644 --- a/lib/hierarchy.js +++ b/lib/hierarchy.js @@ -3,21 +3,41 @@ var _ = require('lodash'); var hasOwnProperty = Object.prototype.hasOwnProperty; +/** + * Check if a given member object is of kind `event`. + * @param {Object} member - The member to check. + * @returns {boolean} `true` if it is of kind `event`, otherwise false. + */ +let isEvent = member => member.kind === 'event'; + +/*:: +declare type ReducedComment = { + name: string, + kind: ?string, + scope?: ?string +} */ + /** * Pick only relevant properties from a comment to store them in * an inheritance chain - * @param {Object} comment a parsed comment - * @returns {Object} reduced comment + * @param comment a parsed comment + * @returns reduced comment * @private */ -function pick(comment) { - var item = { +function pick(comment/*: Comment */)/*: ?ReducedComment */ { + if (typeof comment.name !== 'string') { + return undefined; + } + + var item/*: ReducedComment */ = { name: comment.name, kind: comment.kind }; + if (comment.scope) { item.scope = comment.scope; } + return item; } @@ -26,7 +46,7 @@ function pick(comment) { * @returns {Array} nested comments, with only root comments * at the top level. */ -module.exports = function (comments) { +module.exports = function (comments/*: Array*/) { var id = 0, root = { members: { @@ -35,16 +55,14 @@ module.exports = function (comments) { } }; - comments.forEach(function (comment) { + comments.forEach(comment => { var path = []; if (comment.memberof) { // TODO: full namepath parsing path = comment.memberof .split('.') - .map(function (segment) { - return ['static', segment]; - }); + .map(segment => ['static', segment]); } if (!comment.name) { @@ -139,28 +157,32 @@ module.exports = function (comments) { comment.members.events = events; - comment.path = path.map(pick).concat(pick(comment)); + comment.path = path.map(pick) + .concat(pick(comment)) + .filter(Boolean); var scopeChars = { instance: '#', static: '.' }; - comment.namespace = comment.path.reduce(function (memo, part) { + comment.namespace = comment.path.reduce((memo, part) => { if (part.kind === 'event') { return memo + '.event:' + part.name; } - return memo + (scopeChars[part.scope] || '') + part.name; + let scopeChar = ''; + if (part.scope) { + scopeChar = scopeChars[part.scope]; + } + return memo + scopeChar + part.name; }, ''); if (hasUndefinedParent) { - var memberOfTag = comment.tags.filter(function (tag) { - return tag.title === 'memberof'; - })[0]; + var memberOfTag = comment.tags.filter(tag => tag.title === 'memberof')[0]; var memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || 0; comment.errors.push({ - message: '@memberof reference to ' + comment.memberof + ' not found', + message: `@memberof reference to ${comment.memberof} not found`, commentLineNumber: memberOfTagLineNumber }); @@ -178,11 +200,3 @@ module.exports = function (comments) { return toComments(root.members.static); }; -/** - * Check if a given member object is of kind `event`. - * @param {Object} member - The member to check. - * @returns {boolean} `true` if it is of kind `event`, otherwise false. - */ -function isEvent(member) { - return member.kind === 'event'; -} diff --git a/lib/infer/access.js b/lib/infer/access.js index f2c171ba2..6a83f3377 100644 --- a/lib/infer/access.js +++ b/lib/infer/access.js @@ -1,6 +1,6 @@ -'use strict'; -var shouldSkipInference = require('./should_skip_inference'); +'use strict'; +/* @flow */ /** * Given a string with a pattern that might infer access level, like `^_`, @@ -10,7 +10,7 @@ var shouldSkipInference = require('./should_skip_inference'); * @returns {Function} inference method * @private */ -function inferAccessWithPattern(pattern) { +function inferAccessWithPattern(pattern/*: ?string*/) { var re = pattern && new RegExp(pattern); /** @@ -20,7 +20,7 @@ function inferAccessWithPattern(pattern) { * @param {Object} comment parsed comment * @returns {Object} comment with access inferred */ - return shouldSkipInference(function inferAccess(comment) { + return function inferAccess(comment/*: Comment */) { // This needs to run after inferName beacuse we infer the access based on // the name. if (re && comment.name && comment.access === undefined && re.test(comment.name)) { @@ -28,7 +28,7 @@ function inferAccessWithPattern(pattern) { } return comment; - }); + }; } module.exports = inferAccessWithPattern; diff --git a/lib/infer/augments.js b/lib/infer/augments.js index 8982b58b4..0d4920b29 100644 --- a/lib/infer/augments.js +++ b/lib/infer/augments.js @@ -1,7 +1,8 @@ + 'use strict'; +/* @flow */ -var shouldSkipInference = require('./should_skip_inference'), - generate = require('babel-generator').default, +var generate = require('babel-generator').default, findClass = require('./finders').findClass; /** @@ -10,29 +11,27 @@ var shouldSkipInference = require('./should_skip_inference'), * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferAugments() { - return shouldSkipInference(function inferAugments(comment) { - if (comment.augments) { - return comment; - } +function inferAugments(comment/*: Comment */) { + if (comment.augments.length) { + return comment; + } - var path = findClass(comment.context.ast); + var path = findClass(comment.context.ast); - /* - * A superclass can be a single name, like React, - * or a MemberExpression like React.Component, - * so we generate code from the AST rather than assuming - * we can access a name like `path.node.superClass.name` - */ - if (path && path.node.superClass) { - comment.augments = [{ - title: 'augments', - name: generate(path.node.superClass).code - }]; - } + /* + * A superclass can be a single name, like React, + * or a MemberExpression like React.Component, + * so we generate code from the AST rather than assuming + * we can access a name like `path.node.superClass.name` + */ + if (path && path.node.superClass) { + comment.augments.push({ + title: 'augments', + name: generate(path.node.superClass).code + }); + } - return comment; - }); + return comment; } module.exports = inferAugments; diff --git a/lib/infer/finders.js b/lib/infer/finders.js index cef792d9f..fe6808c59 100644 --- a/lib/infer/finders.js +++ b/lib/infer/finders.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var t = require('babel-types'); @@ -10,7 +12,7 @@ var t = require('babel-types'); * @returns {?Object} ast path, if one is found. * @private */ -function findTarget(path) { +function findTarget(path/*: Object */) { if (!path) { return path; } @@ -40,7 +42,7 @@ function findTarget(path) { * @returns {?Object} ast path, if one is found. * @private */ -function findClass(path) { +function findClass(path/*: Object*/) { var target = findTarget(path); if (target && (target.isClassDeclaration() || target.isClassExpression())) { return target; diff --git a/lib/infer/kind.js b/lib/infer/kind.js index cd5b8f246..d058899fc 100644 --- a/lib/infer/kind.js +++ b/lib/infer/kind.js @@ -1,6 +1,7 @@ + 'use strict'; +/* @flow */ -var shouldSkipInference = require('./should_skip_inference'); var t = require('babel-types'); /** @@ -9,60 +10,58 @@ var t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferKind() { - return shouldSkipInference(function inferKind(comment) { - if (comment.kind) { +function inferKind(comment/*: Comment*/) { + if (comment.kind) { + return comment; + } + + function findKind(node) { + if (!node) { return comment; } - function findKind(node) { - if (!node) { - return comment; - } - - if (t.isClassDeclaration(node)) { - comment.kind = 'class'; - } else if (t.isFunction(node)) { - if (node.kind === 'get' || node.kind === 'set') { - comment.kind = 'member'; - } else if (node.id && node.id.name && !!/^[A-Z]/.exec(node.id.name)) { - comment.kind = 'class'; - } else { - comment.kind = 'function'; - } - } else if (t.isTypeAlias(node)) { - comment.kind = 'typedef'; - } else if (t.isVariableDeclaration(node)) { - if (node.kind === 'const') { - comment.kind = 'constant'; - } else { - // This behavior is in need of fixing https://github.com/documentationjs/documentation/issues/351 - findKind(node.declarations[0].init); - } - } else if (t.isExportDeclaration(node)) { - // export var x = ... - // export function f() {} - // export class C {} - // export default function f() {} - // export default class C {} - findKind(node.declaration); - } else if (t.isExpressionStatement(node)) { - // module.exports = function() {} - findKind(node.expression.right); - } else if (t.isClassProperty(node)) { + if (t.isClassDeclaration(node)) { + comment.kind = 'class'; + } else if (t.isFunction(node)) { + if (node.kind === 'get' || node.kind === 'set') { comment.kind = 'member'; - } else if (t.isProperty(node)) { - // { foo: function() {} } - findKind(node.value); + } else if (node.id && node.id.name && !!/^[A-Z]/.exec(node.id.name)) { + comment.kind = 'class'; + } else { + comment.kind = 'function'; + } + } else if (t.isTypeAlias(node)) { + comment.kind = 'typedef'; + } else if (t.isVariableDeclaration(node)) { + if (node.kind === 'const') { + comment.kind = 'constant'; + } else { + // This behavior is in need of fixing https://github.com/documentationjs/documentation/issues/351 + findKind(node.declarations[0].init); } + } else if (t.isExportDeclaration(node)) { + // export var x = ... + // export function f() {} + // export class C {} + // export default function f() {} + // export default class C {} + findKind(node.declaration); + } else if (t.isExpressionStatement(node)) { + // module.exports = function() {} + findKind(node.expression.right); + } else if (t.isClassProperty(node)) { + comment.kind = 'member'; + } else if (t.isProperty(node)) { + // { foo: function() {} } + findKind(node.value); } + } - if (comment.context.ast) { - findKind(comment.context.ast.node); - } + if (comment.context.ast) { + findKind(comment.context.ast.node); + } - return comment; - }); + return comment; } module.exports = inferKind; diff --git a/lib/infer/membership.js b/lib/infer/membership.js index 3197dde49..3da6353c8 100644 --- a/lib/infer/membership.js +++ b/lib/infer/membership.js @@ -1,8 +1,9 @@ + 'use strict'; +/* @flow */ var n = require('babel-types'), pathParse = require('parse-filepath'), - shouldSkipInference = require('./should_skip_inference'), isJSDocComment = require('../../lib/is_jsdoc_comment'), parse = require('../../lib/parse'); @@ -48,7 +49,7 @@ function extractThis(path) { * @returns {undefined} has side-effects * @private */ - ThisExpression: function (path) { + ThisExpression(path) { var scope = path.scope; while (n.isBlockStatement(scope.block)) { @@ -97,7 +98,7 @@ function extractIdentifiers(path) { * @returns {undefined} has side-effects * @private */ - Identifier: function (path) { + Identifier(path) { identifiers.push(path.node.name); } }); @@ -126,10 +127,15 @@ function countModuleIdentifiers(comment, identifiers) { /** * Returns the comment object after normalizing Foo.prototype and Foo# expressions - * @param {Object} comment parsed comment - * @returns {Object} the normalized comment + * @param comment parsed comment + * @returns the normalized comment */ -function normalizeMemberof(comment) { +function normalizeMemberof(comment/*: Comment*/)/*: Comment */ { + + if (typeof comment.memberof != 'string') { + return comment; + } + var memberof = comment.memberof; var isPrototype = /.prototype$/; @@ -211,14 +217,18 @@ module.exports = function () { } } - return shouldSkipInference(function inferMembership(comment) { + return function inferMembership(comment/*: Comment */) { + + if (comment.tags.some(tag => tag.title === 'name')) { + return comment; + } if (comment.kind === 'module') { currentModule = comment; } if (comment.lends) { - return; + return comment; } if (comment.memberof) { @@ -286,6 +296,18 @@ module.exports = function () { } } + // Foo = { bar() {} }; + // Foo.prototype = { bar() {} }; + // Foo.bar = { baz() {} }; + if (n.isObjectMethod(path.node) && + n.isObjectExpression(path.parentPath) && + n.isAssignmentExpression(path.parentPath.parentPath)) { + identifiers = extractIdentifiers(path.parentPath.parentPath.get('left')); + if (identifiers.length >= 1) { + inferMembershipFromIdentifiers(comment, identifiers); + } + } + // var Foo = { bar: ... } if (n.isIdentifier(path) && n.isObjectProperty(path.parentPath) && @@ -335,5 +357,5 @@ module.exports = function () { */ return comment; - }); + }; }; diff --git a/lib/infer/name.js b/lib/infer/name.js index 3f0b89fa8..701e291dd 100644 --- a/lib/infer/name.js +++ b/lib/infer/name.js @@ -1,7 +1,8 @@ + 'use strict'; +/* @flow */ -var shouldSkipInference = require('./should_skip_inference'), - pathParse = require('parse-filepath'), +var pathParse = require('parse-filepath'), t = require('babel-types'); /** @@ -11,92 +12,92 @@ var shouldSkipInference = require('./should_skip_inference'), * @param {Object} comment parsed comment * @returns {Object} comment with name inferred */ -module.exports = function () { - return shouldSkipInference(function inferName(comment) { - if (comment.name) { - return comment; - } +function inferName(comment/*: Comment */) { + if (comment.name) { + return comment; + } - if (comment.alias) { - comment.name = comment.alias; - return comment; - } + if (comment.alias) { + comment.name = comment.alias; + return comment; + } - if (comment.kind === 'module') { - comment.name = pathParse(comment.context.file).name; - return comment; + if (comment.kind === 'module') { + comment.name = pathParse(comment.context.file).name; + return comment; + } + + function inferName(path, node) { + if (node && node.name) { + comment.name = node.name; + return true; + } + if (node && node.type === 'StringLiteral' && node.value) { + comment.name = node.value; + return true; } + } - function inferName(path, node) { - if (node && node.name) { - comment.name = node.name; - return true; - } - if (node && node.type === 'StringLiteral' && node.value) { - comment.name = node.value; - return true; + var path = comment.context.ast; + if (path) { + if (path.type === 'ExportDefaultDeclaration') { + if (t.isDeclaration(path.node.declaration) && path.node.declaration.id) { + comment.name = path.node.declaration.id.name; + } else { + comment.name = pathParse(comment.context.file).name; } + return comment; } - var path = comment.context.ast; - if (path) { - if (path.type === 'ExportDefaultDeclaration') { - if (t.isDeclaration(path.node.declaration) && path.node.declaration.id) { - comment.name = path.node.declaration.id.name; - } else { - comment.name = pathParse(comment.context.file).name; + // The strategy here is to do a depth-first traversal of the AST, + // looking for nodes with a "name" property, with exceptions as needed. + // For example, name inference for a MemberExpression `foo.bar = baz` will + // infer the named based on the `property` of the MemberExpression (`bar`) + // rather than the `object` (`foo`). + path.traverse({ + /** + * Attempt to extract the name from an Identifier node. + * If the name can be resolved, it will stop traversing. + * @param {Object} path ast path + * @returns {undefined} has side-effects + * @private + */ + Identifier(path) { + if (inferName(path, path.node)) { + path.stop(); } - return comment; - } - - // The strategy here is to do a depth-first traversal of the AST, - // looking for nodes with a "name" property, with exceptions as needed. - // For example, name inference for a MemberExpression `foo.bar = baz` will - // infer the named based on the `property` of the MemberExpression (`bar`) - // rather than the `object` (`foo`). - path.traverse({ - /** - * Attempt to extract the name from an Identifier node. - * If the name can be resolved, it will stop traversing. - * @param {Object} path ast path - * @returns {undefined} has side-effects - * @private - */ - Identifier: function (path) { + }, + /** + * Attempt to extract the name from a string literal that is the `key` + * part of an ObjectProperty node. If the name can be resolved, it + * will stop traversing. + * @param {Object} path ast path + * @returns {undefined} has side-effects + * @private + */ + StringLiteral(path) { + if (path.parent.type === 'ObjectProperty' && path.node === path.parent.key) { if (inferName(path, path.node)) { path.stop(); } - }, - /** - * Attempt to extract the name from a string literal that is the `key` - * part of an ObjectProperty node. If the name can be resolved, it - * will stop traversing. - * @param {Object} path ast path - * @returns {undefined} has side-effects - * @private - */ - StringLiteral: function (path) { - if (path.parent.type === 'ObjectProperty' && path.node === path.parent.key) { - if (inferName(path, path.node)) { - path.stop(); - } - } - }, - /** - * Attempt to extract the name from an Identifier node. - * If the name can be resolved, it will stop traversing. - * @param {Object} path ast path - * @returns {undefined} has side-effects - * @private - */ - MemberExpression: function (path) { - if (inferName(path, path.node.property)) { - path.stop(); - } } - }); - } + }, + /** + * Attempt to extract the name from an Identifier node. + * If the name can be resolved, it will stop traversing. + * @param {Object} path ast path + * @returns {undefined} has side-effects + * @private + */ + MemberExpression(path) { + if (inferName(path, path.node.property)) { + path.stop(); + } + } + }); + } - return comment; - }); -}; + return comment; +} + +module.exports = inferName; diff --git a/lib/infer/params.js b/lib/infer/params.js index 050a6a67e..d5bcb0c55 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -1,10 +1,56 @@ + 'use strict'; +/* @flow */ -var shouldSkipInference = require('./should_skip_inference'), - t = require('babel-types'), +var t = require('babel-types'), findTarget = require('./finders').findTarget, flowDoctrine = require('../flow_doctrine'); +function addPrefix(doc, prefix) { + if (!Array.isArray(doc) && doc.name) { + doc.name = prefix + doc.name; + } + return doc; +} + +/** + * Given a parameter like + * + * function a(b = 1) + * + * Format it as an optional parameter in JSDoc land + * + * @param {Object} param ESTree node + * @returns {Object} JSDoc param + */ +function paramWithDefaultToDoc(param, comment, i)/*: CommentTag | Array */ { + var newParam = paramToDoc(param.left, comment, i, ''); + + var defaultValue = comment.context.code.substring( + param.right.start, param.right.end); + + // this is a destructuring parameter with defaults + if (Array.isArray(newParam)) { + newParam[0].default = defaultValue; + return newParam; + } + + var optionalParam/*: CommentTag */ = { + title: 'param', + name: newParam.name, + 'default': defaultValue + }; + + if (newParam.type) { + optionalParam.type = { + type: 'OptionalType', + expression: newParam.type + }; + } + + return optionalParam; +} + /** * Babel parses JavaScript source code and produces an abstract syntax * tree that includes methods and their arguments. This function takes @@ -23,71 +69,28 @@ var shouldSkipInference = require('./should_skip_inference'), * @param {string} prefix of the comment, if it is nested, like in the case of destructuring * @returns {Object} parameter with inference. */ -function paramToDoc(param, comment, i, prefix) { - - prefix = prefix || ''; - - function addPrefix(doc) { - if (!Array.isArray(doc)) { - doc.name = prefix + doc.name; - } - return doc; - } +function paramToDoc(param, + comment/*: Comment */, + i/*: number */, + prefix/*: string */)/*: Array | CommentTag */ { - /** - * Given a parameter like - * - * function a(b = 1) - * - * Format it as an optional parameter in JSDoc land - * - * @param {Object} param ESTree node - * @returns {Object} JSDoc param - */ - function paramWithDefaultToDoc(param) { - var newParam = paramToDoc(param.left, comment, i); - - var defaultValue = comment.context.code.substring( - param.right.start, param.right.end); - - // this is a destructuring parameter with defaults - if (Array.isArray(newParam)) { - newParam[0].default = defaultValue; - return newParam; - } - - var optionalParam = { - title: 'param', - name: newParam.name, - 'default': defaultValue - }; - - if (newParam.type) { - optionalParam.type = { - type: 'OptionalType', - expression: newParam.type - }; - } - - return optionalParam; - } - - function destructuringPropertyToDoc(property) { + function destructuringPropertyToDoc(property)/*: Array | CommentTag */ { if (property.type === 'ObjectProperty') { - return paramToDoc(property.value, comment, i, prefix + '$' + i + '.'); + return paramToDoc(property.value, comment, i, prefix + '$' + String(i) + '.'); } else if (property.type === 'Identifier') { // if the destructuring type is an array, the elements // in it are identifiers - return paramToDoc(property, comment, i, prefix + '$' + i + '.'); + return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); } else if (property.type === 'RestProperty') { - return paramToDoc(property, comment, i, prefix + '$' + i + '.'); + return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); } + throw new Error(`Unknown property encountered: ${property.type}`); } - function destructuringObjectParamToDoc(param) { + function destructuringObjectParamToDoc(param)/*: Array */ { return [{ title: 'param', - name: '$' + i, + name: '$' + String(i), type: flowDoctrine(param) || { type: 'NameExpression', name: 'Object' @@ -95,10 +98,10 @@ function paramToDoc(param, comment, i, prefix) { }].concat(param.properties.map(destructuringPropertyToDoc)); } - function destructuringArrayParamToDoc(param) { + function destructuringArrayParamToDoc(param)/*: Array */ { return [{ title: 'param', - name: '$' + i, + name: '$' + String(i), type: flowDoctrine(param) || { type: 'NameExpression', name: 'Array' @@ -106,39 +109,40 @@ function paramToDoc(param, comment, i, prefix) { }].concat(param.elements.map(destructuringPropertyToDoc)); } - function restParamToDoc(param) { + function restParamToDoc(param)/*: CommentTag */ { + let type/*: DoctrineType */ = { + type: 'RestType' + }; + if (param.typeAnnotation) { + type.expression = flowDoctrine(param.typeAnnotation.typeAnnotation); + } var newParam = { title: 'param', name: param.argument.name, lineNumber: param.loc.start.line, - type: { - type: 'RestType' - } + type }; - if (param.typeAnnotation) { - newParam.type.expression = flowDoctrine(param.typeAnnotation.typeAnnotation); - } return newParam; } // ES6 default if (param.type === 'AssignmentPattern') { - return addPrefix(paramWithDefaultToDoc(param)); + return addPrefix(paramWithDefaultToDoc(param, comment, i), prefix); } if (param.type === 'ObjectPattern') { - return addPrefix(destructuringObjectParamToDoc(param)); + return destructuringObjectParamToDoc(param); } if (param.type === 'ArrayPattern') { - return addPrefix(destructuringArrayParamToDoc(param)); + return destructuringArrayParamToDoc(param); } if (param.type === 'RestProperty' || param.type === 'RestElement') { - return addPrefix(restParamToDoc(param)); + return addPrefix(restParamToDoc(param), prefix); } - var newParam = { + var newParam/*: CommentTag */ = { title: 'param', name: param.name, lineNumber: param.loc.start.line @@ -149,13 +153,14 @@ function paramToDoc(param, comment, i, prefix) { newParam.type = flowDoctrine(param.typeAnnotation.typeAnnotation); } - return addPrefix(newParam); + return addPrefix(newParam, prefix); } function insertBeforeDependents(comment, comments) { var dependentNamePrefix = comment.name + '.'; for (var insertionIndex = 0; insertionIndex < comments.length; insertionIndex++) { - if (comments[insertionIndex].name.indexOf(dependentNamePrefix) === 0) { + let commentName = comments[insertionIndex].name; + if (commentName && commentName.indexOf(dependentNamePrefix) === 0) { break; } } @@ -170,62 +175,58 @@ function insertBeforeDependents(comment, comments) { * @param {Object} comment parsed comment * @returns {Object} comment with parameters */ -function inferParams() { - return shouldSkipInference(function inferParams(comment) { - var path = findTarget(comment.context.ast); - - // In case of `/** */ var x = function () {}` findTarget returns - // the declarator. - if (t.isVariableDeclarator(path)) { - path = path.get('init'); - } +function inferParams(comment/*: Comment */) { + var path = findTarget(comment.context.ast); + + // In case of `/** */ var x = function () {}` findTarget returns + // the declarator. + if (t.isVariableDeclarator(path)) { + path = path.get('init'); + } + + if (!t.isFunction(path)) { + return comment; + } - if (!t.isFunction(path)) { - return comment; + // Ensure that explicitly specified parameters are not overridden + // by inferred parameters + var existingParams = {}; + comment.params.forEach(function (param) { + if (typeof param.name === 'string') { + existingParams[param.name] = param; } + }); - // Ensure that explicitly specified parameters are not overridden - // by inferred parameters - var existingParams = (comment.params || []).reduce(function (memo, param) { - memo[param.name] = param; - return memo; - }, {}); - - var paramOrder = {}; - var i = 0; - - path.node.params - .reduce(function (params, param, i) { - return params.concat(paramToDoc(param, comment, i)); - }, []) - .forEach(function (doc) { - if (!existingParams.hasOwnProperty(doc.name)) { - // This type is not explicitly documented - if (!comment.params) { - comment.params = []; - } - - comment.params = insertBeforeDependents(doc, comment.params); - } else if (!existingParams[doc.name].type) { - // This param has a description, but potentially it can - // be have an inferred type. Infer its type without - // dropping the description. - if (doc.type) { - existingParams[doc.name].type = doc.type; - } - } else if (existingParams[doc.name].type.type !== 'OptionalType' && - doc.default) { - existingParams[doc.name].type = { - type: 'OptionalType', - expression: existingParams[doc.name].type, - default: doc.default - }; + var paramOrder = {}; + var i = 0; + + path.node.params + .reduce(function (params, param, i) { + return params.concat(paramToDoc(param, comment, i, '')); + }, []) + .forEach(function (doc) { + if (!existingParams.hasOwnProperty(doc.name)) { + // This type is not explicitly documented + comment.params = insertBeforeDependents(doc, comment.params); + } else if (!existingParams[doc.name].type) { + // This param has a description, but potentially it can + // be have an inferred type. Infer its type without + // dropping the description. + if (doc.type) { + existingParams[doc.name].type = doc.type; } - paramOrder[doc.name] = i++; - }); + } else if (existingParams[doc.name].type.type !== 'OptionalType' && + doc.default) { + existingParams[doc.name].type = { + type: 'OptionalType', + expression: existingParams[doc.name].type, + default: doc.default + }; + } + paramOrder[doc.name] = i++; + }); - return comment; - }); + return comment; } module.exports = inferParams; diff --git a/lib/infer/properties.js b/lib/infer/properties.js index a5c16f72a..4b6112d15 100644 --- a/lib/infer/properties.js +++ b/lib/infer/properties.js @@ -1,9 +1,33 @@ + 'use strict'; +/* @flow */ -var shouldSkipInference = require('./should_skip_inference'), - t = require('babel-types'), +var t = require('babel-types'), flowDoctrine = require('../flow_doctrine'); +function prefixedName(name, prefix) { + if (prefix.length) { + return prefix.join('.') + '.' + name; + } + return name; +} + +function propertyToDoc(property, prefix)/*: CommentTag */ { + var type = flowDoctrine(property.value); + if (property.optional) { + type = { + type: 'OptionalType', + expression: type + }; + } + return { + title: 'property', + name: prefixedName(property.key.name, prefix), + lineNumber: property.loc.start.line, + type + }; +} + /** * Infers properties of TypeAlias objects (Flow or TypeScript type definitions) @@ -11,65 +35,32 @@ var shouldSkipInference = require('./should_skip_inference'), * @param {Object} comment parsed comment * @returns {Object} comment with inferred properties */ -function inferProperties() { - - function prefixedName(name, prefix) { - if (prefix.length) { - return prefix.join('.') + '.' + name; - } - return name; - } - - function propertyToDoc(property, prefix) { - var type = flowDoctrine(property.value); - if (property.optional) { - type = { - type: 'OptionalType', - expression: type - }; - } - var newProperty = { - title: 'property', - name: prefixedName(property.key.name, prefix), - lineNumber: property.loc.start.line, - type: type - }; - return newProperty; - } +function inferProperties(comment/*: Comment */)/*: Comment */ { - return shouldSkipInference(function inferProperties(comment) { + let explicitProperties = new Set(); + // Ensure that explicitly specified properties are not overridden + // by inferred properties + comment.properties.forEach(prop => explicitProperties.add(prop)); - - // Ensure that explicitly specified properties are not overridden - // by inferred properties - var explicitProperties = (comment.properties || []).reduce(function (memo, property) { - memo[property.name] = true; - return memo; - }, {}); - - function inferProperties(value, prefix) { - if (value.type === 'ObjectTypeAnnotation') { - value.properties.forEach(function (property) { - if (explicitProperties[prefixedName(property.key.name, prefix)] === undefined) { - if (!comment.properties) { - comment.properties = []; - } - comment.properties = comment.properties.concat(propertyToDoc(property, prefix)); - // Nested type parameters - if (property.value.type === 'ObjectTypeAnnotation') { - inferProperties(property.value, prefix.concat(property.key.name)); - } + function inferProperties(value, prefix) { + if (value.type === 'ObjectTypeAnnotation') { + value.properties.forEach(function (property) { + if (!explicitProperties.has(prefixedName(property.key.name, prefix))) { + comment.properties = comment.properties.concat(propertyToDoc(property, prefix)); + // Nested type parameters + if (property.value.type === 'ObjectTypeAnnotation') { + inferProperties(property.value, prefix.concat(property.key.name)); } - }); - } + } + }); } + } - if (t.isTypeAlias(comment.context.ast)) { - inferProperties(comment.context.ast.node.right, []); - } + if (t.isTypeAlias(comment.context.ast)) { + inferProperties(comment.context.ast.node.right, []); + } - return comment; - }); + return comment; } module.exports = inferProperties; diff --git a/lib/infer/return.js b/lib/infer/return.js index 790aa7a8b..9711d0ad7 100644 --- a/lib/infer/return.js +++ b/lib/infer/return.js @@ -1,8 +1,9 @@ + 'use strict'; +/* @flow */ var findTarget = require('./finders').findTarget, t = require('babel-types'), - shouldSkipInference = require('./should_skip_inference'), flowDoctrine = require('../flow_doctrine'); /** @@ -12,34 +13,35 @@ var findTarget = require('./finders').findTarget, * @param {Object} comment parsed comment * @returns {Object} comment with return tag inferred */ -module.exports = function () { - return shouldSkipInference(function inferReturn(comment) { - if (Array.isArray(comment.returns) && - comment.returns.length && - comment.returns[0].type) { - return comment; - } - var path = findTarget(comment.context.ast); - var fn = path && path.node; +function inferReturn(comment/*: Comment */) { + if (Array.isArray(comment.returns) && + comment.returns.length && + comment.returns[0].type) { + return comment; + } + var path = findTarget(comment.context.ast); + var fn = path && path.node; - // In case of `/** */ var x = function () {}` findTarget returns - // the declarator. - if (t.isVariableDeclarator(fn)) { - fn = fn.init; - } + // In case of `/** */ var x = function () {}` findTarget returns + // the declarator. + if (t.isVariableDeclarator(fn)) { + fn = fn.init; + } - if (t.isFunction(fn) && - fn.returnType && - fn.returnType.typeAnnotation) { - var returnType = flowDoctrine(fn.returnType.typeAnnotation); - if (comment.returns && comment.returns.length > 0) { - comment.returns[0].type = returnType; - } else { - comment.returns = [{ - type: returnType - }]; - } + if (t.isFunction(fn) && + fn.returnType && + fn.returnType.typeAnnotation) { + var returnType = flowDoctrine(fn.returnType.typeAnnotation); + if (comment.returns && comment.returns.length > 0) { + comment.returns[0].type = returnType; + } else { + comment.returns = [{ + title: 'returns', + type: returnType + }]; } - return comment; - }); -}; + } + return comment; +} + +module.exports = inferReturn; diff --git a/lib/infer/should_skip_inference.js b/lib/infer/should_skip_inference.js index 8554df946..5cacc1686 100644 --- a/lib/infer/should_skip_inference.js +++ b/lib/infer/should_skip_inference.js @@ -1,19 +1,12 @@ +/* @flow */ +'use strict'; + /** * Decide whether a comment should go through the AST inference * stage based on whether it has an explicit `@name` tag. - * - * @param {Function} fn parser - * @returns {boolean} true if the comment should skip inference */ -function shouldSkipInference(fn) { - return function (comment) { - if (comment.tags.some(function (tag) { - return tag.title === 'name'; - })) { - return comment; - } - return fn(comment); - }; +function shouldSkipInference(comment/*: Comment */) /*: boolean */ { + return comment.tags.some(tag => tag.title === 'name'); } module.exports = shouldSkipInference; diff --git a/lib/infer/type.js b/lib/infer/type.js index 74982cafe..3be875298 100644 --- a/lib/infer/type.js +++ b/lib/infer/type.js @@ -1,7 +1,8 @@ + 'use strict'; +/* @flow */ var findTarget = require('./finders').findTarget, - shouldSkipInference = require('./should_skip_inference'), flowDoctrine = require('../flow_doctrine'), t = require('babel-types'); @@ -18,39 +19,39 @@ var constTypeMapping = { * @param {Object} comment parsed comment * @returns {Object} comment with type tag inferred */ -module.exports = function () { - return shouldSkipInference(function inferType(comment) { - if (comment.type) { - return comment; - } +function inferType(comment/*: Comment */) { + if (comment.type) { + return comment; + } - var path = findTarget(comment.context.ast); - if (!path) { - return comment; - } + var path = findTarget(comment.context.ast); + if (!path) { + return comment; + } - var n = path.node; - var type; - switch (n.type) { - case 'VariableDeclarator': - type = n.id.typeAnnotation; - if (!type && comment.kind === 'constant') { - type = constTypeMapping[n.init.type]; - } - break; - case 'ClassProperty': - type = n.typeAnnotation; - break; - case 'TypeAlias': - type = n.right; - break; + var n = path.node; + var type; + switch (n.type) { + case 'VariableDeclarator': + type = n.id.typeAnnotation; + if (!type && comment.kind === 'constant') { + type = constTypeMapping[n.init.type]; } - if (type) { - if (t.isTypeAnnotation(type)) { - type = type.typeAnnotation; - } - comment.type = flowDoctrine(type); + break; + case 'ClassProperty': + type = n.typeAnnotation; + break; + case 'TypeAlias': + type = n.right; + break; + } + if (type) { + if (t.isTypeAnnotation(type)) { + type = type.typeAnnotation; } - return comment; - }); -}; + comment.type = flowDoctrine(type); + } + return comment; +} + +module.exports = inferType; diff --git a/lib/inline_tokenizer.js b/lib/inline_tokenizer.js index b41102f32..60b67c040 100644 --- a/lib/inline_tokenizer.js +++ b/lib/inline_tokenizer.js @@ -1,5 +1,7 @@ +/* @flow */ 'use strict'; + /** * Create a tokenizer method for Remark, our Markdown processor, * that is able to parse JSDoc inline tokens @@ -19,7 +21,7 @@ function makeTokenizer(type, regex) { } return eat(match[0])({ - type: type, + type, url: match[1], title: null, jsdoc: true, @@ -53,7 +55,7 @@ var tokenizeTutorial = makeTokenizer('tutorial', /^\{@tutorial\s+(.+?)(?:[\s|](. * @param {Object} processor - remark instance * @returns {undefined} */ -module.exports = function (processor) { +module.exports = function (processor/*: Object*/) { var proto = processor.Parser.prototype; proto.inlineTokenizers.tokenizeLink = tokenizeLink; proto.inlineTokenizers.tokenizeTutorial = tokenizeTutorial; diff --git a/lib/input/dependency.js b/lib/input/dependency.js index e7b81433e..39e9f9a51 100644 --- a/lib/input/dependency.js +++ b/lib/input/dependency.js @@ -1,7 +1,8 @@ + 'use strict'; +/* @flow */ var mdeps = require('module-deps-sortable'); -var fs = require('fs'); var path = require('path'); var babelify = require('babelify'); var concat = require('concat-stream'); @@ -15,25 +16,21 @@ var smartGlob = require('../smart_glob.js'); * This stream requires filesystem access, and thus isn't suitable * for a browser environment. * - * @param {Array} indexes paths to entry files as strings - * @param {Object} options optional options passed - * @param {Function} callback called with (err, inputs) - * @returns {undefined} calls callback + * @param indexes paths to entry files as strings + * @param config optional options passed + * @returns results */ -function dependencyStream(indexes, options, callback) { +function dependencyStream(indexes/*: Array*/, + config/*: DocumentationConfig */)/*: Promise>*/ { var md = mdeps({ /** * Determine whether a module should be included in documentation * @param {string} id path to a module * @returns {boolean} true if the module should be included. */ - filter: function (id) { - return !!options.external || moduleFilters.internalOnly(id); - }, - extensions: [].concat(options.requireExtension || []) - .map(function (ext) { - return '.' + ext.replace(/^\./, ''); - }) + filter: id => !!config.external || moduleFilters.internalOnly(id), + extensions: [].concat(config.requireExtension || []) + .map(ext => '.' + ext.replace(/^\./, '')) .concat(['.js', '.json', '.es6', '.jsx']), transform: [babelify.configure({ sourceMap: false, @@ -50,33 +47,33 @@ function dependencyStream(indexes, options, callback) { require('babel-plugin-system-import-transformer').default ] })], - postFilter: moduleFilters.externals(indexes, options) + postFilter: moduleFilters.externals(indexes, config) }); - smartGlob(indexes, options.parseExtensions).forEach(function (index) { + smartGlob(indexes, config.parseExtension).forEach(index => { md.write(path.resolve(index)); }); md.end(); - md.once('error', function (error) { - return callback(error); + + return new Promise((resolve, reject) => { + md.once('error', reject); + md.pipe(concat(function (inputs) { + resolve(inputs + .filter(input => + // At this point, we may have allowed a JSON file to be caught by + // module-deps, or anything else allowed by requireExtension. + // otherwise module-deps would complain about + // it not being found. But Babel can't parse JSON, so we filter non-JavaScript + // files away. + config.parseExtension.indexOf( + path.extname(input.file).replace(/^\./, '') + ) > -1) + .map(input => { + // remove source file, since it's transformed anyway + delete input.source; + return input; + })); + })); }); - md.pipe(concat(function (inputs) { - callback(null, inputs - .filter(function (input) { - // At this point, we may have allowed a JSON file to be caught by - // module-deps, or anything else allowed by requireExtension. - // otherwise module-deps would complain about - // it not being found. But Babel can't parse JSON, so we filter non-JavaScript - // files away. - return options.parseExtensions.indexOf( - path.extname(input.file).replace(/^\./, '') - ) > -1; - }) - .map(function (input) { - // un-transform babelify transformed source - input.source = fs.readFileSync(input.file, 'utf8'); - return input; - })); - })); } module.exports = dependencyStream; diff --git a/lib/input/shallow.js b/lib/input/shallow.js index ec52d2239..5727f0484 100644 --- a/lib/input/shallow.js +++ b/lib/input/shallow.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var smartGlob = require('../smart_glob.js'); @@ -14,22 +16,26 @@ var smartGlob = require('../smart_glob.js'); * at all. This is one way of getting documentation.js to run in a browser * or without fs access. * - * @param {Array} indexes entry points - * @param {Object} options parsing options - * @param {Function} callback called with (err, inputs) - * @return {undefined} calls callback + * @param indexes entry points + * @param options parsing options + * @return promise with parsed files */ -module.exports = function (indexes, options, callback) { +module.exports = function (indexes/*: Array*/, + config/*: DocumentationConfig */)/*: Promise>*/ { var objects = []; var strings = []; - indexes.forEach(function (index) { + for (var index of indexes) { if (typeof index === 'string') { strings.push(index); } else if (typeof index === 'object') { objects.push(index); } else { - throw new Error('Indexes should be either strings or objects'); + return Promise.reject(new Error('Indexes should be either strings or objects')); } - }); - return callback(null, objects.concat(smartGlob(strings, options.parseExtensions))); + } + return Promise.resolve(objects + .concat(smartGlob(strings, config.parseExtension) + .map(file => ({ + file + })))); }; diff --git a/lib/is_jsdoc_comment.js b/lib/is_jsdoc_comment.js index 4f4b14385..fd5a70f32 100644 --- a/lib/is_jsdoc_comment.js +++ b/lib/is_jsdoc_comment.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ /** * Detect whether a comment is a JSDoc comment: it must be a block @@ -12,7 +14,10 @@ * @param {Object} comment an ast node of the comment * @return {boolean} whether it is valid */ -module.exports = function isJSDocComment(comment) { +module.exports = function isJSDocComment(comment/*: { + value: string, + type: string +}*/) { var asterisks = comment.value.match(/^(\*+)/); return (comment.type === 'CommentBlock' || // estree comment.type === 'Block') // get-comments / traditional diff --git a/lib/lint.js b/lib/lint.js index aa32990c0..89575bc0f 100644 --- a/lib/lint.js +++ b/lib/lint.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var VFile = require('vfile'), walk = require('../lib/walk'), @@ -22,10 +24,10 @@ var CANONICAL = { * @param {Object} comment parsed comment * @returns {Array} array of errors */ -function lintComments(comment) { +function lintComments(comment/*: Comment*/) { comment.tags.forEach(function (tag) { function nameInvariant(name) { - if (CANONICAL[name]) { + if (name && typeof CANONICAL[name] === 'string') { comment.errors.push({ message: 'type ' + name + ' found, ' + CANONICAL[name] + ' is standard', commentLineNumber: tag.lineNumber @@ -38,7 +40,12 @@ function lintComments(comment) { nameInvariant(type.name); } - [type.elements, type.applications].forEach(checkSubtypes); + if (type.elements) { + checkSubtypes(type.elements); + } + if (type.applications) { + checkSubtypes(type.applications); + } } function checkSubtypes(subtypes) { @@ -60,7 +67,7 @@ function lintComments(comment) { * @param {Array} comments a list of comments * @return {string} user-readable output */ -function formatLint(comments) { +function formatLint(comments/*: Array*/)/*: string */ { var vFiles = {}; walk(comments, function (comment) { comment.errors.forEach(function (error) { @@ -73,9 +80,7 @@ function formatLint(comments) { }); }); }); - return reporter(Object.keys(vFiles).map(function (p) { - return vfileSort(vFiles[p]); - })); + return reporter(Object.keys(vFiles).map(p => vfileSort(vFiles[p]))); } module.exports.lintComments = lintComments; diff --git a/lib/load_config.js b/lib/load_config.js deleted file mode 100644 index 3e0e9781b..000000000 --- a/lib/load_config.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - -var yaml = require('js-yaml'), - fs = require('fs'), - path = require('path'), - stripComments = require('strip-json-comments'); - -/** - * Try to load a configuration file: since this is configuration, we're - * lenient with respect to its structure. It can be JSON or YAML, - * and can contain comments, unlike normal JSON. - * - * @param {string} filePath the user-provided path to configuration - * @returns {Object} configuration, if it can be parsed - * @throws {Error} if the file cannot be read. - */ -function loadConfig(filePath) { - var ext = path.extname(filePath); - var absFilePath = path.resolve(process.cwd(), filePath); - var rawFile = fs.readFileSync(absFilePath, 'utf8'); - - try { - if (ext === '.json') { - return processToc(JSON.parse(stripComments(rawFile))); - } - - return processToc(yaml.safeLoad(rawFile)); - } catch (e) { - e.message = 'Cannot read config file: ' + - filePath + - '\nError: ' + - e.message; - throw e; - } - - function processToc(config) { - if (!config || !config.toc) { - return config; - } - - config.toc = config.toc.map(function (entry) { - if (entry && entry.file) { - entry.file = path.join( - path.dirname(absFilePath), - entry.file - ); - } - - return entry; - }); - - return config; - } -} - -module.exports = loadConfig; diff --git a/lib/merge_config.js b/lib/merge_config.js new file mode 100644 index 000000000..f0e765b19 --- /dev/null +++ b/lib/merge_config.js @@ -0,0 +1,87 @@ + +'use strict'; +/* @flow */ + +var yaml = require('js-yaml'), + fs = require('fs'), + pify = require('pify'), + _ = require('lodash'), + readPkgUp = require('read-pkg-up'), + path = require('path'), + stripComments = require('strip-json-comments'); + +function processToc(config /*: DocumentationConfig */, absFilePath/*: string*/) { + if (!config || !config.toc) { + return config; + } + + config.toc = config.toc.map(entry => { + if (entry && entry.file) { + entry.file = path.join( + path.dirname(absFilePath), + entry.file + ); + } + + return entry; + }); + + return config; +} + +/** + * Use the nearest package.json file for the default + * values of `name` and `version` config. + * + * @param {Object} config the user-provided config, usually via argv + * @returns {Object} configuration with inferred parameters + * @throws {Error} if the file cannot be read. + */ +function mergePackage(config/*: Object */)/*: Promise */ { + if (config.noPackage) { + return Promise.resolve(config); + } + return readPkgUp() + .then(pkg => + _.defaults({}, _.mapKeys(_.pick(pkg.pkg, ['name', 'homepage', 'version']), + (val, key) => `project-${key}`), config)) + // Allow this to fail: this inference is not required. + .catch(() => config); +} + +/** + * Merge a configuration file into program config, assuming that the location + * of the configuration file is given as one of those config. + * + * @param {Object} config the user-provided config, usually via argv + * @returns {Promise} configuration, if it can be parsed + * @throws {Error} if the file cannot be read. + */ +function mergeConfigFile(config)/*: Promise */ { + + if (config && typeof config.config === 'string') { + var filePath = config.config; + var ext = path.extname(filePath); + var absFilePath = path.resolve(process.cwd(), filePath); + return pify(fs).readFile(absFilePath, 'utf8') + .then(rawFile => { + if (ext === '.json') { + return Object.assign({}, config, processToc(JSON.parse(stripComments(rawFile)), absFilePath)); + } + return Object.assign({}, config, processToc(yaml.safeLoad(rawFile), absFilePath)); + }); + } + + return Promise.resolve(config || {}); +} + +function mergeConfig(config/*: Object */)/*: Promise */ { + + config.parseExtension = (config.parseExtension || []) + .concat(['js', 'jsx', 'es5', 'es6']); + + return mergeConfigFile(config) + .then(mergePackage); +} + +module.exports = mergeConfig; diff --git a/lib/module_filters.js b/lib/module_filters.js index 6dc31edae..6c10b1855 100644 --- a/lib/module_filters.js +++ b/lib/module_filters.js @@ -1,4 +1,6 @@ +/* @flow */ 'use strict'; + var path = require('path'); var micromatch = require('micromatch'); @@ -27,10 +29,10 @@ module.exports = { * @return {function} - A function for use as the module-deps `postFilter` * options. */ - externals: function externalModuleFilter(indexes, options) { + externals: function externalModuleFilter(indexes/*: Array*/, options/*: Object*/) { var externalFilters = false; if (options.external) { - externalFilters = indexes.map(function (index) { + externalFilters = indexes.map((index) => { // grab the path of the top-level node_modules directory. var topNodeModules = path.join(path.dirname(index), 'node_modules'); return function matchGlob(file, pkg) { @@ -53,13 +55,13 @@ module.exports = { }); } - return function (id, file, pkg) { + return function (id/*: string*/, + file/*: string*/, + pkg/*: Object*/) { var internal = internalModuleRegexp.test(id); return internal || (externalFilters && externalFilters - .some(function (f) { - return f(file, pkg); - })); + .some(f => f(file, pkg))); }; } }; diff --git a/lib/nest.js b/lib/nest.js index 0c688e395..af295d34d 100644 --- a/lib/nest.js +++ b/lib/nest.js @@ -1,16 +1,21 @@ +/* @flow */ 'use strict'; + /** * Nest nestable tags, like param and property, into nested * arrays that are suitable for output. * * @private * @param {Object} comment a comment with tags - * @param {string} tagName the tag to nest + * @param {string} tagTitle the tag to nest * @param {string} target the tag to nest into * @returns {Object} nested comment */ -function nestTag(comment, tagName, target) { +function nestTag( + comment/*: Comment */, + tagTitle/*: string */, + target/*: string */) { if (!comment[target]) { return comment; } @@ -18,26 +23,27 @@ function nestTag(comment, tagName, target) { var result = [], index = {}; - comment[target].forEach(function (tag) { - index[tag.name] = tag; - var parts = tag.name.split(/(\[\])?\./) - .filter(function (part) { - return part && part !== '[]'; - }); - if (parts.length > 1) { - var parent = index[parts.slice(0, -1).join('.')]; - if (parent === undefined) { - comment.errors.push({ - message: '@' + tagName + ' ' + tag.name + '\'s parent ' + parts[0] + ' not found', - commentLineNumber: tag.lineNumber - }); + comment[target].forEach(tag => { + var tagName = tag.name; + if (tagName) { + index[tagName] = tag; + var parts = tagName.split(/(\[\])?\./) + .filter(part => part && part !== '[]'); + if (parts.length > 1) { + var parent = index[parts.slice(0, -1).join('.')]; + if (parent === undefined) { + comment.errors.push({ + message: '@' + tagTitle + ' ' + tag.name + '\'s parent ' + parts[0] + ' not found', + commentLineNumber: tag.lineNumber + }); + result.push(tag); + return; + } + parent.properties = parent.properties || []; + parent.properties.push(tag); + } else { result.push(tag); - return; } - parent.properties = parent.properties || []; - parent.properties.push(tag); - } else { - result.push(tag); } }); @@ -58,7 +64,7 @@ function nestTag(comment, tagName, target) { * @param {Object} comment input comment * @return {Object} nested comment */ -function nest(comment) { +function nest(comment/*: Comment*/) { return nestTag(nestTag(comment, 'param', 'params'), 'property', 'properties'); } diff --git a/lib/output/highlighter.js b/lib/output/highlighter.js index 69caabfe4..234c8b0f3 100644 --- a/lib/output/highlighter.js +++ b/lib/output/highlighter.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var visit = require('unist-util-visit'); var hljs = require('highlight.js'); @@ -16,7 +18,7 @@ function visitor(node) { } } -module.exports = function (ast) { +module.exports = function (ast/*: Object*/) { visit(ast, 'code', visitor); return ast; }; diff --git a/lib/output/html.js b/lib/output/html.js index 249b632d3..88445cac6 100644 --- a/lib/output/html.js +++ b/lib/output/html.js @@ -1,15 +1,17 @@ + 'use strict'; +/* @flow */ var path = require('path'); +var mergeConfig = require('../merge_config'); /** * Formats documentation as HTML. * - * @param {Array} comments parsed comments - * @param {Object} options Options that can customize the output - * @param {string} [options.theme='default_theme'] Name of a module used for an HTML theme. - * @param {Function} callback Called with array of results as vinyl-fs objects. - * @returns {undefined} Calls callback. + * @param comments parsed comments + * @param {Object} args Options that can customize the output + * @param {string} [args.theme='default_theme'] Name of a module used for an HTML theme. + * @returns {Promise>} Promise with results * @name formats.html * @public * @example @@ -17,19 +19,21 @@ var path = require('path'); * var streamArray = require('stream-array'); * var vfs = require('vinyl-fs'); * - * documentation.build(['index.js'], {}, function (err, res) { - * documentation.formats.html(res, {}, function(err, output) { + * documentation.build(['index.js']) + * .then(documentation.formats.html) + * .then(output => { * streamArray(output).pipe(vfs.dest('./output-directory')); * }); - * }); */ -module.exports = function html(comments, options, callback) { - options = options || {}; - var theme; - if (options.theme) { - theme = require(path.resolve(process.cwd(), options.theme)); - } else { - theme = require('../../default_theme/'); - } - theme(comments, options, callback); -}; +function html(comments/*: Array*/, + config/*: DocumentationConfig*/) { + return mergeConfig(config).then(config => { + var themePath = '../../default_theme/'; + if (config.theme) { + themePath = path.resolve(process.cwd(), config.theme); + } + return require(themePath)(comments, config); + }); +} + +module.exports = html; diff --git a/lib/output/json.js b/lib/output/json.js index c9f10c293..b56d4a82c 100644 --- a/lib/output/json.js +++ b/lib/output/json.js @@ -1,35 +1,36 @@ + 'use strict'; +/* @flow */ var walk = require('../walk'); /** * Formats documentation as a JSON string. * - * @param {Array} comments parsed comments - * @param {Object} opts Options that can customize the output - * @param {Function} callback called with null, string + * @param comments parsed comments * @name formats.json - * @return {undefined} calls callback * @public * @example * var documentation = require('documentation'); * var fs = require('fs'); * - * documentation.build(['index.js'], {}, function (err, res) { - * documentation.formats.json(res, {}, function(err, output) { + * documentation.build(['index.js']) + * .then(documentation.formats.json) + * .then(output => { * // output is a string of JSON data * fs.writeFileSync('./output.json', output); * }); - * }); */ -module.exports = function (comments, opts, callback) { +function json(comments/*: Array*/)/*: Promise*/ { - walk(comments, function (comment) { + walk(comments, comment => { delete comment.errors; if (comment.context) { delete comment.context.sortKey; } }); - return callback(null, JSON.stringify(comments, null, 2)); -}; + return Promise.resolve(JSON.stringify(comments, null, 2)); +} + +module.exports = json; diff --git a/lib/output/markdown.js b/lib/output/markdown.js index b2b29bf10..e7b2d36d9 100644 --- a/lib/output/markdown.js +++ b/lib/output/markdown.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var remark = require('remark'), markdownAST = require('./markdown_ast'); @@ -8,24 +10,24 @@ var remark = require('remark'), * [Markdown](http://daringfireball.net/projects/markdown/). * * @param {Array} comments parsed comments - * @param {Object} options Options that can customize the output - * @param {Function} callback called with null, string + * @param {Object} args Options that can customize the output * @name formats.markdown - * @return {undefined} calls callback + * @return {Promise} a promise of the eventual value * @public * @example * var documentation = require('documentation'); * var fs = require('fs'); * - * documentation.build(['index.js'], {}, function (err, res) { - * documentation.formats.md(res, {}, function(err, output) { - * // output is a string of JSON data + * documentation.build(['index.js']) + * .then(documentation.formats.md) + * .then(output => { + * // output is a string of Markdown data * fs.writeFileSync('./output.md', output); * }); - * }); */ -module.exports = function (comments, options, callback) { - markdownAST(comments, options, function (err, ast) { - return callback(null, remark().stringify(ast)); - }); -}; +function markdown(comments/*: Array*/, args/*: Object*/)/*: Promise */ { + return markdownAST(comments, args) + .then(ast => remark().stringify(ast)); +} + +module.exports = markdown; diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index d55466749..1dd95acff 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -1,30 +1,44 @@ +/* @flow */ +'use strict'; + + var u = require('unist-builder'), remark = require('remark'), + mergeConfig = require('../merge_config'), toc = require('remark-toc'), hljs = require('highlight.js'), GithubSlugger = require('github-slugger'), - createLinkerStack = require('./util/linker_stack'), + LinkerStack = require('./util/linker_stack'), rerouteLinks = require('./util/reroute_links'), _formatType = require('./util/format_type'); +var DEFAULT_LANGUAGE = 'javascript'; + /** * Given a hierarchy-nested set of comments, generate an remark-compatible * Abstract Syntax Tree usable for generating Markdown output * - * @param {Array} comments nested comment - * @param {Object} options currently none accepted - * @param {Function} callback called with AST - * @returns {undefined} calls callback + * @param comments nested comment + * @param {Object} args currently none accepted + * @param {boolean} [args.markdownToc=true] whether to include a table of contents + * in markdown output. + * @param {Object} [args.hljs={}] config to be passed to highlightjs for code highlighting: + * consult hljs.configure for the full list. + * @returns {Promise} returns an eventual Markdown value */ -function markdownAST(comments, options, callback) { +function markdownAST(comments/*: Array */, args/*: Object */) { + return mergeConfig(args) + .then(config => buildMarkdownAST(comments, config)); +} + +function buildMarkdownAST(comments/*: Array */, config/*: DocumentationConfig*/) { // Configure code highlighting - var hljsOptions = (options || {}).hljs || {}, - language = !hljsOptions.highlightAuto ? 'javascript' : undefined; + var hljsOptions = config.hljs || {}; hljs.configure(hljsOptions); - var linkerStack = createLinkerStack(options) - .namespaceResolver(comments, function (namespace) { + var linkerStack = new LinkerStack(config) + .namespaceResolver(comments, namespace => { var slugger = new GithubSlugger(); return '#' + slugger.slug(namespace); }); @@ -47,9 +61,9 @@ function markdownAST(comments, options, callback) { * @param {Object} comment a single comment * @returns {Object} remark-compatible AST */ - function generate(depth, comment) { + function generate(depth/*: number */, comment/*: Comment */) { - function typeSection(comment) { + function typeSection(comment/*: Comment */) { return comment.type && u('paragraph', [ u('text', 'Type: ') ].concat( @@ -57,9 +71,9 @@ function markdownAST(comments, options, callback) { )); } - function paramList(params) { - return u('list', { ordered: false }, params.map(function (param) { - return u('listItem', [ + function paramList(params/*: Array */) { + return u('list', { ordered: false }, params.map(param => + u('listItem', [ u('paragraph', [ u('inlineCode', param.name), u('text', ' '), @@ -74,28 +88,27 @@ function markdownAST(comments, options, callback) { ]) ]).filter(Boolean)) ].concat(param.properties && paramList(param.properties)) - .filter(Boolean)); - })); + .filter(Boolean)))); } - function paramSection(comment) { - return !!comment.params && [ + function paramSection(comment/*: Comment */) { + return comment.params.length > 0 && [ u('strong', [u('text', 'Parameters')]), paramList(comment.params) ]; } - function propertySection(comment) { - return !!comment.properties && [ + function propertySection(comment/*: Comment */) { + return comment.properties.length > 0 && [ u('strong', [u('text', 'Properties')]), propertyList(comment.properties) ]; } - function propertyList(properties) { + function propertyList(properties/*: Array */) { return u('list', { ordered: false }, - properties.map(function (property) { - return u('listItem', [ + properties.map(property => + u('listItem', [ u('paragraph', [ u('inlineCode', property.name), u('text', ' '), @@ -105,88 +118,90 @@ function markdownAST(comments, options, callback) { .concat(property.description ? property.description.children: []) .filter(Boolean)), property.properties && propertyList(property.properties) - ].filter(Boolean)); - })); + ].filter(Boolean)))); } - function examplesSection(comment) { - return !!comment.examples && [u('strong', [u('text', 'Examples')])] + function examplesSection(comment/*: Comment */) { + return comment.examples.length > 0 && [u('strong', [u('text', 'Examples')])] .concat(comment.examples.reduce(function (memo, example) { - language = hljsOptions.highlightAuto ? - hljs.highlightAuto(example.description).language : 'javascript'; + var language = hljsOptions.highlightAuto ? + hljs.highlightAuto(example.description).language : DEFAULT_LANGUAGE; return memo.concat(example.caption ? [u('paragraph', [u('emphasis', example.caption)])] : []).concat([u('code', { lang: language }, example.description)]); }, [])); } - function returnsSection(comment) { - return !!comment.returns && comment.returns.map(function (returns) { - return u('paragraph', [ + function returnsSection(comment/*: Comment */) { + return comment.returns.length > 0 && comment.returns.map(returns => + u('paragraph', [ u('text', 'Returns '), u('strong', formatType(returns.type)), u('text', ' ') - ].concat(returns.description ? returns.description.children : [])); - }); + ].concat(returns.description ? returns.description.children : []))); } - function throwsSection(comment) { - return !!comment.throws && + function throwsSection(comment/*: Comment */) { + return comment.throws.length > 0 && u('list', { ordered: false }, - comment.throws.map(function (returns) { - return u('listItem', [ + comment.throws.map(returns => u('listItem', [ u('paragraph', [ u('text', 'Throws '), u('strong', formatType(returns.type)), u('text', ' ') ].concat(returns.description ? returns.description.children : [])) - ]); - })); + ]))); } - function augmentsLink(comment) { - return comment.augments && u('paragraph', [ + function augmentsLink(comment/*: Comment */) { + return comment.augments.length > 0 && u('paragraph', [ u('strong', [ u('text', 'Extends '), - u('text', comment.augments.map(function (tag) { - return tag.name; - }).join(', ')) + u('text', comment.augments.map(tag => tag.name).join(', ')) ]) ]); } - function githubLink(comment) { + function githubLink(comment/*: Comment */) { return comment.context && comment.context.github && u('paragraph', [ u('link', { title: 'Source code on GitHub', - url: comment.context.github - }, [u('text', comment.context.path + ':' + + url: comment.context.github.url + }, [u('text', comment.context.github.path + ':' + comment.context.loc.start.line + '-' + comment.context.loc.end.line)]) ]); } - function metaSection(comment) { - var meta = ['version', 'since', 'copyright', 'author', 'license'] - .reduce(function (memo, tag) { - if (comment[tag]) { - memo.push({ tag: tag, value: comment[tag] }); - } - return memo; - }, []); + function metaSection(comment/*: Comment */) { + let meta = ['version', 'since', 'copyright', 'author', 'license'] + .filter(tag => comment[tag]); return !!meta.length && [u('strong', [u('text', 'Meta')])].concat( u('list', { ordered: false }, - meta.map(function (item) { + meta + .map(tag => { + let metaContent; + if (tag === 'copyright') { + metaContent = comment[tag]; + } else { + metaContent = u('text', comment[tag]); + } return u('listItem', [ u('paragraph', [ - u('strong', [u('text', item.tag)]), - u('text', ': ' + item.value) + u('strong', [u('text', tag)]), + u('text', ': '), + metaContent ]) ]); }))); } - return [u('heading', { depth: depth }, [u('text', comment.name || '')])] + if (comment.kind === 'note') { + return [u('heading', { depth }, [u('text', comment.name || '')])] + .concat(comment.description); + } + + return [u('heading', { depth }, [u('text', comment.name || '')])] .concat(githubLink(comment)) .concat(augmentsLink(comment)) .concat(comment.description ? comment.description.children : []) @@ -198,30 +213,25 @@ function markdownAST(comments, options, callback) { .concat(returnsSection(comment)) .concat(metaSection(comment)) .concat(!!comment.members.instance.length && - comment.members.instance.reduce(function (memo, child) { - return memo.concat(generate(depth + 1, child)); - }, [])) + comment.members.instance.reduce((memo, child) => + memo.concat(generate(depth + 1, child)), [])) .concat(!!comment.members.static.length && - comment.members.static.reduce(function (memo, child) { - return memo.concat(generate(depth + 1, child)); - }, [])) + comment.members.static.reduce((memo, child) => + memo.concat(generate(depth + 1, child)), [])) .filter(Boolean); } var root = rerouteLinks(linkerStack.link, u('root', generatorComment - .concat(options.markdownToc ? tableOfContentsHeading : []) - .concat(comments.reduce(function (memo, comment) { - return memo.concat(generate(2, comment)); - }, [])))); - - if (!options['no-markdown-toc']) { - return remark().use(toc, { - tight: true - }).run(root, callback); + .concat(config.markdownToc ? tableOfContentsHeading : []) + .concat(comments.reduce((memo, comment) => + memo.concat(generate(2, comment)), [])))); + + if (config.markdownToc) { + root = remark().use(toc, { tight: true }).run(root); } - return callback(null, root); + return Promise.resolve(root); } module.exports = markdownAST; diff --git a/lib/output/util/format_type.js b/lib/output/util/format_type.js index ff7b47302..19ed6913d 100644 --- a/lib/output/util/format_type.js +++ b/lib/output/util/format_type.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var Syntax = require('doctrine').Syntax, u = require('unist-builder'); @@ -31,7 +33,7 @@ function link(text, getHref, description) { // and then we should remove the 'href' property and only // have the url property of links return u('link', { - href: href, + href, url: href }, [t(description || text)]); } @@ -95,7 +97,7 @@ function decorate(formatted, str, prefix) { * formatType({ type: 'NameExpression', name: 'String' })[0].url * // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' */ -function formatType(getHref, node) { +function formatType(getHref/*: Function*/, node/*: ?Object */) { var result = []; if (!node) { diff --git a/lib/output/util/formatters.js b/lib/output/util/formatters.js index d2cb1b036..7d02c5b5a 100644 --- a/lib/output/util/formatters.js +++ b/lib/output/util/formatters.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var remark = require('remark'), html = require('remark-html'), Syntax = require('doctrine').Syntax, @@ -10,10 +12,10 @@ var remark = require('remark'), * Create a formatter group, given a linker method that resolves * namespaces to URLs * - * @param {Function} getHref linker method + * @param getHref linker method * @returns {formatters} formatter object */ -module.exports = function (getHref) { +module.exports = function (getHref/*: Function*/) { var rerouteLinks = _rerouteLinks.bind(undefined, getHref); var formatters = {}; @@ -27,7 +29,7 @@ module.exports = function (getHref) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameter representation. */ - formatters.parameter = function (param, short) { + formatters.parameter = function (param/*: Object*/, short/*: boolean */)/*: string */ { if (short) { if (param.type && param.type.type == Syntax.OptionalType) { if (param.default) { @@ -51,6 +53,7 @@ module.exports = function (getHref) { .use(html) .stringify(highlighter(rerouteLinks(ast))); } + return ''; }; /** @@ -59,7 +62,7 @@ module.exports = function (getHref) { * @param {Object} type doctrine-format type * @returns {string} HTML */ - formatters.type = function (type) { + formatters.type = function (type/*: Object*/) { return formatters.markdown(u('root', formatType(getHref, type))).replace(/\n/g, ''); }; @@ -69,14 +72,14 @@ module.exports = function (getHref) { * @param {string} description link text override * @returns {string} potentially linked HTML */ - formatters.autolink = function (text) { + formatters.autolink = function (text/*: string*/) { var href = getHref(text); if (href) { // TODO: this is a temporary fix until we drop remark 3.x support, // and then we should remove the 'href' property and only // have the url property of links return formatters.markdown(u('link', { - href: href, + href, url: href }, [u('text', text)])).replace(/\n/g, ''); } @@ -92,7 +95,7 @@ module.exports = function (getHref) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameters */ - formatters.parameters = function (section, short) { + formatters.parameters = function (section/*: Comment*/, short/*: boolean */) { if (section.params) { return '(' + section.params.map(function (param) { return formatters.parameter(param, short); diff --git a/lib/output/util/linker_stack.js b/lib/output/util/linker_stack.js index 4eb16728f..0888ecebf 100644 --- a/lib/output/util/linker_stack.js +++ b/lib/output/util/linker_stack.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var globalsDocs = require('globals-docs'); var walk = require('../../walk'); @@ -7,7 +9,7 @@ var walk = require('../../walk'); * @param {Object} paths an object specified in documentation.yml of hard paths * @returns {Function} linker */ -function pathsLinker(paths) { +function pathsLinker(paths/* Object */) { return function (namespace) { if (paths[namespace]) { return paths[namespace]; @@ -23,7 +25,7 @@ function pathsLinker(paths) { * @param {*} input any input * @returns {*} any output */ -function firstPass(fns, input) { +function firstPass(fns/*: Array */, input) { for (var i = 0; i < fns.length; i++) { var output = fns[i](input); if (output) { @@ -39,73 +41,76 @@ function firstPass(fns, input) { * @param {Object} config - configuration value * @returns {Function} linker method */ -function LinkerStack(config) { - config = config || {}; - this.stack = []; +class LinkerStack { - if (config.defaultGlobals !== false) { - this.stack.unshift(function (namespace) { - if (namespace) { - return globalsDocs.getDoc(namespace, config.defaultGlobalsEnvs); + /* :: stack: Array */ + /* :: link: Function */ + + constructor(config/*: DocumentationConfig */) { + this.stack = []; + + if (config.defaultGlobals !== false) { + this.stack.unshift(namespace => { + if (namespace) { + return globalsDocs.getDoc(namespace, config.defaultGlobalsEnvs); + } + }); + } + + if (config.paths) { + this.stack.unshift(pathsLinker(config.paths)); + } + + this.link = this._link.bind(this); + } + + /** + * Given that the linker stack is a stack of functions, each of which might + * be able to resolve the URL target of a given namespace, namespaceResolver + * adds a function to the stack. You give it a list of comments and it + * adds a function that, if it matches a namespace to a comment, runs + * `resolver` on that comment's namespace in order to get a URL. This makes + * it possible for themes to put each function on a separate page, or at + * different anchors on the same page, and the resolver does stuff like + * adding '#' in front of the namespace or turning the namespace into a URL + * path. + * + * @param {Array} comments a list of comments + * @param {Function} resolver a method that turns a namespace into a URL + * @returns {LinkerStack} returns this + * @private + * @example + * var linkerStack = new LinkerStack(options) + * .namespaceResolver(comments, function (namespace) { + * var slugger = new GithubSlugger(); + * return '#' + slugger.slug(namespace); + * }); + */ + namespaceResolver(comments /*: Array */, resolver/*: Function */) { + var namespaces = {}; + walk(comments, comment => { + namespaces[comment.namespace] = true; + }); + this.stack.unshift(namespace => { + if (namespaces[namespace] === true) { + return resolver(namespace); } }); + return this; } - if (config.paths) { - this.stack.unshift(pathsLinker(config.paths)); + /** + * Now that you've configured the LinkerStack with `namespaceResolver` + * and a configuration, run it against a namepath. Might return a URL if + * it can resolve a target, otherwise returns undefined. + * + * @param {string} namepath the namepath of a comment + * @returns {string?} URL target or maybe undefined + * @private + */ + _link(namepath/*: string */) { + return firstPass(this.stack, namepath); } - - this.link = this.link.bind(this); } -/** - * Given that the linker stack is a stack of functions, each of which might - * be able to resolve the URL target of a given namespace, namespaceResolver - * adds a function to the stack. You give it a list of comments and it - * adds a function that, if it matches a namespace to a comment, runs - * `resolver` on that comment's namespace in order to get a URL. This makes - * it possible for themes to put each function on a separate page, or at - * different anchors on the same page, and the resolver does stuff like - * adding '#' in front of the namespace or turning the namespace into a URL - * path. - * - * @param {Array} comments a list of comments - * @param {Function} resolver a method that turns a namespace into a URL - * @returns {LinkerStack} returns this - * @private - * @example - * var linkerStack = createLinkerStack(options) - * .namespaceResolver(comments, function (namespace) { - * var slugger = new GithubSlugger(); - * return '#' + slugger.slug(namespace); - * }); - */ -LinkerStack.prototype.namespaceResolver = function (comments, resolver) { - var namespaces = {}; - walk(comments, function (comment) { - namespaces[comment.namespace] = true; - }); - this.stack.unshift(function (namespace) { - if (namespaces[namespace] === true) { - return resolver(namespace); - } - }); - return this; -}; - -/** - * Now that you've configured the LinkerStack with `namespaceResolver` - * and a configuration, run it against a namepath. Might return a URL if - * it can resolve a target, otherwise returns undefined. - * - * @param {string} namepath the namepath of a comment - * @returns {string?} URL target or maybe undefined - * @private - */ -LinkerStack.prototype.link = function (namepath) { - return firstPass(this.stack, namepath); -}; - -module.exports = function (opts) { - return new LinkerStack(opts); -}; +module.exports = LinkerStack; diff --git a/lib/output/util/reroute_links.js b/lib/output/util/reroute_links.js index 7fc828fce..ebc2a5209 100644 --- a/lib/output/util/reroute_links.js +++ b/lib/output/util/reroute_links.js @@ -1,13 +1,15 @@ +/* @flow */ +'use strict'; var visit = require('unist-util-visit'); /** * Reroute inline jsdoc links in documentation - * @param {Function} getHref a method that resolves namespaces - * @param {Object} ast remark AST + * @param getHref a method that resolves namespaces + * @param ast remark AST * @returns {Object} that ast with rerouted links * @private */ -module.exports = function rerouteLinks(getHref, ast) { +module.exports = function rerouteLinks(getHref/*: Function */, ast/*: Object*/) { visit(ast, 'link', function (node) { if (node.jsdoc && !node.url.match(/^(http|https|\.)/) && getHref(node.url)) { node.url = getHref(node.url); diff --git a/lib/parse.js b/lib/parse.js index f74306630..2a547cb65 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var doctrine = require('doctrine'); var parseMarkdown = require('./parse_markdown'); @@ -32,9 +34,6 @@ var flatteners = { * @returns {undefined} has side-effects */ 'augments': function (result, tag) { - if (!result.augments) { - result.augments = []; - } // Google variation of augments/extends tag: // uses type with brackets instead of name. // https://github.com/google/closure-library/issues/746 @@ -112,11 +111,7 @@ var flatteners = { return; } - if (!result.examples) { - result.examples = []; - } - - var example = { + var example/*: CommentExample */ = { description: tag.description }; @@ -236,11 +231,8 @@ var flatteners = { * @returns {undefined} has side-effects */ 'param': function (result, tag) { - if (!result.params) { - result.params = []; - } - - var param = { + var param/*: CommentTag */ = { + title: 'param', name: tag.name, lineNumber: tag.lineNumber // TODO: remove }; @@ -277,11 +269,8 @@ var flatteners = { * @returns {undefined} has side-effects */ 'property': function (result, tag) { - if (!result.properties) { - result.properties = []; - } - - var property = { + var property/*: CommentTag */ = { + title: 'property', name: tag.name, lineNumber: tag.lineNumber // TODO: remove }; @@ -325,12 +314,9 @@ var flatteners = { * @returns {undefined} has side-effects */ 'returns': function (result, tag) { - if (!result.returns) { - result.returns = []; - } - - var returns = { - description: parseMarkdown(tag.description) + var returns/*: CommentTag */ = { + description: parseMarkdown(tag.description), + title: 'returns' }; if (tag.type) { @@ -347,9 +333,6 @@ var flatteners = { * @returns {undefined} has side-effects */ 'see': function (result, tag) { - if (!result.sees) { - result.sees = []; - } result.sees.push(parseMarkdown(tag.description)); }, 'since': flattenDescription, @@ -372,10 +355,6 @@ var flatteners = { * @returns {undefined} has side-effects */ 'throws': function (result, tag) { - if (!result.throws) { - result.throws = []; - } - var throws = {}; if (tag.description) { @@ -396,9 +375,6 @@ var flatteners = { * @returns {undefined} has side-effects */ 'todo': function (result, tag) { - if (!result.todos) { - result.todos = []; - } result.todos.push(parseMarkdown(tag.description)); }, 'tutorial': todo, @@ -584,7 +560,9 @@ function flattenKindShorthand(result, tag, key) { * @return {Comment} an object conforming to the * [documentation schema](https://github.com/documentationjs/api-json) */ -function parseJSDoc(comment, loc, context) { +function parseJSDoc(comment/*: string*/, + loc/*: ?Object*/, + context/*: ?Object*/)/*: Comment */ { var result = doctrine.parse(comment, { // have doctrine itself remove the comment asterisks from content unwrap: true, @@ -598,7 +576,16 @@ function parseJSDoc(comment, loc, context) { result.loc = loc; result.context = context; + + result.augments = []; result.errors = []; + result.examples = []; + result.params = []; + result.properties = []; + result.returns = []; + result.sees = []; + result.throws = []; + result.todos = []; if (result.description) { result.description = parseMarkdown(result.description); diff --git a/lib/parse_markdown.js b/lib/parse_markdown.js index 6814b52c5..4b12060d9 100644 --- a/lib/parse_markdown.js +++ b/lib/parse_markdown.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var remark = require('remark'); var inlineTokenizer = require('./inline_tokenizer'); @@ -9,7 +11,7 @@ var inlineTokenizer = require('./inline_tokenizer'); * @returns {Object} abstract syntax tree * @private */ -function parseMarkdown(string) { +function parseMarkdown(string/*: string */) { return remark().use(inlineTokenizer).parse(string); } diff --git a/lib/parsers/javascript.js b/lib/parsers/javascript.js index 9fada0ed1..cd9ff2edc 100644 --- a/lib/parsers/javascript.js +++ b/lib/parsers/javascript.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var _ = require('lodash'), parse = require('../../lib/parse'), @@ -27,35 +29,39 @@ function leftPad(str, width) { * reads the file, parses the JavaScript, and parses the JSDoc. * * @param {Object} data a chunk of data provided by module-deps - * @param {Object} options options + * @param {Object} config config * @return {Array} an array of parsed comments */ -function parseJavaScript(data, options) { - options = options || {}; - var visited = Object.create(null); +function parseJavaScript(data/*: Object*/, + config/*: DocumentationConfig */) { + var visited = new Set(); var ast = parseToAst(data.source, data.file); var addComment = _addComment.bind(null, visited); - return _.flatMap(options.documentExported ? [ + return _.flatMap(config.documentExported ? [ walkExported ] : [ walkComments.bind(null, 'leadingComments', true), walkComments.bind(null, 'innerComments', false), walkComments.bind(null, 'trailingComments', false) - ], function (fn) { - return fn(ast, data, addComment); - }).filter(Boolean); + ], fn => fn(ast, data, addComment)).filter(Boolean); } function _addComment(visited, data, commentValue, commentLoc, path, nodeLoc, includeContext) { // Avoid visiting the same comment twice as a leading // and trailing node var key = data.file + ':' + commentLoc.start.line + ':' + commentLoc.start.column; - if (!visited[key]) { - visited[key] = true; + if (!visited.has(key)) { + visited.add(key); - var context = { + var context/* : { + loc: Object, + file: string, + sortKey: string, + ast?: Object, + code?: string + }*/ = { loc: nodeLoc, file: data.file, sortKey: data.sortKey + ' ' + leftPad(nodeLoc.start.line, 8) @@ -65,6 +71,7 @@ function _addComment(visited, data, commentValue, commentLoc, path, nodeLoc, inc // This is non-enumerable so that it doesn't get stringified in // output; e.g. by the documentation binary. Object.defineProperty(context, 'ast', { + configurable: true, enumerable: false, value: path }); diff --git a/lib/parsers/parse_to_ast.js b/lib/parsers/parse_to_ast.js index 22700d5f0..4b539d214 100644 --- a/lib/parsers/parse_to_ast.js +++ b/lib/parsers/parse_to_ast.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var babylon = require('babylon'); @@ -23,7 +25,7 @@ var opts = { ] }; -function parseToAst(source) { +function parseToAst(source/*: string*/) { return babylon.parse(source, opts); } diff --git a/lib/parsers/polyglot.js b/lib/parsers/polyglot.js index 3cfee500c..d521c3082 100644 --- a/lib/parsers/polyglot.js +++ b/lib/parsers/polyglot.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var getComments = require('get-comments'), extend = require('extend'), @@ -12,14 +14,14 @@ var getComments = require('get-comments'), * @param {Object} data a chunk of data provided by module-deps * @return {Array} adds to memo */ -function parsePolyglot(data) { - return getComments(data.source, true) +function parsePolyglot(sourceFile/*: SourceFile*/) { + return getComments(sourceFile.source, true) .filter(isJSDocComment) - .map(function (comment) { + .map(comment => { var context = { loc: extend({}, comment.loc), - file: data.file, - sortKey: data.file + ' ' + comment.loc.start.line + file: sourceFile.file, + sortKey: sourceFile.file + ' ' + comment.loc.start.line }; return parse(comment.value, comment.loc, context); }); diff --git a/lib/serve/error_page.js b/lib/serve/error_page.js index c131e300a..03c414c77 100644 --- a/lib/serve/error_page.js +++ b/lib/serve/error_page.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var File = require('vinyl'); var ansiHTML = require('ansi-html'); @@ -20,10 +22,10 @@ ansiHTML.setColors({ /** * Given an error, generate an HTML page that represents the error. - * @param {Error} error parse or generation error + * @param error parse or generation error * @returns {Object} vinyl file object */ -function errorPage(error) { +function errorPage(error/*: Error*/) { var errorText = error.toString(); if (error.codeFrame) { errorText += '
' + ansiHTML(error.codeFrame) + '
'; diff --git a/lib/serve/server.js b/lib/serve/server.js index 7440239a3..921b26387 100644 --- a/lib/serve/server.js +++ b/lib/serve/server.js @@ -1,10 +1,19 @@ +/* @flow */ +'use strict'; var http = require('http'), mime = require('mime'), - util = require('util'), + pify = require('pify'), EventEmitter = require('events').EventEmitter, liveReload = require('tiny-lr'), sep = require('path').sep; +/* :: +declare type ServerFile = { + relative: string, + contents: string +}; +*/ + /** * A static file server designed to support documentation.js's --serve * option. It serves from an array of Vinyl File objects (virtual files in @@ -12,119 +21,114 @@ var http = require('http'), * of files and notifies any browsers using LiveReload to reload * and display the new content. * @class - * @param {number} port server port to serve on. + * @param port server port to serve on. */ -function Server(port) { - if (typeof port !== 'number') { - throw new Error('port argument required to initialize a server'); - } - this._port = port; - this._files = []; -} +class Server extends EventEmitter { -util.inherits(Server, EventEmitter); - -/** - * Update the set of files exposed by this server and notify LiveReload - * clients - * - * @param {Array} files new content. replaces any previously-set content. - * @returns {Server} self - */ -Server.prototype.setFiles = function (files) { - this._files = files; - if (this._lr) { - this._lr.changed({ body: { files: '*' } }); - } - return this; -}; + /* :: _lr: Object; */ + /* :: _port: number; */ + /* :: _files: Array; */ + /* :: _http: http.Server; */ -/** - * Internal handler for server requests. The server serves - * very few types of things: html, images, and so on, and it - * only handles GET requests. - * - * @param {http.Request} request content wanted - * @param {http.Response} response content returned - * @returns {undefined} nothing - * @private - */ -Server.prototype.handler = function (request, response) { - var path = request.url.substring(1); - if (path === '') { - path = 'index.html'; + constructor(port/*: number*/) { + super(); + if (typeof port !== 'number') { + throw new Error('port argument required to initialize a server'); + } + this._port = port; + this._files = []; } - for (var i = 0; i < this._files.length; i++) { - var file = this._files[i]; - var filePath = file.relative.split(sep).join('/'); - if (filePath === path) { - response.writeHead(200, { 'Content-Type': mime.lookup(path) }); - response.end(file.contents); - return; + /** + * Update the set of files exposed by this server and notify LiveReload + * clients + * + * @param files new content. replaces any previously-set content. + * @returns {Server} self + */ + setFiles(files/*: Array */) { + this._files = files; + if (this._lr) { + this._lr.changed({ body: { files: '*' } }); } + return this; } - response.writeHead(404, { 'Content-Type': 'text/plain' }); - response.end('Not found'); -}; - -/** - * Boot up the server's HTTP & LiveReload endpoints. This method - * can be called multiple times. - * - * @param {Function} [callback=] called when server is started - * @returns {undefined} - */ -Server.prototype.start = function (callback) { - callback = callback || noop; + /** + * Internal handler for server requests. The server serves + * very few types of things: html, images, and so on, and it + * only handles GET requests. + * + * @param {http.Request} request content wanted + * @param {http.Response} response content returned + * @returns {undefined} nothing + * @private + */ + handler(request/*: http.IncomingMessage */, response/*: http.ServerResponse */) { + var path = request.url.substring(1); + if (path === '') { + path = 'index.html'; + } - // idempotent - if (this._lr) { - return callback(); + for (var i = 0; i < this._files.length; i++) { + var file = this._files[i]; + var filePath = file.relative.split(sep).join('/'); + if (filePath === path) { + response.writeHead(200, { 'Content-Type': mime.lookup(path) }); + response.end(file.contents); + return; + } + } + response.writeHead(404, { 'Content-Type': 'text/plain' }); + response.end('Not found'); } - this._lr = liveReload(); - this._http = http.createServer(this.handler.bind(this)); - - this._lr.listen(35729, function () { - this._http.listen(this._port, function () { - this.emit('listening'); - callback(); - }.bind(this)); - }.bind(this)); -}; - -/** - * Shut down the server's HTTP & LiveReload endpoints. This method - * can be called multiple times. - * - * @param {Function} [callback=] called when server is closed - * @returns {undefined} - */ -Server.prototype.stop = function (callback) { - - callback = callback || noop; - - // idempotent - if (!this._lr) { - return callback(); + /** + * Boot up the server's HTTP & LiveReload endpoints. This method + * can be called multiple times. + * + * @returns {Promise} resolved when server starts + */ + start()/*: Promise */ { + return new Promise(resolve => { + // idempotent + if (this._lr) { + return resolve(true); + } + + this._lr = liveReload(); + this._http = http.createServer(this.handler.bind(this)); + + return Promise.all([ + pify(this._lr.listen.bind(this._lr))(35729), + pify(this._http.listen.bind(this._http))(this._port) + ]).then(() => { + this.emit('listening'); + return resolve(true); + }); + }); } - this._http.close(function () { - this._lr.close(); - this._http = null; - this._lr = null; - callback(); - }.bind(this)); -}; - -/** - * A placeholder method that will be called instead of `callback` if - * callback is omitted for the server control methods - * @private - * @returns {undefined} doesn't return anything - */ -function noop() {} + /** + * Shut down the server's HTTP & LiveReload endpoints. This method + * can be called multiple times. + */ + stop()/*: Promise */ { + + return new Promise(resolve => { + // idempotent + if (!this._lr) { + return resolve(true); + } + + this._http.close(() => { + this._lr.close(); + delete this._http; + delete this._lr; + resolve(true); + }); + }); + } +} module.exports = Server; diff --git a/lib/smart_glob.js b/lib/smart_glob.js index 72f81277f..c149f11ed 100644 --- a/lib/smart_glob.js +++ b/lib/smart_glob.js @@ -1,3 +1,5 @@ +/* @flow */ +'use strict'; var fs = require('fs'); var path = require('path'); var glob = require('glob'); @@ -81,12 +83,12 @@ function resolveFileGlobPatterns(patterns, extensions) { * Build a list of absolute filesnames on which ESLint will act. * Ignored files are excluded from the results, as are duplicates. * - * @param {string[]} globPatterns Glob patterns. - * @returns {string[]} Resolved absolute filenames. + * @param globPatterns Glob patterns. + * @returns Resolved absolute filenames. */ -function listFilesToProcess(globPatterns) { +function listFilesToProcess(globPatterns/*: Array*/)/*: Array */ { var files = [], - added = Object.create(null); + added = new Set(); var cwd = process.cwd(); @@ -97,11 +99,11 @@ function listFilesToProcess(globPatterns) { * @returns {void} */ function addFile(filename) { - if (added[filename]) { + if (added.has(filename)) { return; } files.push(filename); - added[filename] = true; + added.add(filename); } globPatterns.forEach(function (pattern) { @@ -124,7 +126,8 @@ function listFilesToProcess(globPatterns) { return files; } -function smartGlob(indexes, extensions) { +function smartGlob(indexes/*: Array*/, + extensions/*: Array*/) { return listFilesToProcess( resolveFileGlobPatterns(indexes, extensions) ); diff --git a/lib/sort.js b/lib/sort.js index cac44ffb4..32d536b68 100644 --- a/lib/sort.js +++ b/lib/sort.js @@ -1,4 +1,6 @@ + 'use strict'; +/* @flow */ var parseMarkdown = require('./parse_markdown'); var chalk = require('chalk'); @@ -14,7 +16,7 @@ var fs = require('fs'); * @return {number} sorting value * @private */ -module.exports = function sortDocs(comments, options) { +module.exports = function sortDocs(comments/*: Array*/, options/*: Object*/) { if (!options || !options.toc) { return sortComments(comments, options && options.sortOrder); } @@ -35,27 +37,27 @@ module.exports = function sortDocs(comments, options) { }, Object.create(null)); // Table of contents 'theme' entries: defined as objects // in the YAML list - var fixed = options.toc.filter(function (val) { - return typeof val === 'object' && val.name; - }).map(function (val) { - if (typeof val.file === 'string') { - var filename = val.file; - if (!path.isAbsolute(val.file)) { - filename = path.join(process.cwd(), val.file); - } + var fixed = options.toc + .filter(val => typeof val === 'object' && val.name) + .map(function (val) { + if (typeof val.file === 'string') { + var filename = val.file; + if (!path.isAbsolute(val.file)) { + filename = path.join(process.cwd(), val.file); + } - try { - val.description = fs.readFileSync(filename).toString(); - delete val.file; - } catch (err) { - process.stderr.write(chalk.red('Failed to read file ' + filename)); + try { + val.description = fs.readFileSync(filename).toString(); + delete val.file; + } catch (err) { + process.stderr.write(chalk.red(`Failed to read file ${filename}`)); + } } - } - if (typeof val.description === 'string') { - val.description = parseMarkdown(val.description); - } - return val; - }); + if (typeof val.description === 'string') { + val.description = parseMarkdown(val.description); + } + return val; + }); var unfixed = []; comments .forEach(function (comment) { @@ -75,38 +77,33 @@ module.exports = function sortDocs(comments, options) { unfixed.push(comment); } }); - fixed.sort(function (a, b) { + fixed.sort((a, b) => { if (indexes[a.name] !== undefined && indexes[b.name] !== undefined) { return indexes[a.name] - indexes[b.name]; } }); sortComments(unfixed, options.sortOrder); - Object.keys(toBeSorted).filter(function (key) { - return toBeSorted[key] === false; - }).forEach(function (key) { - process.stderr.write(chalk.red('Table of contents defined sorting of ' + key + - ' but no documentation with that namepath was found\n')); - }); + Object.keys(toBeSorted) + .filter(key => toBeSorted[key] === false) + .forEach(key => { + process.stderr.write(chalk.red('Table of contents defined sorting of ' + key + + ' but no documentation with that namepath was found\n')); + }); return fixed.concat(unfixed); }; -function compare(a, b) { +function compare(a/*: string */, b/*: string */) { return a.localeCompare(b, undefined, {caseFirst: 'upper'}); } function compareCommentsByName(a, b) { - var rv; - if (a.memberof) { - if (b.memberof) { - rv = compare(a.memberof, b.memberof); - } else { - rv = compare(a.memberof, b.name); - } - } else if (b.memberof) { - rv = compare(a.name, b.memberof); - } + var akey = a.memberof || a.name; + var bkey = b.memberof || b.name; - return rv || compare(a.name, b.name); + if (akey && bkey) { + return compare(akey, bkey); + } + return 0; } function compareCommentsBySourceLocation(a, b) { diff --git a/lib/walk.js b/lib/walk.js index dc9069b59..119ac84d8 100644 --- a/lib/walk.js +++ b/lib/walk.js @@ -1,3 +1,6 @@ +/* @flow */ +'use strict'; + /** * Apply a function to all comments within a hierarchy: this iterates * through children in the 'members' property. @@ -7,8 +10,8 @@ * @param {Object} [options] options passed through to walker function * @returns {Array} comments */ -function walk(comments, fn, options) { - comments.forEach(function (comment) { +function walk(comments/*: Array*/, fn/*: Function*/, options/*: ?Object*/) { + comments.forEach(comment => { fn(comment, options); for (var scope in comment.members) { walk(comment.members[scope], fn, options); diff --git a/package.json b/package.json index 7cbbc77d3..2caf3781c 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "get-comments": "^1.0.1", "git-url-parse": "^6.0.1", "github-slugger": "1.1.1", - "globals-docs": "^2.3.0", "glob": "^7.0.0", + "globals-docs": "^2.3.0", "highlight.js": "^9.1.0", "js-yaml": "^3.3.1", "lodash": "^4.11.1", @@ -39,6 +39,8 @@ "mime": "^1.3.4", "module-deps-sortable": "4.0.6", "parse-filepath": "^0.6.3", + "pify": "^2.3.0", + "read-pkg-up": "^2.0.0", "remark": "^6.0.1", "remark-html": "5.0.1", "remark-toc": "^3.0.0", @@ -58,14 +60,18 @@ "yargs": "^6.0.0" }, "devDependencies": { + "are-we-flow-yet": "^1.0.0", + "babel-eslint": "^7.1.1", "chdir": "0.0.0", - "standard-changelog": "0.0.1", "cz-conventional-changelog": "1.2.0", "documentation-schema": "0.0.1", "eslint": "^3.12.2", + "eslint-plugin-flowtype": "^2.29.2", + "flow-bin": "^0.37.4", "fs-extra": "^1.0.0", "json-schema": "0.2.3", "mock-fs": "^3.5.0", + "standard-changelog": "0.0.1", "tap": "^8.0.0", "tmp": "^0.0.29" }, @@ -88,11 +94,15 @@ "doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint", - "test": "npm run lint && npm run self-lint && tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams" + "test": "are-we-flow-yet lib && flow check && npm run lint && npm run self-lint && npm run test-tap", + "test-tap": "tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams" }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } + }, + "engines": { + "node": ">=4" } } diff --git a/test/bin-readme.js b/test/bin-readme.js index e930df13c..381258d6b 100644 --- a/test/bin-readme.js +++ b/test/bin-readme.js @@ -1,3 +1,4 @@ +'use strict'; var test = require('tap').test, path = require('path'), os = require('os'), @@ -91,6 +92,16 @@ test('readme command', function (group) { }); }); + group.test('-s: not found', function (t) { + t.error(err); + fs.copySync(path.join(fixtures, 'README.output.md'), path.join(d, 'uptodate.md')); + documentation(['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], + {cwd: d}, function (err, stdout, stderr) { + t.ok(err); + t.end(); + }); + }); + group.test('requires -s option', function (t) { documentation(['readme index.js'], {cwd: d}, function (err, stdout, stderr) { t.ok(err); diff --git a/test/bin.js b/test/bin.js index c63a73cd5..533b98ba4 100644 --- a/test/bin.js +++ b/test/bin.js @@ -122,6 +122,14 @@ test('accepts config file - reports failures', options, function (t) { }, false); }); +test('accepts config file - reports parse failures', options, function (t) { + documentation(['build fixture/sorting/input.js -c fixture/config-malformed.json'], {}, + function (err, data, stderr) { + t.match(stderr, /SyntaxError/g, 'Reports a SyntaxError with bad config'); + t.end(); + }, false); +}); + test('--shallow option', function (t) { documentation(['build --shallow fixture/internal.input.js'], function (err, data) { t.error(err); @@ -258,6 +266,15 @@ test('lint command', function (group) { }, false); }); + group.test('lint with no inputs', options, function (t) { + documentation(['lint'], { + cwd: path.join(__dirname, 'fixture/bad') + }, function (err, data) { + t.ok(err.code > 0, 'exits with a > 0 exit code'); + t.end(); + }, false); + }); + group.end(); }); diff --git a/test/fixture/_external-deps-included.json b/test/fixture/_external-deps-included.json index 15b2c155d..7968ca9cf 100644 --- a/test/fixture/_external-deps-included.json +++ b/test/fixture/_external-deps-included.json @@ -109,7 +109,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { @@ -211,7 +219,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -266,12 +278,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "main", "kind": "function", "members": { @@ -373,7 +389,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -428,12 +448,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "index", "kind": "function", "members": { diff --git a/test/fixture/_multi-file-input.json b/test/fixture/_multi-file-input.json index dd227b807..d3a6bf704 100644 --- a/test/fixture/_multi-file-input.json +++ b/test/fixture/_multi-file-input.json @@ -100,9 +100,16 @@ } } }, + "augments": [], "errors": [], + "examples": [ + { + "description": "var result = returnTwo(4);\n// result is 6" + } + ], "params": [ { + "title": "param", "name": "a", "lineNumber": 3, "description": { @@ -163,6 +170,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -217,17 +225,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], - "examples": [ - { - "description": "var result = returnTwo(4);\n// result is 6" - } - ], + "sees": [], + "throws": [], + "todos": [], "name": "returnTwo", "kind": "function", "members": { @@ -329,7 +336,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -384,12 +395,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple.input", "kind": "function", "members": { diff --git a/test/fixture/boolean-literal-type.output.json b/test/fixture/boolean-literal-type.output.json index 51d31929a..69345a958 100644 --- a/test/fixture/boolean-literal-type.output.json +++ b/test/fixture/boolean-literal-type.output.json @@ -24,9 +24,9 @@ } } }, + "augments": [], "errors": [], - "name": "f", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -47,8 +47,10 @@ } } ], + "properties": [], "returns": [ { + "title": "returns", "type": { "type": "ArrayType", "elements": [ @@ -64,6 +66,11 @@ } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "f", + "kind": "function", "members": { "instance": [], "static": [], diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json index 3f5dff173..c6e85d7d4 100644 --- a/test/fixture/boolean-literal-type.output.md.json +++ b/test/fixture/boolean-literal-type.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "f" } - ], - "data": { - "id": "f", - "htmlAttributes": { - "id": "f" - }, - "hProperties": { - "id": "f" - } - } + ] }, { "type": "strong", diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md index 5f0f252c7..ff4da14ba 100644 --- a/test/fixture/class.config.output.md +++ b/test/fixture/class.config.output.md @@ -27,3 +27,4 @@ Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Re ## Hello World + diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json index 49b3b81e0..2f517cc09 100644 --- a/test/fixture/class.output.json +++ b/test/fixture/class.output.json @@ -93,11 +93,13 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "MyClass", + "examples": [], + "params": [], "properties": [ { + "title": "property", "name": "howMany", "lineNumber": 3, "description": { @@ -158,6 +160,12 @@ } } ], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "MyClass", "members": { "instance": [ { @@ -256,9 +264,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "getIt", "lineNumber": 2, "description": { @@ -319,6 +330,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -373,12 +385,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "getFoo", "kind": "function", "memberof": "MyClass", @@ -486,7 +502,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -541,11 +561,15 @@ } } }, + "title": "returns", "type": { "type": "UndefinedLiteral" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "getUndefined", "kind": "function", "memberof": "MyClass", diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json index 962b34920..4292255b6 100644 --- a/test/fixture/class.output.md.json +++ b/test/fixture/class.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "MyClass" } - ], - "data": { - "id": "myclass", - "htmlAttributes": { - "id": "myclass" - }, - "hProperties": { - "id": "myclass" - } - } + ] }, { "type": "paragraph", @@ -155,16 +146,7 @@ "type": "text", "value": "getFoo" } - ], - "data": { - "id": "getfoo", - "htmlAttributes": { - "id": "getfoo" - }, - "hProperties": { - "id": "getfoo" - } - } + ] }, { "type": "paragraph", @@ -361,16 +343,7 @@ "type": "text", "value": "getUndefined" } - ], - "data": { - "id": "getundefined", - "htmlAttributes": { - "id": "getundefined" - }, - "hProperties": { - "id": "getundefined" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/config-malformed.json b/test/fixture/config-malformed.json new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/test/fixture/config-malformed.json @@ -0,0 +1 @@ +* diff --git a/test/fixture/custom_theme/index.js b/test/fixture/custom_theme/index.js index db1e3a385..7f1730a5a 100644 --- a/test/fixture/custom_theme/index.js +++ b/test/fixture/custom_theme/index.js @@ -5,7 +5,7 @@ var File = require('vinyl'); * support. */ module.exports = function(comments, options, callback) { - return callback(null, [new File({ + return Promise.resolve([new File({ base: '/', path: '/index.html', contents: new Buffer('Hello world') diff --git a/test/fixture/document-exported-export-default-object.output.json b/test/fixture/document-exported-export-default-object.output.json index 03b839755..74cd9bffa 100644 --- a/test/fixture/document-exported-export-default-object.output.json +++ b/test/fixture/document-exported-export-default-object.output.json @@ -24,7 +24,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "document-exported-export-default-object.input", "members": { "instance": [], @@ -63,7 +71,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "x", "members": { "instance": [], diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json index 6ca318d68..c79cb8e64 100644 --- a/test/fixture/document-exported-export-default-object.output.md.json +++ b/test/fixture/document-exported-export-default-object.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "document-exported-export-default-object.input" } - ], - "data": { - "id": "document-exported-export-default-objectinput", - "htmlAttributes": { - "id": "document-exported-export-default-objectinput" - }, - "hProperties": { - "id": "document-exported-export-default-objectinput" - } - } + ] }, { "depth": 2, @@ -32,16 +23,7 @@ "type": "text", "value": "x" } - ], - "data": { - "id": "x", - "htmlAttributes": { - "id": "x" - }, - "hProperties": { - "id": "x" - } - } + ] } ] } \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-value.output.json b/test/fixture/document-exported-export-default-value.output.json index baa003f74..8b6095ade 100644 --- a/test/fixture/document-exported-export-default-value.output.json +++ b/test/fixture/document-exported-export-default-value.output.json @@ -24,7 +24,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "document-exported-export-default-value.input", "members": { "instance": [], diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json index d4a0c52d9..686f080df 100644 --- a/test/fixture/document-exported-export-default-value.output.md.json +++ b/test/fixture/document-exported-export-default-value.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "document-exported-export-default-value.input" } - ], - "data": { - "id": "document-exported-export-default-valueinput", - "htmlAttributes": { - "id": "document-exported-export-default-valueinput" - }, - "hProperties": { - "id": "document-exported-export-default-valueinput" - } - } + ] } ] } \ No newline at end of file diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json index 29d6660e1..230b19314 100644 --- a/test/fixture/document-exported.output.json +++ b/test/fixture/document-exported.output.json @@ -24,7 +24,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "z", "kind": "class", "members": { @@ -54,7 +62,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "zMethod", "kind": "function", "memberof": "z", @@ -114,9 +130,9 @@ } } }, + "augments": [], "errors": [], - "name": "x", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -124,6 +140,13 @@ "lineNumber": 1 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "x", + "kind": "function", "members": { "instance": [], "static": [], @@ -162,7 +185,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "Class", "kind": "class", "members": { @@ -192,7 +223,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "classMethod", "kind": "function", "memberof": "Class", @@ -240,7 +279,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "classGetter", "kind": "member", "memberof": "Class", @@ -288,9 +335,9 @@ } } }, + "augments": [], "errors": [], - "name": "classSetter", - "kind": "member", + "examples": [], "params": [ { "title": "param", @@ -298,6 +345,13 @@ "lineNumber": 6 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "classSetter", + "kind": "member", "memberof": "Class", "scope": "instance", "members": { @@ -345,7 +399,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "staticMethod", "kind": "function", "memberof": "Class", @@ -393,7 +455,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "staticGetter", "kind": "member", "memberof": "Class", @@ -441,9 +511,9 @@ } } }, + "augments": [], "errors": [], - "name": "staticSetter", - "kind": "member", + "examples": [], "params": [ { "title": "param", @@ -451,6 +521,13 @@ "lineNumber": 9 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "staticSetter", + "kind": "member", "memberof": "Class", "scope": "static", "members": { @@ -507,7 +584,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "T5", "kind": "typedef", "type": { @@ -552,7 +637,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "y2Default", "members": { "instance": [], @@ -642,9 +735,9 @@ } } }, + "augments": [], "errors": [], - "name": "y4", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -656,13 +749,20 @@ } } ], + "properties": [], "returns": [ { + "title": "returns", "type": { "type": "VoidLiteral" } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "y4", + "kind": "function", "members": { "instance": [], "static": [], @@ -701,7 +801,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "object", "members": { "instance": [], @@ -731,7 +839,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "prop", "memberof": "object", "scope": "static", @@ -776,7 +892,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "func", "kind": "function", "memberof": "object", @@ -833,7 +957,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "method", "kind": "function", "members": { @@ -874,7 +1006,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "getter", "kind": "member", "members": { @@ -915,9 +1055,9 @@ } } }, + "augments": [], "errors": [], - "name": "setter", - "kind": "member", + "examples": [], "params": [ { "title": "param", @@ -925,6 +1065,13 @@ "lineNumber": 15 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "setter", + "kind": "member", "members": { "instance": [], "static": [], @@ -963,7 +1110,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "f1", "kind": "function", "members": { @@ -1004,7 +1159,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "f3", "kind": "function", "members": { @@ -1045,7 +1208,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "T", "kind": "typedef", "type": { @@ -1090,7 +1261,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "T2", "kind": "typedef", "type": { @@ -1135,7 +1314,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "T4", "kind": "typedef", "type": { @@ -1180,9 +1367,9 @@ } } }, + "augments": [], "errors": [], - "name": "f4", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -1194,6 +1381,13 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "f4", + "kind": "function", "members": { "instance": [], "static": [], @@ -1232,7 +1426,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "o1", "members": { "instance": [], @@ -1271,7 +1473,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "om1", "kind": "function", "members": { @@ -1363,9 +1573,9 @@ } } }, + "augments": [], "errors": [], - "name": "f5", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -1377,6 +1587,13 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "f5", + "kind": "function", "members": { "instance": [], "static": [], @@ -1415,7 +1632,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "o2", "members": { "instance": [], @@ -1454,7 +1679,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "om2", "kind": "function", "members": { diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json index 6065877bc..ad889a0a2 100644 --- a/test/fixture/document-exported.output.md.json +++ b/test/fixture/document-exported.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "z" } - ], - "data": { - "id": "z", - "htmlAttributes": { - "id": "z" - }, - "hProperties": { - "id": "z" - } - } + ] }, { "depth": 3, @@ -32,16 +23,7 @@ "type": "text", "value": "zMethod" } - ], - "data": { - "id": "zmethod", - "htmlAttributes": { - "id": "zmethod" - }, - "hProperties": { - "id": "zmethod" - } - } + ] }, { "depth": 2, @@ -51,16 +33,7 @@ "type": "text", "value": "x" } - ], - "data": { - "id": "x", - "htmlAttributes": { - "id": "x" - }, - "hProperties": { - "id": "x" - } - } + ] }, { "type": "strong", @@ -107,16 +80,7 @@ "type": "text", "value": "Class" } - ], - "data": { - "id": "class", - "htmlAttributes": { - "id": "class" - }, - "hProperties": { - "id": "class" - } - } + ] }, { "depth": 3, @@ -126,16 +90,7 @@ "type": "text", "value": "classMethod" } - ], - "data": { - "id": "classmethod", - "htmlAttributes": { - "id": "classmethod" - }, - "hProperties": { - "id": "classmethod" - } - } + ] }, { "depth": 3, @@ -145,16 +100,7 @@ "type": "text", "value": "classGetter" } - ], - "data": { - "id": "classgetter", - "htmlAttributes": { - "id": "classgetter" - }, - "hProperties": { - "id": "classgetter" - } - } + ] }, { "depth": 3, @@ -164,16 +110,7 @@ "type": "text", "value": "classSetter" } - ], - "data": { - "id": "classsetter", - "htmlAttributes": { - "id": "classsetter" - }, - "hProperties": { - "id": "classsetter" - } - } + ] }, { "type": "strong", @@ -220,16 +157,7 @@ "type": "text", "value": "staticMethod" } - ], - "data": { - "id": "staticmethod", - "htmlAttributes": { - "id": "staticmethod" - }, - "hProperties": { - "id": "staticmethod" - } - } + ] }, { "depth": 3, @@ -239,16 +167,7 @@ "type": "text", "value": "staticGetter" } - ], - "data": { - "id": "staticgetter", - "htmlAttributes": { - "id": "staticgetter" - }, - "hProperties": { - "id": "staticgetter" - } - } + ] }, { "depth": 3, @@ -258,16 +177,7 @@ "type": "text", "value": "staticSetter" } - ], - "data": { - "id": "staticsetter", - "htmlAttributes": { - "id": "staticsetter" - }, - "hProperties": { - "id": "staticsetter" - } - } + ] }, { "type": "strong", @@ -314,16 +224,7 @@ "type": "text", "value": "T5" } - ], - "data": { - "id": "t5", - "htmlAttributes": { - "id": "t5" - }, - "hProperties": { - "id": "t5" - } - } + ] }, { "type": "paragraph", @@ -353,16 +254,7 @@ "type": "text", "value": "y2Default" } - ], - "data": { - "id": "y2default", - "htmlAttributes": { - "id": "y2default" - }, - "hProperties": { - "id": "y2default" - } - } + ] }, { "depth": 2, @@ -372,16 +264,7 @@ "type": "text", "value": "y4" } - ], - "data": { - "id": "y4", - "htmlAttributes": { - "id": "y4" - }, - "hProperties": { - "id": "y4" - } - } + ] }, { "type": "paragraph", @@ -501,16 +384,7 @@ "type": "text", "value": "object" } - ], - "data": { - "id": "object", - "htmlAttributes": { - "id": "object" - }, - "hProperties": { - "id": "object" - } - } + ] }, { "depth": 3, @@ -520,16 +394,7 @@ "type": "text", "value": "prop" } - ], - "data": { - "id": "prop", - "htmlAttributes": { - "id": "prop" - }, - "hProperties": { - "id": "prop" - } - } + ] }, { "depth": 3, @@ -539,16 +404,7 @@ "type": "text", "value": "func" } - ], - "data": { - "id": "func", - "htmlAttributes": { - "id": "func" - }, - "hProperties": { - "id": "func" - } - } + ] }, { "depth": 2, @@ -558,16 +414,7 @@ "type": "text", "value": "method" } - ], - "data": { - "id": "method", - "htmlAttributes": { - "id": "method" - }, - "hProperties": { - "id": "method" - } - } + ] }, { "depth": 2, @@ -577,16 +424,7 @@ "type": "text", "value": "getter" } - ], - "data": { - "id": "getter", - "htmlAttributes": { - "id": "getter" - }, - "hProperties": { - "id": "getter" - } - } + ] }, { "depth": 2, @@ -596,16 +434,7 @@ "type": "text", "value": "setter" } - ], - "data": { - "id": "setter", - "htmlAttributes": { - "id": "setter" - }, - "hProperties": { - "id": "setter" - } - } + ] }, { "type": "strong", @@ -652,16 +481,7 @@ "type": "text", "value": "f1" } - ], - "data": { - "id": "f1", - "htmlAttributes": { - "id": "f1" - }, - "hProperties": { - "id": "f1" - } - } + ] }, { "depth": 2, @@ -671,16 +491,7 @@ "type": "text", "value": "f3" } - ], - "data": { - "id": "f3", - "htmlAttributes": { - "id": "f3" - }, - "hProperties": { - "id": "f3" - } - } + ] }, { "depth": 2, @@ -690,16 +501,7 @@ "type": "text", "value": "T" } - ], - "data": { - "id": "t", - "htmlAttributes": { - "id": "t" - }, - "hProperties": { - "id": "t" - } - } + ] }, { "type": "paragraph", @@ -729,16 +531,7 @@ "type": "text", "value": "T2" } - ], - "data": { - "id": "t2", - "htmlAttributes": { - "id": "t2" - }, - "hProperties": { - "id": "t2" - } - } + ] }, { "type": "paragraph", @@ -768,16 +561,7 @@ "type": "text", "value": "T4" } - ], - "data": { - "id": "t4", - "htmlAttributes": { - "id": "t4" - }, - "hProperties": { - "id": "t4" - } - } + ] }, { "type": "paragraph", @@ -807,16 +591,7 @@ "type": "text", "value": "f4" } - ], - "data": { - "id": "f4", - "htmlAttributes": { - "id": "f4" - }, - "hProperties": { - "id": "f4" - } - } + ] }, { "type": "strong", @@ -872,16 +647,7 @@ "type": "text", "value": "o1" } - ], - "data": { - "id": "o1", - "htmlAttributes": { - "id": "o1" - }, - "hProperties": { - "id": "o1" - } - } + ] }, { "depth": 2, @@ -891,16 +657,7 @@ "type": "text", "value": "om1" } - ], - "data": { - "id": "om1", - "htmlAttributes": { - "id": "om1" - }, - "hProperties": { - "id": "om1" - } - } + ] }, { "depth": 2, @@ -910,16 +667,7 @@ "type": "text", "value": "f5" } - ], - "data": { - "id": "f5", - "htmlAttributes": { - "id": "f5" - }, - "hProperties": { - "id": "f5" - } - } + ] }, { "type": "paragraph", @@ -1010,16 +758,7 @@ "type": "text", "value": "o2" } - ], - "data": { - "id": "o2", - "htmlAttributes": { - "id": "o2" - }, - "hProperties": { - "id": "o2" - } - } + ] }, { "depth": 2, @@ -1029,16 +768,7 @@ "type": "text", "value": "om2" } - ], - "data": { - "id": "om2", - "htmlAttributes": { - "id": "om2" - }, - "hProperties": { - "id": "om2" - } - } + ] } ] } \ No newline at end of file diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json index 20a562615..cb01e1dbb 100644 --- a/test/fixture/es6-class.output.json +++ b/test/fixture/es6-class.output.json @@ -75,14 +75,21 @@ } } }, - "errors": [], - "name": "Foo", "augments": [ { "title": "augments", "name": "React.Component" } ], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "Foo", "kind": "class", "members": { "instance": [], @@ -173,7 +180,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "Bar", "kind": "class", "members": { @@ -265,9 +280,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "str", "lineNumber": 2, "type": { @@ -276,6 +294,11 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "constructor", "kind": "function", "memberof": "Bar", @@ -384,7 +407,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "bar", "memberof": "Bar", "scope": "instance", diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json index 3ea160e54..be9e2c03f 100644 --- a/test/fixture/es6-class.output.md.json +++ b/test/fixture/es6-class.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "Foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", @@ -85,16 +76,7 @@ "type": "text", "value": "Bar" } - ], - "data": { - "id": "bar", - "htmlAttributes": { - "id": "bar" - }, - "hProperties": { - "id": "bar" - } - } + ] }, { "type": "paragraph", @@ -139,16 +121,7 @@ "type": "text", "value": "constructor" } - ], - "data": { - "id": "constructor", - "htmlAttributes": { - "id": "constructor" - }, - "hProperties": { - "id": "constructor" - } - } + ] }, { "type": "paragraph", @@ -246,16 +219,7 @@ "type": "text", "value": "bar" } - ], - "data": { - "id": "bar-1", - "htmlAttributes": { - "id": "bar-1" - }, - "hProperties": { - "id": "bar-1" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json index 43a0cc58f..f75e389b3 100644 --- a/test/fixture/es6-default2.output.json +++ b/test/fixture/es6-default2.output.json @@ -30,10 +30,9 @@ } } }, + "augments": [], "errors": [], - "access": "public", - "name": "es6-default2.input", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -41,6 +40,14 @@ "lineNumber": 4 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "access": "public", + "name": "es6-default2.input", + "kind": "function", "members": { "instance": [], "static": [], diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json index a4facdbc8..3e6561ebd 100644 --- a/test/fixture/es6-default2.output.md.json +++ b/test/fixture/es6-default2.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "es6-default2.input" } - ], - "data": { - "id": "es6-default2input", - "htmlAttributes": { - "id": "es6-default2input" - }, - "hProperties": { - "id": "es6-default2input" - } - } + ] }, { "type": "strong", diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json index 4c3b25624..c1126f032 100644 --- a/test/fixture/es6-import.output.json +++ b/test/fixture/es6-import.output.json @@ -85,7 +85,17 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "a", + "lineNumber": 9 + } + ], + "properties": [], "returns": [ { "description": { @@ -140,21 +150,18 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "multiplyTwice", "kind": "function", - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 9 - } - ], "members": { "instance": [], "static": [], @@ -244,7 +251,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "es6-ext", "members": { "instance": [], @@ -344,7 +359,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -399,12 +418,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple.input", "kind": "function", "members": { diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json index 9ae20c52b..a07e50523 100644 --- a/test/fixture/es6-import.output.md.json +++ b/test/fixture/es6-import.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "multiplyTwice" } - ], - "data": { - "id": "multiplytwice", - "htmlAttributes": { - "id": "multiplytwice" - }, - "hProperties": { - "id": "multiplytwice" - } - } + ] }, { "type": "paragraph", @@ -168,16 +159,7 @@ "type": "text", "value": "es6-ext" } - ], - "data": { - "id": "es6-ext", - "htmlAttributes": { - "id": "es6-ext" - }, - "hProperties": { - "id": "es6-ext" - } - } + ] }, { "type": "paragraph", @@ -222,16 +204,7 @@ "type": "text", "value": "simple.input" } - ], - "data": { - "id": "simpleinput", - "htmlAttributes": { - "id": "simpleinput" - }, - "hProperties": { - "id": "simpleinput" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md index 6a3d7ffa7..95a3c2c68 100644 --- a/test/fixture/es6.output-toc.md +++ b/test/fixture/es6.output-toc.md @@ -7,7 +7,7 @@ have any parameter descriptions. **Parameters** -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) +- `$0` **any** (optional, default `{}`) - `$0.phoneNumbers` (optional, default `[]`) - `$0.emailAddresses` (optional, default `[]`) - `$0.params` **...any** @@ -18,7 +18,7 @@ Similar, but with an array **Parameters** -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** +- `$0` **any** - `$0.a` - `$0.b` - `$0.c` diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 62862566d..b4d8eafae 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -79,16 +79,15 @@ } } }, + "augments": [], "errors": [], - "name": "destructure", - "kind": "function", + "examples": [], "params": [ { "title": "param", "name": "$0", "type": { - "type": "NameExpression", - "name": "Object" + "type": "AllLiteral" }, "default": "{}", "properties": [ @@ -113,6 +112,13 @@ ] } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "destructure", + "kind": "function", "members": { "instance": [], "static": [], @@ -208,21 +214,19 @@ } } }, + "augments": [], "errors": [], "examples": [ { "description": "destructure([1, 2, 3])" } ], - "name": "destructure", - "kind": "function", "params": [ { "title": "param", "name": "$0", "type": { - "type": "NameExpression", - "name": "Array" + "type": "AllLiteral" }, "properties": [ { @@ -243,6 +247,13 @@ ] } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "destructure", + "kind": "function", "members": { "instance": [], "static": [], @@ -361,9 +372,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "a", "lineNumber": 2, "description": { @@ -438,6 +452,7 @@ "lineNumber": 21 } ], + "properties": [], "returns": [ { "description": { @@ -492,12 +507,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "multiply", "kind": "function", "members": { @@ -589,7 +608,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "Sink", "kind": "class", "members": { @@ -670,7 +697,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "staticProp", "kind": "member", "memberof": "Sink", @@ -769,7 +804,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "empty", "kind": "function", "memberof": "Sink", @@ -872,7 +915,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "aGetter", "kind": "member", "memberof": "Sink", @@ -941,9 +992,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "height", "lineNumber": 1, "description": { @@ -1004,6 +1058,7 @@ } }, { + "title": "param", "name": "width", "lineNumber": 2, "description": { @@ -1064,6 +1119,11 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "constructor", "kind": "function", "memberof": "Sink", @@ -1164,7 +1224,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "hello", "kind": "function", "memberof": "Sink", @@ -1284,7 +1352,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -1339,12 +1411,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Basket" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "makeABasket", "kind": "function", "members": { @@ -1534,7 +1610,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -1589,12 +1669,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Sink" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "makeASink", "kind": "function", "members": { @@ -1686,9 +1770,9 @@ } } }, + "augments": [], "errors": [], - "name": "functionWithRest", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -1699,6 +1783,13 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "functionWithRest", + "kind": "function", "members": { "instance": [], "static": [], @@ -1788,9 +1879,9 @@ } } }, + "augments": [], "errors": [], - "name": "functionWithRestAndType", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -1805,6 +1896,13 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "functionWithRestAndType", + "kind": "function", "members": { "instance": [], "static": [], @@ -1894,7 +1992,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { @@ -1996,7 +2102,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -2051,12 +2161,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "es6.input", "kind": "function", "members": { @@ -2148,9 +2262,9 @@ } } }, + "augments": [], "errors": [], - "name": "veryImportantTransform", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -2158,6 +2272,13 @@ "default": "'bar'" } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "veryImportantTransform", + "kind": "function", "members": { "instance": [], "static": [], @@ -2253,7 +2374,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "access": "protected", "name": "iAmProtected", "kind": "function", @@ -2352,7 +2481,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "access": "public", "name": "iAmPublic", "kind": "function", @@ -2445,7 +2582,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "execute", "members": { "instance": [], @@ -2535,9 +2680,9 @@ } } }, + "augments": [], "errors": [], - "name": "isArrayEqualWith", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -2609,14 +2754,21 @@ } } ], + "properties": [], "returns": [ { + "title": "returns", "type": { "type": "NameExpression", "name": "boolean" } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "isArrayEqualWith", + "kind": "function", "members": { "instance": [], "static": [], diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 3aeec16ce..985716788 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -30,7 +30,7 @@ have any parameter descriptions. **Parameters** -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) +- `$0` **any** (optional, default `{}`) - `$0.phoneNumbers` (optional, default `[]`) - `$0.emailAddresses` (optional, default `[]`) - `$0.params` **...any** @@ -41,7 +41,7 @@ Similar, but with an array **Parameters** -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** +- `$0` **any** - `$0.a` - `$0.b` - `$0.c` diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index e2e2b8155..7826d97d5 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "destructure" } - ], - "data": { - "id": "destructure", - "htmlAttributes": { - "id": "destructure" - }, - "hProperties": { - "id": "destructure" - } - } + ] }, { "type": "paragraph", @@ -94,15 +85,8 @@ "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] + "type": "text", + "value": "any" } ] }, @@ -260,16 +244,7 @@ "type": "text", "value": "destructure" } - ], - "data": { - "id": "destructure-1", - "htmlAttributes": { - "id": "destructure-1" - }, - "hProperties": { - "id": "destructure-1" - } - } + ] }, { "type": "paragraph", @@ -337,15 +312,8 @@ "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] + "type": "text", + "value": "any" } ] }, @@ -453,16 +421,7 @@ "type": "text", "value": "multiply" } - ], - "data": { - "id": "multiply", - "htmlAttributes": { - "id": "multiply" - }, - "hProperties": { - "id": "multiply" - } - } + ] }, { "type": "paragraph", @@ -700,16 +659,7 @@ "type": "text", "value": "Sink" } - ], - "data": { - "id": "sink", - "htmlAttributes": { - "id": "sink" - }, - "hProperties": { - "id": "sink" - } - } + ] }, { "type": "paragraph", @@ -754,16 +704,7 @@ "type": "text", "value": "staticProp" } - ], - "data": { - "id": "staticprop", - "htmlAttributes": { - "id": "staticprop" - }, - "hProperties": { - "id": "staticprop" - } - } + ] }, { "type": "paragraph", @@ -808,16 +749,7 @@ "type": "text", "value": "empty" } - ], - "data": { - "id": "empty", - "htmlAttributes": { - "id": "empty" - }, - "hProperties": { - "id": "empty" - } - } + ] }, { "type": "paragraph", @@ -862,16 +794,7 @@ "type": "text", "value": "aGetter" } - ], - "data": { - "id": "agetter", - "htmlAttributes": { - "id": "agetter" - }, - "hProperties": { - "id": "agetter" - } - } + ] }, { "type": "paragraph", @@ -920,16 +843,7 @@ "type": "text", "value": "constructor" } - ], - "data": { - "id": "constructor", - "htmlAttributes": { - "id": "constructor" - }, - "hProperties": { - "id": "constructor" - } - } + ] }, { "type": "strong", @@ -1100,16 +1014,7 @@ "type": "text", "value": "hello" } - ], - "data": { - "id": "hello", - "htmlAttributes": { - "id": "hello" - }, - "hProperties": { - "id": "hello" - } - } + ] }, { "type": "paragraph", @@ -1154,16 +1059,7 @@ "type": "text", "value": "makeABasket" } - ], - "data": { - "id": "makeabasket", - "htmlAttributes": { - "id": "makeabasket" - }, - "hProperties": { - "id": "makeabasket" - } - } + ] }, { "type": "paragraph", @@ -1265,16 +1161,7 @@ "type": "text", "value": "makeASink" } - ], - "data": { - "id": "makeasink", - "htmlAttributes": { - "id": "makeasink" - }, - "hProperties": { - "id": "makeasink" - } - } + ] }, { "type": "paragraph", @@ -1471,16 +1358,7 @@ "type": "text", "value": "functionWithRest" } - ], - "data": { - "id": "functionwithrest", - "htmlAttributes": { - "id": "functionwithrest" - }, - "hProperties": { - "id": "functionwithrest" - } - } + ] }, { "type": "paragraph", @@ -1575,16 +1453,7 @@ "type": "text", "value": "functionWithRestAndType" } - ], - "data": { - "id": "functionwithrestandtype", - "htmlAttributes": { - "id": "functionwithrestandtype" - }, - "hProperties": { - "id": "functionwithrestandtype" - } - } + ] }, { "type": "paragraph", @@ -1686,16 +1555,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", @@ -1740,16 +1600,7 @@ "type": "text", "value": "es6.input" } - ], - "data": { - "id": "es6input", - "htmlAttributes": { - "id": "es6input" - }, - "hProperties": { - "id": "es6input" - } - } + ] }, { "type": "paragraph", @@ -1858,16 +1709,7 @@ "type": "text", "value": "veryImportantTransform" } - ], - "data": { - "id": "veryimportanttransform", - "htmlAttributes": { - "id": "veryimportanttransform" - }, - "hProperties": { - "id": "veryimportanttransform" - } - } + ] }, { "type": "paragraph", @@ -1966,16 +1808,7 @@ "type": "text", "value": "iAmProtected" } - ], - "data": { - "id": "iamprotected", - "htmlAttributes": { - "id": "iamprotected" - }, - "hProperties": { - "id": "iamprotected" - } - } + ] }, { "type": "paragraph", @@ -2020,16 +1853,7 @@ "type": "text", "value": "iAmPublic" } - ], - "data": { - "id": "iampublic", - "htmlAttributes": { - "id": "iampublic" - }, - "hProperties": { - "id": "iampublic" - } - } + ] }, { "type": "paragraph", @@ -2074,16 +1898,7 @@ "type": "text", "value": "execute" } - ], - "data": { - "id": "execute", - "htmlAttributes": { - "id": "execute" - }, - "hProperties": { - "id": "execute" - } - } + ] }, { "type": "paragraph", @@ -2128,16 +1943,7 @@ "type": "text", "value": "isArrayEqualWith" } - ], - "data": { - "id": "isarrayequalwith", - "htmlAttributes": { - "id": "isarrayequalwith" - }, - "hProperties": { - "id": "isarrayequalwith" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/event.output.json b/test/fixture/event.output.json index ae349584c..e34cd3413 100644 --- a/test/fixture/event.output.json +++ b/test/fixture/event.output.json @@ -110,11 +110,13 @@ } } }, + "augments": [], "errors": [], - "kind": "event", - "name": "Map#mousemove", + "examples": [], + "params": [], "properties": [ { + "title": "property", "name": "point", "lineNumber": 5, "description": { @@ -175,6 +177,7 @@ } }, { + "title": "property", "name": "originalEvent", "lineNumber": 6, "description": { @@ -235,6 +238,12 @@ } } ], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "event", + "name": "Map#mousemove", "members": { "instance": [], "static": [], diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json index 5e43d48dc..4d7dc7416 100644 --- a/test/fixture/event.output.md.json +++ b/test/fixture/event.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "Map#mousemove" } - ], - "data": { - "id": "mapmousemove", - "htmlAttributes": { - "id": "mapmousemove" - }, - "hProperties": { - "id": "mapmousemove" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/example-caption.output.json b/test/fixture/example-caption.output.json index 7fb36daf6..fba5a26bd 100644 --- a/test/fixture/example-caption.output.json +++ b/test/fixture/example-caption.output.json @@ -91,10 +91,12 @@ } } }, + "augments": [], "errors": [], - "returns": [ + "examples": [ { - "description": { + "description": "foo(1);", + "caption": { "type": "root", "children": [ { @@ -102,7 +104,7 @@ "children": [ { "type": "text", - "value": "numberone", + "value": "demonstrates how to run foo", "position": { "start": { "line": 1, @@ -111,8 +113,8 @@ }, "end": { "line": 1, - "column": 10, - "offset": 9 + "column": 28, + "offset": 27 }, "indent": [] } @@ -126,8 +128,8 @@ }, "end": { "line": 1, - "column": 10, - "offset": 9 + "column": 28, + "offset": 27 }, "indent": [] } @@ -141,21 +143,18 @@ }, "end": { "line": 1, - "column": 10, - "offset": 9 + "column": 28, + "offset": 27 } } - }, - "type": { - "type": "NameExpression", - "name": "Number" } } ], - "examples": [ + "params": [], + "properties": [], + "returns": [ { - "description": "foo(1);", - "caption": { + "description": { "type": "root", "children": [ { @@ -163,7 +162,7 @@ "children": [ { "type": "text", - "value": "demonstrates how to run foo", + "value": "numberone", "position": { "start": { "line": 1, @@ -172,8 +171,8 @@ }, "end": { "line": 1, - "column": 28, - "offset": 27 + "column": 10, + "offset": 9 }, "indent": [] } @@ -187,8 +186,8 @@ }, "end": { "line": 1, - "column": 28, - "offset": 27 + "column": 10, + "offset": 9 }, "indent": [] } @@ -202,13 +201,21 @@ }, "end": { "line": 1, - "column": 28, - "offset": 27 + "column": 10, + "offset": 9 } } + }, + "title": "returns", + "type": { + "type": "NameExpression", + "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json index 50a27aad1..fa77489fc 100644 --- a/test/fixture/example-caption.output.md.json +++ b/test/fixture/example-caption.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/external.output.json b/test/fixture/external.output.json index c8e02a0b7..b7f770108 100644 --- a/test/fixture/external.output.json +++ b/test/fixture/external.output.json @@ -109,7 +109,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json index e85a11a76..fcd4812e8 100644 --- a/test/fixture/external.output.md.json +++ b/test/fixture/external.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json index 7e7078904..1b16eea16 100644 --- a/test/fixture/factory.output.json +++ b/test/fixture/factory.output.json @@ -85,7 +85,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -140,12 +144,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "area" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "area", "kind": "function", "members": { @@ -194,9 +202,9 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "area", + "examples": [], "params": [ { "title": "param", @@ -204,6 +212,13 @@ "lineNumber": 10 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "area", "members": { "instance": [], "static": [], @@ -300,14 +315,14 @@ } } }, + "augments": [], "errors": [ { "message": "@memberof reference to chart not found", "commentLineNumber": 0 } ], - "kind": "function", - "name": "data", + "examples": [], "params": [ { "title": "param", @@ -315,6 +330,13 @@ "lineNumber": 17 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "function", + "name": "data", "memberof": "chart", "scope": "static", "members": { diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json index 293fdb447..a4ac3c232 100644 --- a/test/fixture/factory.output.md.json +++ b/test/fixture/factory.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "area" } - ], - "data": { - "id": "area", - "htmlAttributes": { - "id": "area" - }, - "hProperties": { - "id": "area" - } - } + ] }, { "type": "paragraph", @@ -131,16 +122,7 @@ "type": "text", "value": "area" } - ], - "data": { - "id": "area-1", - "htmlAttributes": { - "id": "area-1" - }, - "hProperties": { - "id": "area-1" - } - } + ] }, { "type": "strong", @@ -187,16 +169,7 @@ "type": "text", "value": "data" } - ], - "data": { - "id": "data", - "htmlAttributes": { - "id": "data" - }, - "hProperties": { - "id": "data" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index d4a3b7cd0..c5ce6d5fa 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -2,7 +2,7 @@ - | Documentation + documentation 4.0.0-beta.18 | Documentation @@ -13,8 +13,8 @@
-

-
+

documentation

+
4.0.0-beta.18
+
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ +
Static Members
@@ -324,6 +339,13 @@

isClass(other: Object, also: any): boolean
+

+ Extends + + + +

+ @@ -355,6 +377,11 @@

+
Properties
+
+ +
+ @@ -367,8 +394,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -399,6 +434,13 @@

isWeird(other: Weird): boolean
+

+ Extends + + + +

+ @@ -422,6 +464,11 @@

+
Properties
+
+ +
+ @@ -434,8 +481,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -465,6 +520,13 @@

isBuffer(buf: (Buffer | string), size: number?): boolean
+

+ Extends + + + +

+ @@ -498,6 +560,11 @@

+
Properties
+
+ +
+ @@ -510,8 +577,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -541,6 +616,13 @@

isArrayOfBuffers(buffers: Array<Buffer>): number
+

+ Extends + + + +

+ @@ -565,6 +647,11 @@

+
Properties
+
+ +
+ @@ -577,6 +664,11 @@

+
Throws
+
    + +
+
Example
@@ -615,6 +707,13 @@

MAGIC_NUMBER
+

+ Extends + + + +

+ @@ -623,14 +722,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -668,6 +787,13 @@

getFoo(): Number
+

+ Extends + + + +

+ @@ -676,8 +802,18 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ @@ -690,6 +826,11 @@

+
Throws
+
    + +
+
Example
@@ -728,6 +869,13 @@

withOptions(options: Object, otherOptions: number?)
+

+ Extends + + + +

+ @@ -787,12 +935,27 @@

+
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -830,6 +993,13 @@

event
+

+ Extends + + + +

+ @@ -838,14 +1008,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -881,8 +1071,15 @@

a typedef with nested properties

-
CustomError
+
CustomError(other: any, also: any)
+ +

+ Extends + + + +

@@ -892,6 +1089,27 @@

+
Parameters
+
+ +
+
+ other (any) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+
Properties
@@ -922,10 +1140,20 @@

+ + +
Throws
+
    + +
+ +
Example
+ + @@ -958,6 +1186,13 @@

bar(): Klass
+

+ Extends + + + +

+ @@ -966,8 +1201,18 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ @@ -980,8 +1225,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -1012,6 +1265,13 @@

bar(toys: ...Number): undefined
+

+ Extends + + + +

+ @@ -1035,6 +1295,11 @@

+
Properties
+
+ +
+ @@ -1047,8 +1312,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -1081,6 +1354,13 @@

bar(): undefined
+

+ Extends + + + +

+ @@ -1089,8 +1369,18 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ @@ -1103,8 +1393,16 @@

+
Throws
+
    + +
+ +
Example
+ + @@ -1135,6 +1433,13 @@

new Foo()
+

+ Extends + + + +

+ @@ -1143,14 +1448,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -1176,6 +1501,13 @@

bar
+

+ Extends + + + +

+ @@ -1184,14 +1516,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -1232,6 +1584,13 @@

customStreams
+

+ Extends + + + +

+ @@ -1240,14 +1599,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ +
Static Members
@@ -1271,6 +1650,13 @@

new passthrough()
+

+ Extends + + + +

+ @@ -1279,14 +1665,34 @@

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + diff --git a/test/fixture/html/nested.output.files b/test/fixture/html/nested.output.files index 4b61d7833..0e7da8b2b 100644 --- a/test/fixture/html/nested.output.files +++ b/test/fixture/html/nested.output.files @@ -2,7 +2,7 @@ - | Documentation + documentation 4.0.0-beta.18 | Documentation @@ -13,8 +13,8 @@
-

-
+

documentation

+
4.0.0-beta.18
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ +
Static Members
@@ -286,6 +301,13 @@ This is a [link to something that does not exist]DoesNotisClass(other: Object, also: any): boolean
+

+ Extends + + + +

+ @@ -317,6 +339,11 @@ This is a [link to something that does not exist]DoesNotProperties
+
+ +
+ @@ -329,8 +356,16 @@ This is a [link to something that does not exist]DoesNotThrows

+
    + +
+ +
Example
+ + @@ -361,6 +396,13 @@ the referenced class type

isWeird(other: Weird): boolean
+

+ Extends + + + +

+ @@ -384,6 +426,11 @@ the referenced class type

+
Properties
+
+ +
+ @@ -396,8 +443,16 @@ the referenced class type

+
Throws
+
    + +
+ +
Example
+ + @@ -427,6 +482,13 @@ the referenced class type

isBuffer(buf: (Buffer | string), size: number?): boolean
+

+ Extends + + + +

+ @@ -460,6 +522,11 @@ the referenced class type

+
Properties
+
+ +
+ @@ -472,8 +539,16 @@ the referenced class type

+
Throws
+
    + +
+ +
Example
+ + @@ -503,6 +578,13 @@ the referenced class type

isArrayOfBuffers(buffers: Array<Buffer>): number
+

+ Extends + + + +

+ @@ -527,6 +609,11 @@ the referenced class type

+
Properties
+
+ +
+ @@ -539,6 +626,11 @@ the referenced class type

+
Throws
+
    + +
+
Example
@@ -577,6 +669,13 @@ k.isArrayOfBuffers();
MAGIC_NUMBER
+

+ Extends + + + +

+ @@ -585,14 +684,34 @@ k.isArrayOfBuffers(); +
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -630,6 +749,13 @@ k.isArrayOfBuffers();
getFoo(): Number
+

+ Extends + + + +

+ @@ -638,8 +764,18 @@ k.isArrayOfBuffers(); +
Parameters
+
+ +
+ +
Properties
+
+ +
+ @@ -652,6 +788,11 @@ k.isArrayOfBuffers(); +
Throws
+
    + +
+
Example
@@ -690,6 +831,13 @@ k.isArrayOfBuffers();
withOptions(options: Object, otherOptions: number?)
+

+ Extends + + + +

+ @@ -749,12 +897,27 @@ k.isArrayOfBuffers(); +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -792,6 +955,13 @@ k.isArrayOfBuffers();
event
+

+ Extends + + + +

+ @@ -800,14 +970,34 @@ k.isArrayOfBuffers(); +
Parameters
+
+ +
+ +
Properties
+
+ +
+ + + +
Throws
+
    + +
+ +
Example
+ + @@ -843,8 +1033,15 @@ k.isArrayOfBuffers();

a typedef with nested properties

-
CustomError
+
CustomError(other: any, also: any)
+ +

+ Extends + + + +

@@ -854,6 +1051,27 @@ k.isArrayOfBuffers(); +
Parameters
+
+ +
+
+ other (any) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+
Properties
@@ -884,10 +1102,20 @@ k.isArrayOfBuffers(); + + +
Throws
+
    + +
+ +
Example
+ + @@ -920,6 +1148,13 @@ like a klass

bar(): Klass
+

+ Extends + + + +

+ @@ -928,8 +1163,18 @@ like a klass

+
Parameters
+
+ +
+ +
Properties
+
+ +
+ @@ -942,8 +1187,16 @@ like a klass

+
Throws
+
    + +
+ +
Example
+ + @@ -974,6 +1227,13 @@ like a klass

bar(toys: ...Number): undefined
+

+ Extends + + + +

+ @@ -997,6 +1257,11 @@ like a klass

+
Properties
+
+ +
+ @@ -1009,8 +1274,16 @@ like a klass

+
Throws
+
    + +
+ +
Example
+ + @@ -1043,6 +1316,13 @@ like a klass. This needs a undefined
+

+ Extends + + + +

+ @@ -1051,8 +1331,18 @@ like a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a + +### Table of Contents + +- [meta.input](#metainput) + +## meta.input + +This function returns the number one. + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone + +**Meta** + +- **version**: 1.0.0 +- **since**: 2.0.0 +- **copyright**: Tom MacWright + +- **license**: BSD diff --git a/test/fixture/sync/multiexample.output.md.json b/test/fixture/meta.output.md.json similarity index 62% rename from test/fixture/sync/multiexample.output.md.json rename to test/fixture/meta.output.md.json index 642b881ec..451588533 100644 --- a/test/fixture/sync/multiexample.output.md.json +++ b/test/fixture/meta.output.md.json @@ -11,34 +11,7 @@ "children": [ { "type": "text", - "value": "multiexample.input" - } - ], - "data": { - "id": "multiexampleinput", - "htmlAttributes": { - "id": "multiexampleinput" - }, - "hProperties": { - "id": "multiexampleinput" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Foo, Bar" - } - ] + "value": "meta.input" } ] }, @@ -78,23 +51,77 @@ } }, { - "type": "strong", + "type": "paragraph", "children": [ { "type": "text", - "value": "Examples" + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "numberone", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } } ] }, { - "lang": "javascript", - "type": "code", - "value": "foo(1);" - }, - { - "lang": "javascript", - "type": "code", - "value": "foo(2);" + "type": "strong", + "children": [ + { + "type": "text", + "value": "Meta" + } + ] }, { "ordered": false, @@ -106,64 +133,49 @@ { "type": "paragraph", "children": [ - { - "type": "text", - "value": "Throws " - }, { "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", - "type": "link", - "children": [ - { - "type": "text", - "value": "Error" - } - ] + "type": "text", + "value": "version" } ] }, { "type": "text", - "value": " " + "value": ": " }, { - "type": "paragraph", + "type": "text", + "value": "1.0.0" + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "strong", "children": [ { "type": "text", - "value": "if you give it something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } + "value": "since" } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } + ] + }, + { + "type": "text", + "value": ": " + }, + { + "type": "text", + "value": "2.0.0" } ] } @@ -175,36 +187,43 @@ { "type": "paragraph", "children": [ - { - "type": "text", - "value": "Throws " - }, { "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", - "type": "link", - "children": [ - { - "type": "text", - "value": "TypeError" - } - ] + "type": "text", + "value": "copyright" } ] }, { "type": "text", - "value": " " + "value": ": " }, { - "type": "paragraph", + "type": "root", "children": [ { - "type": "text", - "value": "if you give it something else", + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Tom MacWright", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 14, + "offset": 13 + }, + "indent": [] + } + } + ], "position": { "start": { "line": 1, @@ -213,8 +232,8 @@ }, "end": { "line": 1, - "column": 30, - "offset": 29 + "column": 14, + "offset": 13 }, "indent": [] } @@ -228,79 +247,41 @@ }, "end": { "line": 1, - "column": 30, - "offset": 29 - }, - "indent": [] + "column": 14, + "offset": 13 + } } } ] } ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " }, { - "type": "strong", + "type": "listItem", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", + "type": "paragraph", "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "license" + } + ] + }, + { + "type": "text", + "value": ": " + }, { "type": "text", - "value": "Number" + "value": "BSD" } ] } ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } } ] } diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json index e5f568279..aa98ebe77 100644 --- a/test/fixture/multisignature.output.json +++ b/test/fixture/multisignature.output.json @@ -85,7 +85,17 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "time", + "lineNumber": 13 + } + ], + "properties": [], "returns": [ { "description": { @@ -140,21 +150,18 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Date" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "getTheTime", "kind": "function", - "params": [ - { - "title": "param", - "name": "time", - "lineNumber": 13 - } - ], "members": { "instance": [], "static": [], @@ -263,9 +270,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "time", "lineNumber": 2, "description": { @@ -326,6 +336,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -380,11 +391,15 @@ } } }, + "title": "returns", "type": { "type": "UndefinedLiteral" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "getTheTime", "kind": "function", "members": { diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json index a165f7aa8..a6c7ccbc2 100644 --- a/test/fixture/multisignature.output.md.json +++ b/test/fixture/multisignature.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "getTheTime" } - ], - "data": { - "id": "getthetime", - "htmlAttributes": { - "id": "getthetime" - }, - "hProperties": { - "id": "getthetime" - } - } + ] }, { "type": "paragraph", @@ -168,16 +159,7 @@ "type": "text", "value": "getTheTime" } - ], - "data": { - "id": "getthetime-1", - "htmlAttributes": { - "id": "getthetime-1" - }, - "hProperties": { - "id": "getthetime-1" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json index 47597bfc9..9c910f9b3 100644 --- a/test/fixture/nearby_params.output.json +++ b/test/fixture/nearby_params.output.json @@ -140,11 +140,12 @@ } } }, + "augments": [], "errors": [], - "kind": "function", - "name": "sessions.create", + "examples": [], "params": [ { + "title": "param", "name": "credentials", "lineNumber": 3, "type": { @@ -153,6 +154,7 @@ }, "properties": [ { + "title": "param", "name": "credentials.name", "lineNumber": 4, "description": { @@ -281,6 +283,7 @@ } }, { + "title": "param", "name": "credentials.password", "lineNumber": 5, "description": { @@ -343,6 +346,7 @@ ] }, { + "title": "param", "name": "callback", "lineNumber": 6, "description": { @@ -440,6 +444,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -494,12 +499,18 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Promise" } } ], + "sees": [], + "throws": [], + "todos": [], + "kind": "function", + "name": "sessions.create", "members": { "instance": [], "static": [], diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json index 6ae645e8a..72fa32537 100644 --- a/test/fixture/nearby_params.output.md.json +++ b/test/fixture/nearby_params.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "sessions.create" } - ], - "data": { - "id": "sessionscreate", - "htmlAttributes": { - "id": "sessionscreate" - }, - "hProperties": { - "id": "sessionscreate" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json index 5d02dca64..d45d2b42d 100644 --- a/test/fixture/nest_params.output.json +++ b/test/fixture/nest_params.output.json @@ -78,9 +78,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "employees", "lineNumber": 1, "description": { @@ -150,6 +153,7 @@ }, "properties": [ { + "title": "param", "name": "employees[].name", "lineNumber": 2, "description": { @@ -210,6 +214,7 @@ } }, { + "title": "param", "name": "employees[].department", "lineNumber": 3, "description": { @@ -272,6 +277,7 @@ ] }, { + "title": "param", "name": "type", "lineNumber": 4, "description": { @@ -336,6 +342,11 @@ "default": "minion" } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { @@ -462,10 +473,12 @@ } } }, + "augments": [], "errors": [], - "name": "foo", + "examples": [], "params": [ { + "title": "param", "name": "options", "lineNumber": 2, "description": { @@ -526,6 +539,7 @@ }, "properties": [ { + "title": "param", "name": "options.much", "lineNumber": 3, "description": { @@ -588,6 +602,7 @@ ] }, { + "title": "param", "name": "bar", "lineNumber": 4, "description": { @@ -650,6 +665,7 @@ ], "properties": [ { + "title": "property", "name": "theTime", "lineNumber": 5, "description": { @@ -710,6 +726,7 @@ }, "properties": [ { + "title": "property", "name": "theTime.hours", "lineNumber": 6, "type": { @@ -718,6 +735,7 @@ } }, { + "title": "property", "name": "theTime.minutes", "lineNumber": 7, "type": { @@ -726,6 +744,7 @@ } }, { + "title": "property", "name": "theTime.seconds", "lineNumber": 8, "type": { @@ -790,12 +809,17 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Object" } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "foo", "members": { "instance": [], "static": [], diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json index 908d2e152..56ea626be 100644 --- a/test/fixture/nest_params.output.md.json +++ b/test/fixture/nest_params.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "strong", @@ -385,16 +376,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo-1", - "htmlAttributes": { - "id": "foo-1" - }, - "hProperties": { - "id": "foo-1" - } - } + ] }, { "type": "strong", diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json index ecdde1cca..ea76bdb60 100644 --- a/test/fixture/newline-in-description.output.json +++ b/test/fixture/newline-in-description.output.json @@ -86,13 +86,16 @@ } } }, + "augments": [], "errors": [ { "message": "could not determine @name for hierarchy" } ], + "examples": [], "params": [ { + "title": "param", "name": "a", "lineNumber": 2, "description": { @@ -159,14 +162,17 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "members": { "instance": [], "static": [], "events": [] }, - "path": [ - {} - ], - "namespace": "undefined" + "path": [], + "namespace": "" } ] \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json index a69c51af9..8d79efda6 100644 --- a/test/fixture/newline-in-description.output.md.json +++ b/test/fixture/newline-in-description.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "" } - ], - "data": { - "id": "", - "htmlAttributes": { - "id": "" - }, - "hProperties": { - "id": "" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json index 4a816852c..5bbbeaefb 100644 --- a/test/fixture/no-name.output.json +++ b/test/fixture/no-name.output.json @@ -86,13 +86,16 @@ } } }, + "augments": [], "errors": [ { "message": "could not determine @name for hierarchy" } ], + "examples": [], "params": [ { + "title": "param", "name": "bar", "lineNumber": 2, "type": { @@ -101,14 +104,17 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "members": { "instance": [], "static": [], "events": [] }, - "path": [ - {} - ], - "namespace": "undefined" + "path": [], + "namespace": "" } ] \ No newline at end of file diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json index d99370230..fb1772a02 100644 --- a/test/fixture/no-name.output.md.json +++ b/test/fixture/no-name.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "" } - ], - "data": { - "id": "", - "htmlAttributes": { - "id": "" - }, - "hProperties": { - "id": "" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json index 44f07d020..b39cb57d2 100644 --- a/test/fixture/optional-record-field-type.output.json +++ b/test/fixture/optional-record-field-type.output.json @@ -24,9 +24,10 @@ } } }, + "augments": [], "errors": [], - "name": "Record", - "kind": "typedef", + "examples": [], + "params": [], "properties": [ { "title": "property", @@ -50,6 +51,12 @@ } } ], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "Record", + "kind": "typedef", "type": { "type": "RecordType", "fields": [ diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json index a5526b9db..bb20925b8 100644 --- a/test/fixture/optional-record-field-type.output.md.json +++ b/test/fixture/optional-record-field-type.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "Record" } - ], - "data": { - "id": "record", - "htmlAttributes": { - "id": "record" - }, - "hProperties": { - "id": "record" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index 5b286ea03..ec85f63aa 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -86,9 +86,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "b", "lineNumber": 2, "description": { @@ -162,8 +165,7 @@ "title": "param", "name": "$3", "type": { - "type": "NameExpression", - "name": "Object" + "type": "AllLiteral" }, "properties": [ { @@ -184,6 +186,11 @@ ] } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "addThem", "kind": "function", "members": { @@ -286,17 +293,19 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { "title": "param", "name": "$0", "type": { - "type": "NameExpression", - "name": "Object" + "type": "AllLiteral" }, "properties": [ { + "title": "param", "name": "$0.fishes", "lineNumber": 2, "description": { @@ -364,6 +373,11 @@ ] } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "fishesAndFoxes", "kind": "function", "members": { @@ -466,9 +480,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "x", "lineNumber": 2, "type": { @@ -481,6 +498,11 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "withDefault", "kind": "function", "members": { @@ -572,7 +594,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "Foo", "kind": "class", "members": { @@ -664,9 +694,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "x", "lineNumber": 2, "description": { @@ -727,6 +760,11 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "method", "kind": "function", "memberof": "Foo", @@ -937,11 +975,16 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "Address6", + "examples": [ + { + "description": "var address = new Address6('2001::/32');" + } + ], "params": [ { + "title": "param", "name": "address", "lineNumber": 5, "description": { @@ -1002,6 +1045,7 @@ } }, { + "title": "param", "name": "groups", "lineNumber": 6, "description": { @@ -1066,6 +1110,7 @@ "default": "8" }, { + "title": "param", "name": "third", "lineNumber": 7, "description": { @@ -1130,6 +1175,7 @@ } }, { + "title": "param", "name": "foo", "lineNumber": 8, "description": { @@ -1194,11 +1240,13 @@ "default": "[1]" } ], - "examples": [ - { - "description": "var address = new Address6('2001::/32');" - } - ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "Address6", "members": { "instance": [], "static": [], @@ -1403,11 +1451,12 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "GeoJSONSource", + "examples": [], "params": [ { + "title": "param", "name": "options", "lineNumber": 5, "description": { @@ -1471,6 +1520,7 @@ }, "properties": [ { + "title": "param", "name": "options.data", "lineNumber": 6, "description": { @@ -1544,6 +1594,7 @@ } }, { + "title": "param", "name": "options.maxzoom", "lineNumber": 8, "description": { @@ -1608,6 +1659,7 @@ "default": "14" }, { + "title": "param", "name": "options.buffer", "lineNumber": 9, "description": { @@ -1671,6 +1723,7 @@ } }, { + "title": "param", "name": "options.tolerance", "lineNumber": 10, "description": { @@ -1736,6 +1789,13 @@ ] } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "GeoJSONSource", "members": { "instance": [], "static": [], @@ -1849,9 +1909,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "x", "lineNumber": 4, "description": { @@ -1916,6 +1979,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -1970,12 +2034,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "myfunc", "kind": "constant", "members": { @@ -2079,9 +2147,12 @@ } } }, + "augments": [], "errors": [], + "examples": [], "params": [ { + "title": "param", "name": "address", "lineNumber": 4, "description": { @@ -2138,6 +2209,11 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "kind": "function", "members": { diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md index eb13ec7c8..e0395b3fb 100644 --- a/test/fixture/params.output.md +++ b/test/fixture/params.output.md @@ -21,7 +21,7 @@ This function returns the number one. - `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param - `a` - `c` -- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** +- `$3` **any** - `$3.d` - `$3.e` - `$3.f` @@ -32,7 +32,7 @@ This method has partially inferred params **Parameters** -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** +- `$0` **any** - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - `$0.foxes` diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json index 3bee700c1..36439eb13 100644 --- a/test/fixture/params.output.md.json +++ b/test/fixture/params.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "addThem" } - ], - "data": { - "id": "addthem", - "htmlAttributes": { - "id": "addthem" - }, - "hProperties": { - "id": "addthem" - } - } + ] }, { "type": "paragraph", @@ -207,15 +198,8 @@ "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] + "type": "text", + "value": "any" } ] }, @@ -309,16 +293,7 @@ "type": "text", "value": "fishesAndFoxes" } - ], - "data": { - "id": "fishesandfoxes", - "htmlAttributes": { - "id": "fishesandfoxes" - }, - "hProperties": { - "id": "fishesandfoxes" - } - } + ] }, { "type": "paragraph", @@ -386,15 +361,8 @@ "type": "strong", "children": [ { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] + "type": "text", + "value": "any" } ] }, @@ -517,16 +485,7 @@ "type": "text", "value": "withDefault" } - ], - "data": { - "id": "withdefault", - "htmlAttributes": { - "id": "withdefault" - }, - "hProperties": { - "id": "withdefault" - } - } + ] }, { "type": "paragraph", @@ -632,16 +591,7 @@ "type": "text", "value": "Foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", @@ -686,16 +636,7 @@ "type": "text", "value": "method" } - ], - "data": { - "id": "method", - "htmlAttributes": { - "id": "method" - }, - "hProperties": { - "id": "method" - } - } + ] }, { "type": "paragraph", @@ -828,16 +769,7 @@ "type": "text", "value": "Address6" } - ], - "data": { - "id": "address6", - "htmlAttributes": { - "id": "address6" - }, - "hProperties": { - "id": "address6" - } - } + ] }, { "type": "paragraph", @@ -1284,16 +1216,7 @@ "type": "text", "value": "GeoJSONSource" } - ], - "data": { - "id": "geojsonsource", - "htmlAttributes": { - "id": "geojsonsource" - }, - "hProperties": { - "id": "geojsonsource" - } - } + ] }, { "type": "paragraph", @@ -1819,16 +1742,7 @@ "type": "text", "value": "myfunc" } - ], - "data": { - "id": "myfunc", - "htmlAttributes": { - "id": "myfunc" - }, - "hProperties": { - "id": "myfunc" - } - } + ] }, { "type": "paragraph", @@ -2037,16 +1951,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo-1", - "htmlAttributes": { - "id": "foo-1" - }, - "hProperties": { - "id": "foo-1" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/polyglot/blend.json b/test/fixture/polyglot/blend.json index 2e25729bf..2f77adbc8 100644 --- a/test/fixture/polyglot/blend.json +++ b/test/fixture/polyglot/blend.json @@ -102,9 +102,11 @@ }, "file": "[path]" }, - "name": "hexToUInt32Color", + "augments": [], + "examples": [], "params": [ { + "title": "param", "name": "hex", "lineNumber": 3, "type": { @@ -113,6 +115,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -167,12 +170,17 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "hexToUInt32Color", "members": { "instance": [], "static": [], diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json index 14a9f2f9e..298cf5575 100644 --- a/test/fixture/react-jsx.output.json +++ b/test/fixture/react-jsx.output.json @@ -75,7 +75,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "apples", "kind": "function", "members": { diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json index 5e8d48714..7ebe87a39 100644 --- a/test/fixture/react-jsx.output.md.json +++ b/test/fixture/react-jsx.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "apples" } - ], - "data": { - "id": "apples", - "htmlAttributes": { - "id": "apples" - }, - "hProperties": { - "id": "apples" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json index a0d7f0904..453b89139 100644 --- a/test/fixture/simple-hashbang.output.json +++ b/test/fixture/simple-hashbang.output.json @@ -85,7 +85,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -140,12 +144,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple-hashbang.input", "kind": "function", "members": { diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json index caabc796e..eea85db79 100644 --- a/test/fixture/simple-hashbang.output.md.json +++ b/test/fixture/simple-hashbang.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "simple-hashbang.input" } - ], - "data": { - "id": "simple-hashbanginput", - "htmlAttributes": { - "id": "simple-hashbanginput" - }, - "hProperties": { - "id": "simple-hashbanginput" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json index 3f98a4adb..9036ad0da 100644 --- a/test/fixture/simple-two.output.json +++ b/test/fixture/simple-two.output.json @@ -100,9 +100,16 @@ } } }, + "augments": [], "errors": [], + "examples": [ + { + "description": "var result = returnTwo(4);\n// result is 6" + } + ], "params": [ { + "title": "param", "name": "a", "lineNumber": 3, "description": { @@ -163,6 +170,7 @@ } } ], + "properties": [], "returns": [ { "description": { @@ -217,17 +225,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "Number" } } ], - "examples": [ - { - "description": "var result = returnTwo(4);\n// result is 6" - } - ], + "sees": [], + "throws": [], + "todos": [], "name": "returnTwo", "kind": "function", "members": { diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json index 71f9b4873..87999cf26 100644 --- a/test/fixture/simple-two.output.md.json +++ b/test/fixture/simple-two.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "returnTwo" } - ], - "data": { - "id": "returntwo", - "htmlAttributes": { - "id": "returntwo" - }, - "hProperties": { - "id": "returntwo" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json index 9afbbc824..14359fd38 100644 --- a/test/fixture/simple.output.github.json +++ b/test/fixture/simple.output.github.json @@ -84,10 +84,13 @@ "column": 2 } }, - "github": "[github]", - "path": "test/fixture/simple.input.js" + "github": "[github]" }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -142,12 +145,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple.input", "kind": "function", "members": { diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md index 43aadcbc9..dd84d129c 100644 --- a/test/fixture/simple.output.github.md +++ b/test/fixture/simple.output.github.md @@ -2,7 +2,7 @@ ## simple.input -[test/fixture/simple.input.js:5-8]([github] "Source code on GitHub") +[undefined:5-8](<> "Source code on GitHub") This function returns the number one. diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json index 0867306b0..5637943ad 100644 --- a/test/fixture/simple.output.json +++ b/test/fixture/simple.output.json @@ -85,7 +85,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -140,12 +144,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple.input", "kind": "function", "members": { diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json index 3413addb6..6ef343f9a 100644 --- a/test/fixture/simple.output.md.json +++ b/test/fixture/simple.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "simple.input" } - ], - "data": { - "id": "simpleinput", - "htmlAttributes": { - "id": "simpleinput" - }, - "hProperties": { - "id": "simpleinput" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json index 028a006f2..f4e2faf10 100644 --- a/test/fixture/sort-order-alpha.output.json +++ b/test/fixture/sort-order-alpha.output.json @@ -24,7 +24,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "a", "kind": "function", "members": { @@ -65,7 +73,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "b", "kind": "function", "members": { @@ -106,7 +122,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "C", "kind": "class", "members": { @@ -116,28 +140,36 @@ "tags": [], "loc": { "start": { - "line": 17, + "line": 11, "column": 2 }, "end": { - "line": 17, + "line": 11, "column": 8 } }, "context": { "loc": { "start": { - "line": 18, + "line": 12, "column": 2 }, "end": { - "line": 18, + "line": 12, "column": 8 } } }, + "augments": [], "errors": [], - "name": "A", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "b", "kind": "function", "memberof": "C", "scope": "instance", @@ -152,40 +184,48 @@ "kind": "class" }, { - "name": "A", + "name": "b", "kind": "function", "scope": "instance" } ], - "namespace": "C#A" + "namespace": "C#b" }, { "description": "", "tags": [], "loc": { "start": { - "line": 15, + "line": 13, "column": 2 }, "end": { - "line": 15, + "line": 13, "column": 8 } }, "context": { "loc": { "start": { - "line": 16, + "line": 14, "column": 2 }, "end": { - "line": 16, + "line": 14, "column": 8 } } }, + "augments": [], "errors": [], - "name": "a", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "B", "kind": "function", "memberof": "C", "scope": "instance", @@ -200,40 +240,48 @@ "kind": "class" }, { - "name": "a", + "name": "B", "kind": "function", "scope": "instance" } ], - "namespace": "C#a" + "namespace": "C#B" }, { "description": "", "tags": [], "loc": { "start": { - "line": 13, + "line": 15, "column": 2 }, "end": { - "line": 13, + "line": 15, "column": 8 } }, "context": { "loc": { "start": { - "line": 14, + "line": 16, "column": 2 }, "end": { - "line": 14, + "line": 16, "column": 8 } } }, + "augments": [], "errors": [], - "name": "B", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "a", "kind": "function", "memberof": "C", "scope": "instance", @@ -248,40 +296,48 @@ "kind": "class" }, { - "name": "B", + "name": "a", "kind": "function", "scope": "instance" } ], - "namespace": "C#B" + "namespace": "C#a" }, { "description": "", "tags": [], "loc": { "start": { - "line": 11, + "line": 17, "column": 2 }, "end": { - "line": 11, + "line": 17, "column": 8 } }, "context": { "loc": { "start": { - "line": 12, + "line": 18, "column": 2 }, "end": { - "line": 12, + "line": 18, "column": 8 } } }, + "augments": [], "errors": [], - "name": "b", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "A", "kind": "function", "memberof": "C", "scope": "instance", @@ -296,12 +352,12 @@ "kind": "class" }, { - "name": "b", + "name": "A", "kind": "function", "scope": "instance" } ], - "namespace": "C#b" + "namespace": "C#A" } ], "static": [], @@ -340,7 +396,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "D", "kind": "class", "members": { @@ -350,28 +414,36 @@ "tags": [], "loc": { "start": { - "line": 29, + "line": 23, "column": 2 }, "end": { - "line": 29, + "line": 23, "column": 8 } }, "context": { "loc": { "start": { - "line": 30, + "line": 24, "column": 2 }, "end": { - "line": 30, + "line": 24, "column": 8 } } }, + "augments": [], "errors": [], - "name": "A", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "b", "kind": "function", "memberof": "D", "scope": "instance", @@ -386,40 +458,48 @@ "kind": "class" }, { - "name": "A", + "name": "b", "kind": "function", "scope": "instance" } ], - "namespace": "D#A" + "namespace": "D#b" }, { "description": "", "tags": [], "loc": { "start": { - "line": 27, + "line": 25, "column": 2 }, "end": { - "line": 27, + "line": 25, "column": 8 } }, "context": { "loc": { "start": { - "line": 28, + "line": 26, "column": 2 }, "end": { - "line": 28, + "line": 26, "column": 8 } } }, + "augments": [], "errors": [], - "name": "a", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "B", "kind": "function", "memberof": "D", "scope": "instance", @@ -434,40 +514,48 @@ "kind": "class" }, { - "name": "a", + "name": "B", "kind": "function", "scope": "instance" } ], - "namespace": "D#a" + "namespace": "D#B" }, { "description": "", "tags": [], "loc": { "start": { - "line": 25, + "line": 27, "column": 2 }, "end": { - "line": 25, + "line": 27, "column": 8 } }, "context": { "loc": { "start": { - "line": 26, + "line": 28, "column": 2 }, "end": { - "line": 26, + "line": 28, "column": 8 } } }, + "augments": [], "errors": [], - "name": "B", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "a", "kind": "function", "memberof": "D", "scope": "instance", @@ -482,40 +570,48 @@ "kind": "class" }, { - "name": "B", + "name": "a", "kind": "function", "scope": "instance" } ], - "namespace": "D#B" + "namespace": "D#a" }, { "description": "", "tags": [], "loc": { "start": { - "line": 23, + "line": 29, "column": 2 }, "end": { - "line": 23, + "line": 29, "column": 8 } }, "context": { "loc": { "start": { - "line": 24, + "line": 30, "column": 2 }, "end": { - "line": 24, + "line": 30, "column": 8 } } }, + "augments": [], "errors": [], - "name": "b", + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "A", "kind": "function", "memberof": "D", "scope": "instance", @@ -530,12 +626,12 @@ "kind": "class" }, { - "name": "b", + "name": "A", "kind": "function", "scope": "instance" } ], - "namespace": "D#b" + "namespace": "D#A" } ], "static": [], diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md index e89a98eb7..4b6e8d21c 100644 --- a/test/fixture/sort-order-alpha.output.md +++ b/test/fixture/sort-order-alpha.output.md @@ -5,15 +5,15 @@ - [a](#a) - [b](#b) - [C](#c) - - [A](#a-1) - - [a](#a-2) - - [B](#b-1) - - [b](#b-2) + - [b](#b-1) + - [B](#b-2) + - [a](#a-1) + - [A](#a-2) - [D](#d) - - [A](#a-3) - - [a](#a-4) - - [B](#b-3) - - [b](#b-4) + - [b](#b-3) + - [B](#b-4) + - [a](#a-3) + - [A](#a-4) ## a @@ -21,20 +21,20 @@ ## C -### A - -### a +### b ### B -### b - -## D +### a ### A -### a +## D + +### b ### B -### b +### a + +### A diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json index 17ca468bb..31d018194 100644 --- a/test/fixture/sort-order-alpha.output.md.json +++ b/test/fixture/sort-order-alpha.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "a" } - ], - "data": { - "id": "a", - "htmlAttributes": { - "id": "a" - }, - "hProperties": { - "id": "a" - } - } + ] }, { "depth": 2, @@ -32,16 +23,7 @@ "type": "text", "value": "b" } - ], - "data": { - "id": "b", - "htmlAttributes": { - "id": "b" - }, - "hProperties": { - "id": "b" - } - } + ] }, { "depth": 2, @@ -51,16 +33,7 @@ "type": "text", "value": "C" } - ], - "data": { - "id": "c", - "htmlAttributes": { - "id": "c" - }, - "hProperties": { - "id": "c" - } - } + ] }, { "depth": 3, @@ -68,18 +41,9 @@ "children": [ { "type": "text", - "value": "A" - } - ], - "data": { - "id": "a-1", - "htmlAttributes": { - "id": "a-1" - }, - "hProperties": { - "id": "a-1" + "value": "b" } - } + ] }, { "depth": 3, @@ -87,18 +51,9 @@ "children": [ { "type": "text", - "value": "a" - } - ], - "data": { - "id": "a-2", - "htmlAttributes": { - "id": "a-2" - }, - "hProperties": { - "id": "a-2" + "value": "B" } - } + ] }, { "depth": 3, @@ -106,18 +61,9 @@ "children": [ { "type": "text", - "value": "B" - } - ], - "data": { - "id": "b-1", - "htmlAttributes": { - "id": "b-1" - }, - "hProperties": { - "id": "b-1" + "value": "a" } - } + ] }, { "depth": 3, @@ -125,18 +71,9 @@ "children": [ { "type": "text", - "value": "b" - } - ], - "data": { - "id": "b-2", - "htmlAttributes": { - "id": "b-2" - }, - "hProperties": { - "id": "b-2" + "value": "A" } - } + ] }, { "depth": 2, @@ -146,16 +83,7 @@ "type": "text", "value": "D" } - ], - "data": { - "id": "d", - "htmlAttributes": { - "id": "d" - }, - "hProperties": { - "id": "d" - } - } + ] }, { "depth": 3, @@ -163,18 +91,9 @@ "children": [ { "type": "text", - "value": "A" - } - ], - "data": { - "id": "a-3", - "htmlAttributes": { - "id": "a-3" - }, - "hProperties": { - "id": "a-3" + "value": "b" } - } + ] }, { "depth": 3, @@ -182,18 +101,9 @@ "children": [ { "type": "text", - "value": "a" - } - ], - "data": { - "id": "a-4", - "htmlAttributes": { - "id": "a-4" - }, - "hProperties": { - "id": "a-4" + "value": "B" } - } + ] }, { "depth": 3, @@ -201,18 +111,9 @@ "children": [ { "type": "text", - "value": "B" - } - ], - "data": { - "id": "b-3", - "htmlAttributes": { - "id": "b-3" - }, - "hProperties": { - "id": "b-3" + "value": "a" } - } + ] }, { "depth": 3, @@ -220,18 +121,9 @@ "children": [ { "type": "text", - "value": "b" - } - ], - "data": { - "id": "b-4", - "htmlAttributes": { - "id": "b-4" - }, - "hProperties": { - "id": "b-4" + "value": "A" } - } + ] } ] } \ No newline at end of file diff --git a/test/fixture/sorting/output.json b/test/fixture/sorting/output.json index 253946fe2..705f499b8 100644 --- a/test/fixture/sorting/output.json +++ b/test/fixture/sorting/output.json @@ -76,6 +76,14 @@ }, "file": "[path]" }, + "augments": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "bananas", "kind": "function", "members": { @@ -168,6 +176,14 @@ }, "file": "[path]" }, + "augments": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "carrots", "kind": "function", "members": { @@ -260,6 +276,14 @@ }, "file": "[path]" }, + "augments": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "apples", "kind": "function", "members": { diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json index 7852b17b9..f159e0ba9 100644 --- a/test/fixture/string-literal-key.output.json +++ b/test/fixture/string-literal-key.output.json @@ -31,7 +31,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "alias": "MyContainerObject", "name": "MyContainerObject", "kind": "constant", @@ -124,7 +132,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "foo", "members": { "instance": [], diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json index ad9763e10..c0bd30afe 100644 --- a/test/fixture/string-literal-key.output.md.json +++ b/test/fixture/string-literal-key.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "MyContainerObject" } - ], - "data": { - "id": "mycontainerobject", - "htmlAttributes": { - "id": "mycontainerobject" - }, - "hProperties": { - "id": "mycontainerobject" - } - } + ] }, { "depth": 2, @@ -32,16 +23,7 @@ "type": "text", "value": "foo" } - ], - "data": { - "id": "foo", - "htmlAttributes": { - "id": "foo" - }, - "hProperties": { - "id": "foo" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/sync/alias.input.js b/test/fixture/sync/alias.input.js deleted file mode 100644 index 61bd4d81f..000000000 --- a/test/fixture/sync/alias.input.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This is a method that has an alias tag: so it should - * be referred to as nixon, but should still have inference. - * @alias nixon - */ -function dewey(a: number): number { - return a; -} diff --git a/test/fixture/sync/alias.output.json b/test/fixture/sync/alias.output.json deleted file mode 100644 index 1087e5b3f..000000000 --- a/test/fixture/sync/alias.output.json +++ /dev/null @@ -1,125 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a method that has an alias tag: so it should\nbe referred to as nixon, but should still have inference.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 58, - "offset": 110 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 58, - "offset": 110 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 58, - "offset": 110 - } - } - }, - "tags": [ - { - "title": "alias", - "description": null, - "lineNumber": 3, - "name": "nixon" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "errors": [], - "alias": "nixon", - "name": "nixon", - "kind": "function", - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "returns": [ - { - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "nixon", - "kind": "function" - } - ], - "namespace": "nixon" - } -] \ No newline at end of file diff --git a/test/fixture/sync/alias.output.md b/test/fixture/sync/alias.output.md deleted file mode 100644 index a79e8dd2a..000000000 --- a/test/fixture/sync/alias.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [nixon](#nixon) - -## nixon - -This is a method that has an alias tag: so it should -be referred to as nixon, but should still have inference. - -**Parameters** - -- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** diff --git a/test/fixture/sync/alias.output.md.json b/test/fixture/sync/alias.output.md.json deleted file mode 100644 index 83aac1158..000000000 --- a/test/fixture/sync/alias.output.md.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "nixon" - } - ], - "data": { - "id": "nixon", - "htmlAttributes": { - "id": "nixon" - }, - "hProperties": { - "id": "nixon" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a method that has an alias tag: so it should\nbe referred to as nixon, but should still have inference.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 58, - "offset": 110 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 58, - "offset": 110 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/empty-example.input.js b/test/fixture/sync/empty-example.input.js deleted file mode 100644 index e0922f4ea..000000000 --- a/test/fixture/sync/empty-example.input.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * This function returns the number plus two. - * - * @example - */ -function returnTwo() { - return a + 2; -} diff --git a/test/fixture/sync/empty-example.output.json b/test/fixture/sync/empty-example.output.json deleted file mode 100644 index 787b35174..000000000 --- a/test/fixture/sync/empty-example.output.json +++ /dev/null @@ -1,105 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - } - } - }, - "tags": [ - { - "title": "example", - "description": "", - "lineNumber": 3 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "errors": [ - { - "message": "@example without code", - "commentLineNumber": 3 - } - ], - "name": "returnTwo", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "returnTwo", - "kind": "function" - } - ], - "namespace": "returnTwo" - } -] \ No newline at end of file diff --git a/test/fixture/sync/empty-example.output.md b/test/fixture/sync/empty-example.output.md deleted file mode 100644 index c5495a091..000000000 --- a/test/fixture/sync/empty-example.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [returnTwo](#returntwo) - -## returnTwo - -This function returns the number plus two. diff --git a/test/fixture/sync/empty-example.output.md.json b/test/fixture/sync/empty-example.output.md.json deleted file mode 100644 index 1e6973fe4..000000000 --- a/test/fixture/sync/empty-example.output.md.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ], - "data": { - "id": "returntwo", - "htmlAttributes": { - "id": "returntwo" - }, - "hProperties": { - "id": "returntwo" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/flow-types.input.js b/test/fixture/sync/flow-types.input.js deleted file mode 100644 index bd2e93a8f..000000000 --- a/test/fixture/sync/flow-types.input.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This function returns the number one. - */ -function addThem(a: Point, b: string, c: ?boolean, d: Array, e: Object, f: Named): number { - return a + b + c + d + e; -} - -/** - * A 2D point. - * - * @property {number} x this is a prop - */ -type Point = { - x: number, - y: number, - rgb: { - hex: string - }, - props: { - radius: { - x: number - } - } -}; - -/** - * A type with entirely derived properties - */ -type Two = { - x: number, - y: number, - z: ?number -}; - -/** - * Just an alias for an array of strings - */ -type T = Array; - -/** - * Very Important Transform - */ -function veryImportantTransform( - input: Array, - options: Object = {} -): string { - return "42"; -} - - -/** - * Function with optional parameter. - */ -function optionalFunc(x: number = 42) {} - -/** - * Function with object parameter. - */ -function objectParamFn(x: { a: number }) {} - -/** hi */ -function objectParamFn(x: (y:Foo) => Bar) {} - -/** My type */ -export type T = number; - -/** - * Define my object API - */ -export type SomeObjectAPI = { - method: (param: string) => boolean -} diff --git a/test/fixture/sync/flow-types.output.json b/test/fixture/sync/flow-types.output.json deleted file mode 100644 index 837ccd756..000000000 --- a/test/fixture/sync/flow-types.output.json +++ /dev/null @@ -1,1436 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "errors": [], - "name": "addThem", - "kind": "function", - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Point" - } - }, - { - "title": "param", - "name": "b", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "c", - "lineNumber": 4, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "boolean" - } - } - }, - { - "title": "param", - "name": "d", - "lineNumber": 4, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "number" - } - ] - } - }, - { - "title": "param", - "name": "e", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Object" - } - }, - { - "title": "param", - "name": "f", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Named" - } - } - ], - "returns": [ - { - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "addThem", - "kind": "function" - } - ], - "namespace": "addThem" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A 2D point.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [ - { - "title": "property", - "description": "this is a prop", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "errors": [], - "properties": [ - { - "name": "x", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a prop", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "y", - "lineNumber": 15, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "rgb", - "lineNumber": 16, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "hex", - "value": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - "properties": [ - { - "title": "property", - "name": "rgb.hex", - "lineNumber": 17, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - { - "title": "property", - "name": "props", - "lineNumber": 19, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "radius", - "value": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "x", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - } - ] - }, - "properties": [ - { - "title": "property", - "name": "props.radius", - "lineNumber": 20, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "x", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - }, - "properties": [ - { - "title": "property", - "name": "props.radius.x", - "lineNumber": 21, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - ] - } - ], - "name": "Point", - "kind": "typedef", - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "x", - "value": { - "type": "NameExpression", - "name": "number" - } - }, - { - "type": "FieldType", - "key": "y", - "value": { - "type": "NameExpression", - "name": "number" - } - }, - { - "type": "FieldType", - "key": "rgb", - "value": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "hex", - "value": { - "type": "NameExpression", - "name": "string" - } - } - ] - } - }, - { - "type": "FieldType", - "key": "props", - "value": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "radius", - "value": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "x", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - } - ] - } - } - ] - }, - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "Point", - "kind": "typedef" - } - ], - "namespace": "Point" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A type with entirely derived properties", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 28, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "errors": [], - "name": "Two", - "kind": "typedef", - "properties": [ - { - "title": "property", - "name": "x", - "lineNumber": 30, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "y", - "lineNumber": 31, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "z", - "lineNumber": 32, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "x", - "value": { - "type": "NameExpression", - "name": "number" - } - }, - { - "type": "FieldType", - "key": "y", - "value": { - "type": "NameExpression", - "name": "number" - } - }, - { - "type": "FieldType", - "key": "z", - "value": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ] - }, - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "Two", - "kind": "typedef" - } - ], - "namespace": "Two" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Just an alias for an array of strings", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 35, - "column": 0 - }, - "end": { - "line": 37, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 38, - "column": 0 - }, - "end": { - "line": 38, - "column": 23 - } - } - }, - "errors": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - }, - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 64, - "column": 0 - }, - "end": { - "line": 64, - "column": 14 - } - }, - "context": { - "loc": { - "start": { - "line": 65, - "column": 0 - }, - "end": { - "line": 65, - "column": 23 - } - } - }, - "errors": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "number" - }, - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Very Important Transform", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 40, - "column": 0 - }, - "end": { - "line": 42, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 43, - "column": 0 - }, - "end": { - "line": 48, - "column": 1 - } - } - }, - "errors": [], - "name": "veryImportantTransform", - "kind": "function", - "params": [ - { - "title": "param", - "name": "input", - "lineNumber": 44, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - }, - { - "title": "param", - "name": "options", - "default": "{}", - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - } - } - ], - "returns": [ - { - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "veryImportantTransform", - "kind": "function" - } - ], - "namespace": "veryImportantTransform" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Function with optional parameter.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 51, - "column": 0 - }, - "end": { - "line": 53, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 54, - "column": 0 - }, - "end": { - "line": 54, - "column": 40 - } - } - }, - "errors": [], - "name": "optionalFunc", - "kind": "function", - "params": [ - { - "title": "param", - "name": "x", - "default": "42", - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "optionalFunc", - "kind": "function" - } - ], - "namespace": "optionalFunc" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Function with object parameter.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 56, - "column": 0 - }, - "end": { - "line": 58, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 59, - "column": 0 - }, - "end": { - "line": 59, - "column": 43 - } - } - }, - "errors": [], - "name": "objectParamFn", - "kind": "function", - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 59, - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "a", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "objectParamFn", - "kind": "function" - } - ], - "namespace": "objectParamFn" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "hi", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 9 - } - }, - "context": { - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 62, - "column": 44 - } - } - }, - "errors": [], - "name": "objectParamFn", - "kind": "function", - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 62, - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "y", - "expression": { - "type": "NameExpression", - "name": "Foo" - } - } - ], - "result": { - "type": "NameExpression", - "name": "Bar" - } - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "objectParamFn", - "kind": "function" - } - ], - "namespace": "objectParamFn" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Define my object API", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 67, - "column": 0 - }, - "end": { - "line": 69, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 70, - "column": 0 - }, - "end": { - "line": 72, - "column": 1 - } - } - }, - "errors": [], - "name": "SomeObjectAPI", - "kind": "typedef", - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "method", - "value": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "param", - "expression": { - "type": "NameExpression", - "name": "string" - } - } - ], - "result": { - "type": "NameExpression", - "name": "boolean" - } - } - } - ] - }, - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "SomeObjectAPI", - "kind": "typedef" - } - ], - "namespace": "SomeObjectAPI" - } -] \ No newline at end of file diff --git a/test/fixture/sync/flow-types.output.md b/test/fixture/sync/flow-types.output.md deleted file mode 100644 index 3bd1e27db..000000000 --- a/test/fixture/sync/flow-types.output.md +++ /dev/null @@ -1,110 +0,0 @@ - - -### Table of Contents - -- [addThem](#addthem) -- [Point](#point) -- [Two](#two) -- [T](#t) -- [T](#t-1) -- [veryImportantTransform](#veryimportanttransform) -- [optionalFunc](#optionalfunc) -- [objectParamFn](#objectparamfn) -- [objectParamFn](#objectparamfn-1) -- [SomeObjectAPI](#someobjectapi) - -## addThem - -This function returns the number one. - -**Parameters** - -- `a` **[Point](#point)** -- `b` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** -- `c` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** -- `d` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** -- `e` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** -- `f` **Named** - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -## Point - -A 2D point. - -Type: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), y: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), rgb: {hex: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}, props: {radius: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}}} - -**Properties** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** this is a prop -- `y` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `rgb` **{hex: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)}** - - `rgb.hex` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** -- `props` **{radius: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}}** - - `props.radius` **{x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}** - - `props.radius.x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -## Two - -A type with entirely derived properties - -Type: {x: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), y: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), z: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?} - -**Properties** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `y` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `z` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** - -## T - -Just an alias for an array of strings - -Type: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> - -## T - -My type - -Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) - -## veryImportantTransform - -Very Important Transform - -**Parameters** - -- `input` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) - -Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -## optionalFunc - -Function with optional parameter. - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (optional, default `42`) - -## objectParamFn - -Function with object parameter. - -**Parameters** - -- `x` **{a: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}** - -## objectParamFn - -hi - -**Parameters** - -- `x` **function (y: Foo): Bar** - -## SomeObjectAPI - -Define my object API - -Type: {method: function (param: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)} diff --git a/test/fixture/sync/flow-types.output.md.json b/test/fixture/sync/flow-types.output.md.json deleted file mode 100644 index 380be908e..000000000 --- a/test/fixture/sync/flow-types.output.md.json +++ /dev/null @@ -1,2034 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ], - "data": { - "id": "addthem", - "htmlAttributes": { - "id": "addthem" - }, - "hProperties": { - "id": "addthem" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "#point", - "url": "#point", - "type": "link", - "children": [ - { - "type": "text", - "value": "Point" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Named" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Point" - } - ], - "data": { - "id": "point", - "htmlAttributes": { - "id": "point" - }, - "hProperties": { - "id": "point" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A 2D point.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "x: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "y: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "rgb: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "hex: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": "}" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "props: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "radius: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "x: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - }, - { - "type": "text", - "value": "}" - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a prop", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "y" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "rgb" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "hex: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "rgb.hex" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "props" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "radius: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "x: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "props.radius" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "x: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "props.radius.x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Two" - } - ], - "data": { - "id": "two", - "htmlAttributes": { - "id": "two" - }, - "hProperties": { - "id": "two" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A type with entirely derived properties", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "x: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "y: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "z: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "y" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "z" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ], - "data": { - "id": "t", - "htmlAttributes": { - "id": "t" - }, - "hProperties": { - "id": "t" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Just an alias for an array of strings", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ], - "data": { - "id": "t-1", - "htmlAttributes": { - "id": "t-1" - }, - "hProperties": { - "id": "t-1" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ], - "data": { - "id": "veryimportanttransform", - "htmlAttributes": { - "id": "veryimportanttransform" - }, - "hProperties": { - "id": "veryimportanttransform" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Very Important Transform", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "optionalFunc" - } - ], - "data": { - "id": "optionalfunc", - "htmlAttributes": { - "id": "optionalfunc" - }, - "hProperties": { - "id": "optionalfunc" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Function with optional parameter.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "42" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "objectParamFn" - } - ], - "data": { - "id": "objectparamfn", - "htmlAttributes": { - "id": "objectparamfn" - }, - "hProperties": { - "id": "objectparamfn" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Function with object parameter.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "a: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "objectParamFn" - } - ], - "data": { - "id": "objectparamfn-1", - "htmlAttributes": { - "id": "objectparamfn-1" - }, - "hProperties": { - "id": "objectparamfn-1" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "hi", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "y: " - }, - { - "type": "text", - "value": "Foo" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "Bar" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "SomeObjectAPI" - } - ], - "data": { - "id": "someobjectapi", - "htmlAttributes": { - "id": "someobjectapi" - }, - "hProperties": { - "id": "someobjectapi" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Define my object API", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "method: " - }, - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "param: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/lots-of-options.input.js b/test/fixture/sync/lots-of-options.input.js deleted file mode 100644 index c9f32290e..000000000 --- a/test/fixture/sync/lots-of-options.input.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Global spectra deconvolution - * @param {Array} x - Independent variable - * @param {Array} yIn - Dependent variable - * @param {Object} [options] - Options object - * @param {Object} [options.sgOptions] - Options object for Savitzky-Golay filter. See https://github.com/mljs/savitzky-golay-generalized#options - * @param {Number} [options.minMaxRatio = 0.00025] - Threshold to determine if a given peak should be considered as a noise - * @param {Number} [options.broadRatio = 0.00] - If `broadRatio` is higher than 0, then all the peaks which second derivative - * smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true. - * @param {Number} [options.noiseLevel = 3] - Noise threshold in spectrum units - * @param {Boolean} [options.maxCriteria = true] - Peaks are local maximum(true) or minimum(false) - * @param {Boolean} [options.smoothY = true] - Select the peak intensities from a smoothed version of the independent variables - * @param {Boolean} [options.realTopDetection = false] - Use a quadratic optimizations with the peak and its 3 closest neighbors - * to determine the true x,y values of the peak? - * @param {Number} [options.heightFactor = 0] - Factor to multiply the calculated height (usually 2) - * @param {Boolean} [options.boundaries = false] - Return also the inflection points of the peaks - * @param {Number} [options.derivativeThreshold = 0] - Filters based on the amplitude of the first derivative - * @return {Array} - */ -function gsd(x, yIn, options) { -} - -module.exports = gsd; diff --git a/test/fixture/sync/lots-of-options.output.json b/test/fixture/sync/lots-of-options.output.json deleted file mode 100644 index 96d3f4a99..000000000 --- a/test/fixture/sync/lots-of-options.output.json +++ /dev/null @@ -1,1293 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Global spectra deconvolution", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [ - { - "title": "param", - "description": "Independent variable", - "lineNumber": 2, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "x" - }, - { - "title": "param", - "description": "Dependent variable", - "lineNumber": 3, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "yIn" - }, - { - "title": "param", - "description": "Options object", - "lineNumber": 4, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "name": "options" - }, - { - "title": "param", - "description": "Options object for Savitzky-Golay filter. See https://github.com/mljs/savitzky-golay-generalized#options", - "lineNumber": 5, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "name": "options.sgOptions" - }, - { - "title": "param", - "description": "Threshold to determine if a given peak should be considered as a noise", - "lineNumber": 6, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "name": "options.minMaxRatio", - "default": "0.00025" - }, - { - "title": "param", - "description": "If `broadRatio` is higher than 0, then all the peaks which second derivative\nsmaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.", - "lineNumber": 7, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "name": "options.broadRatio", - "default": "0.00" - }, - { - "title": "param", - "description": "Noise threshold in spectrum units", - "lineNumber": 9, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "name": "options.noiseLevel", - "default": "3" - }, - { - "title": "param", - "description": "Peaks are local maximum(true) or minimum(false)", - "lineNumber": 10, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "name": "options.maxCriteria", - "default": "true" - }, - { - "title": "param", - "description": "Select the peak intensities from a smoothed version of the independent variables", - "lineNumber": 11, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "name": "options.smoothY", - "default": "true" - }, - { - "title": "param", - "description": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?", - "lineNumber": 12, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "name": "options.realTopDetection", - "default": "false" - }, - { - "title": "param", - "description": "Factor to multiply the calculated height (usually 2)", - "lineNumber": 14, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "name": "options.heightFactor", - "default": "0" - }, - { - "title": "param", - "description": "Return also the inflection points of the peaks", - "lineNumber": 15, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "name": "options.boundaries", - "default": "false" - }, - { - "title": "param", - "description": "Filters based on the amplitude of the first derivative", - "lineNumber": 16, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "name": "options.derivativeThreshold", - "default": "0" - }, - { - "title": "return", - "description": null, - "lineNumber": 17, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 19, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - } - }, - "errors": [], - "params": [ - { - "name": "x", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Independent variable", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "name": "yIn", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Dependent variable", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "name": "options", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "properties": [ - { - "name": "options.sgOptions", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Options object for Savitzky-Golay filter. See ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - }, - { - "type": "link", - "title": null, - "url": "https://github.com/mljs/savitzky-golay-generalized#options", - "children": [ - { - "type": "text", - "value": "https://github.com/mljs/savitzky-golay-generalized#options", - "position": { - "start": { - "line": 1, - "column": 47, - "offset": 46 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 47, - "offset": 46 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - } - }, - { - "name": "options.minMaxRatio", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Threshold to determine if a given peak should be considered as a noise", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 71, - "offset": 70 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 71, - "offset": 70 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 71, - "offset": 70 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "default": "0.00025" - }, - { - "name": "options.broadRatio", - "lineNumber": 7, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "If ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "broadRatio", - "position": { - "start": { - "line": 1, - "column": 4, - "offset": 3 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " is higher than 0, then all the peaks which second derivative\nsmaller than ", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 2, - "column": 14, - "offset": 90 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "inlineCode", - "value": "broadRatio * maxAbsSecondDerivative", - "position": { - "start": { - "line": 2, - "column": 14, - "offset": 90 - }, - "end": { - "line": 2, - "column": 51, - "offset": 127 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " will be marked with the soft mask equal to true.", - "position": { - "start": { - "line": 2, - "column": 51, - "offset": 127 - }, - "end": { - "line": 2, - "column": 100, - "offset": 176 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 100, - "offset": 176 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 100, - "offset": 176 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "default": "0.00" - }, - { - "name": "options.noiseLevel", - "lineNumber": 9, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Noise threshold in spectrum units", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "default": "3" - }, - { - "name": "options.maxCriteria", - "lineNumber": 10, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Peaks are local maximum(true) or minimum(false)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "default": "true" - }, - { - "name": "options.smoothY", - "lineNumber": 11, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Select the peak intensities from a smoothed version of the independent variables", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 81, - "offset": 80 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 81, - "offset": 80 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 81, - "offset": 80 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "default": "true" - }, - { - "name": "options.realTopDetection", - "lineNumber": 12, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 46, - "offset": 117 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 46, - "offset": 117 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 46, - "offset": 117 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "default": "false" - }, - { - "name": "options.heightFactor", - "lineNumber": 14, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Factor to multiply the calculated height (usually 2)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "default": "0" - }, - { - "name": "options.boundaries", - "lineNumber": 15, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Return also the inflection points of the peaks", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Boolean" - } - }, - "default": "false" - }, - { - "name": "options.derivativeThreshold", - "lineNumber": 16, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Filters based on the amplitude of the first derivative", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Number" - } - }, - "default": "0" - } - ] - } - ], - "returns": [ - { - "description": { - "type": "root", - "children": [], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 1, - "offset": 0 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - } - } - ], - "name": "gsd", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "gsd", - "kind": "function" - } - ], - "namespace": "gsd" - } -] \ No newline at end of file diff --git a/test/fixture/sync/lots-of-options.output.md b/test/fixture/sync/lots-of-options.output.md deleted file mode 100644 index 11594ccc3..000000000 --- a/test/fixture/sync/lots-of-options.output.md +++ /dev/null @@ -1,29 +0,0 @@ - - -### Table of Contents - -- [gsd](#gsd) - -## gsd - -Global spectra deconvolution - -**Parameters** - -- `x` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Independent variable -- `yIn` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** Dependent variable -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options object - - `options.sgOptions` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Options object for Savitzky-Golay filter. See - - `options.minMaxRatio` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Threshold to determine if a given peak should be considered as a noise (optional, default `0.00025`) - - `options.broadRatio` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** If `broadRatio` is higher than 0, then all the peaks which second derivative - smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true. (optional, default `0.00`) - - `options.noiseLevel` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Noise threshold in spectrum units (optional, default `3`) - - `options.maxCriteria` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Peaks are local maximum(true) or minimum(false) (optional, default `true`) - - `options.smoothY` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Select the peak intensities from a smoothed version of the independent variables (optional, default `true`) - - `options.realTopDetection` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Use a quadratic optimizations with the peak and its 3 closest neighbors - to determine the true x,y values of the peak? (optional, default `false`) - - `options.heightFactor` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Factor to multiply the calculated height (usually 2) (optional, default `0`) - - `options.boundaries` **[Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Return also the inflection points of the peaks (optional, default `false`) - - `options.derivativeThreshold` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Filters based on the amplitude of the first derivative (optional, default `0`) - -Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** diff --git a/test/fixture/sync/lots-of-options.output.md.json b/test/fixture/sync/lots-of-options.output.md.json deleted file mode 100644 index b014acdda..000000000 --- a/test/fixture/sync/lots-of-options.output.md.json +++ /dev/null @@ -1,1429 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "gsd" - } - ], - "data": { - "id": "gsd", - "htmlAttributes": { - "id": "gsd" - }, - "hProperties": { - "id": "gsd" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Global spectra deconvolution", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Independent variable", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "yIn" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Dependent variable", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.sgOptions" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Options object for Savitzky-Golay filter. See ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - }, - { - "type": "link", - "title": null, - "url": "https://github.com/mljs/savitzky-golay-generalized#options", - "children": [ - { - "type": "text", - "value": "https://github.com/mljs/savitzky-golay-generalized#options", - "position": { - "start": { - "line": 1, - "column": 47, - "offset": 46 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 47, - "offset": 46 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 105, - "offset": 104 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.minMaxRatio" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Threshold to determine if a given peak should be considered as a noise", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 71, - "offset": 70 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 71, - "offset": 70 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "0.00025" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.broadRatio" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "If ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "broadRatio", - "position": { - "start": { - "line": 1, - "column": 4, - "offset": 3 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " is higher than 0, then all the peaks which second derivative\nsmaller than ", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 2, - "column": 14, - "offset": 90 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "inlineCode", - "value": "broadRatio * maxAbsSecondDerivative", - "position": { - "start": { - "line": 2, - "column": 14, - "offset": 90 - }, - "end": { - "line": 2, - "column": 51, - "offset": 127 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " will be marked with the soft mask equal to true.", - "position": { - "start": { - "line": 2, - "column": 51, - "offset": 127 - }, - "end": { - "line": 2, - "column": 100, - "offset": 176 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 100, - "offset": 176 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "0.00" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.noiseLevel" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Noise threshold in spectrum units", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "3" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.maxCriteria" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "Boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Peaks are local maximum(true) or minimum(false)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "true" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.smoothY" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "Boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Select the peak intensities from a smoothed version of the independent variables", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 81, - "offset": 80 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 81, - "offset": 80 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "true" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.realTopDetection" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "Boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Use a quadratic optimizations with the peak and its 3 closest neighbors\nto determine the true x,y values of the peak?", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 46, - "offset": 117 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 46, - "offset": 117 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "false" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.heightFactor" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Factor to multiply the calculated height (usually 2)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.boundaries" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "Boolean" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Return also the inflection points of the peaks", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 47, - "offset": 46 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "false" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.derivativeThreshold" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Filters based on the amplitude of the first derivative", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/meta.input.js b/test/fixture/sync/meta.input.js deleted file mode 100644 index 9718fbee9..000000000 --- a/test/fixture/sync/meta.input.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * This function has a lot of metadata - * @version 1.2.0 - * @author Jim Jones - * @copyright John Jones - * @since 1962 - * @license Public Domain - */ -function dewey(a) { - return a; -} diff --git a/test/fixture/sync/meta.output.json b/test/fixture/sync/meta.output.json deleted file mode 100644 index cdd66e0fc..000000000 --- a/test/fixture/sync/meta.output.json +++ /dev/null @@ -1,183 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function has a lot of metadata", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - } - } - }, - "tags": [ - { - "title": "version", - "description": "1.2.0", - "lineNumber": 2 - }, - { - "title": "author", - "description": "Jim Jones", - "lineNumber": 3 - }, - { - "title": "copyright", - "description": "John Jones", - "lineNumber": 4 - }, - { - "title": "since", - "description": "1962", - "lineNumber": 5 - }, - { - "title": "license", - "description": "Public Domain", - "lineNumber": 6 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - } - }, - "errors": [], - "version": "1.2.0", - "author": "Jim Jones", - "copyright": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "John Jones", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "since": "1962", - "license": "Public Domain", - "name": "dewey", - "kind": "function", - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 9 - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "dewey", - "kind": "function" - } - ], - "namespace": "dewey" - } -] \ No newline at end of file diff --git a/test/fixture/sync/meta.output.md b/test/fixture/sync/meta.output.md deleted file mode 100644 index 817bb6a52..000000000 --- a/test/fixture/sync/meta.output.md +++ /dev/null @@ -1,21 +0,0 @@ - - -### Table of Contents - -- [dewey](#dewey) - -## dewey - -This function has a lot of metadata - -**Parameters** - -- `a` - -**Meta** - -- **version**: 1.2.0 -- **since**: 1962 -- **copyright**: \[object Object] -- **author**: Jim Jones -- **license**: Public Domain diff --git a/test/fixture/sync/meta.output.md.json b/test/fixture/sync/meta.output.md.json deleted file mode 100644 index 3302e7e02..000000000 --- a/test/fixture/sync/meta.output.md.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "dewey" - } - ], - "data": { - "id": "dewey", - "htmlAttributes": { - "id": "dewey" - }, - "hProperties": { - "id": "dewey" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function has a lot of metadata", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Meta" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "version" - } - ] - }, - { - "type": "text", - "value": ": 1.2.0" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "since" - } - ] - }, - { - "type": "text", - "value": ": 1962" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "copyright" - } - ] - }, - { - "type": "text", - "value": ": [object Object]" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "author" - } - ] - }, - { - "type": "text", - "value": ": Jim Jones" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "license" - } - ] - }, - { - "type": "text", - "value": ": Public Domain" - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/multiexample.input.js b/test/fixture/sync/multiexample.input.js deleted file mode 100644 index 88227f4df..000000000 --- a/test/fixture/sync/multiexample.input.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * This function returns the number one. - * @returns {Number} numberone - * @example - * foo(1); - * @example - * foo(2); - * @throws {Error} if you give it something - * @throws {TypeError} if you give it something else - * @augments Foo - * @augments Bar - */ -module.exports = function () { - // this returns 1 - return 1; -}; diff --git a/test/fixture/sync/multiexample.output.json b/test/fixture/sync/multiexample.output.json deleted file mode 100644 index f9ee47492..000000000 --- a/test/fixture/sync/multiexample.output.json +++ /dev/null @@ -1,348 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "example", - "description": "foo(1);", - "lineNumber": 3 - }, - { - "title": "example", - "description": "foo(2);", - "lineNumber": 5 - }, - { - "title": "throws", - "description": "if you give it something", - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "Error" - } - }, - { - "title": "throws", - "description": "if you give it something else", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "TypeError" - } - }, - { - "title": "augments", - "description": null, - "lineNumber": 9, - "type": null, - "name": "Foo" - }, - { - "title": "augments", - "description": null, - "lineNumber": 10, - "type": null, - "name": "Bar" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "errors": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "examples": [ - { - "description": "foo(1);" - }, - { - "description": "foo(2);" - } - ], - "throws": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "if you give it something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Error" - } - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "if you give it something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 30, - "offset": 29 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 30, - "offset": 29 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 30, - "offset": 29 - } - } - }, - "type": { - "type": "NameExpression", - "name": "TypeError" - } - } - ], - "augments": [ - { - "title": "augments", - "description": null, - "lineNumber": 9, - "type": null, - "name": "Foo" - }, - { - "title": "augments", - "description": null, - "lineNumber": 10, - "type": null, - "name": "Bar" - } - ], - "name": "multiexample.input", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "multiexample.input", - "kind": "function" - } - ], - "namespace": "multiexample.input" - } -] \ No newline at end of file diff --git a/test/fixture/sync/multiexample.output.md b/test/fixture/sync/multiexample.output.md deleted file mode 100644 index 01a6fe6db..000000000 --- a/test/fixture/sync/multiexample.output.md +++ /dev/null @@ -1,26 +0,0 @@ - - -### Table of Contents - -- [multiexample.input](#multiexampleinput) - -## multiexample.input - -**Extends Foo, Bar** - -This function returns the number one. - -**Examples** - -```javascript -foo(1); -``` - -```javascript -foo(2); -``` - -- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if you give it something -- Throws **[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** if you give it something else - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/sync/rename.input.js b/test/fixture/sync/rename.input.js deleted file mode 100644 index 16599b811..000000000 --- a/test/fixture/sync/rename.input.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Cheesoid! - * @name cheese - */ -function petrol(): string { -} diff --git a/test/fixture/sync/rename.output.json b/test/fixture/sync/rename.output.json deleted file mode 100644 index 102ddfa12..000000000 --- a/test/fixture/sync/rename.output.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Cheesoid!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "tags": [ - { - "title": "name", - "description": null, - "lineNumber": 2, - "name": "cheese" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "errors": [], - "name": "cheese", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "cheese" - } - ], - "namespace": "cheese" - } -] \ No newline at end of file diff --git a/test/fixture/sync/rename.output.md b/test/fixture/sync/rename.output.md deleted file mode 100644 index 9e9ce7fc2..000000000 --- a/test/fixture/sync/rename.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [cheese](#cheese) - -## cheese - -Cheesoid! diff --git a/test/fixture/sync/rename.output.md.json b/test/fixture/sync/rename.output.md.json deleted file mode 100644 index 5fd911ea9..000000000 --- a/test/fixture/sync/rename.output.md.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "cheese" - } - ], - "data": { - "id": "cheese", - "htmlAttributes": { - "id": "cheese" - }, - "hProperties": { - "id": "cheese" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Cheesoid!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/throws.input.js b/test/fixture/sync/throws.input.js deleted file mode 100644 index 690c20783..000000000 --- a/test/fixture/sync/throws.input.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This function returns the number plus two. - * - * @param {Number} a the number - * @returns {Number} numbertwo - * @throws {Error} if number is 3 - * @example - * var result = returnTwo(4); - * // result is 6 - */ -function returnTwo(a) { - if (a === 3) throw new Error('cannot be 3'); - // this returns a + 2 - return a + 2; -} diff --git a/test/fixture/sync/throws.output.json b/test/fixture/sync/throws.output.json deleted file mode 100644 index a3657f0d1..000000000 --- a/test/fixture/sync/throws.output.json +++ /dev/null @@ -1,315 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the number", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "numbertwo", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "throws", - "description": "if number is 3", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "Error" - } - }, - { - "title": "example", - "description": "var result = returnTwo(4);\n// result is 6", - "lineNumber": 6 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 15, - "column": 1 - } - } - }, - "errors": [], - "params": [ - { - "name": "a", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "throws": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "if number is 3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Error" - } - } - ], - "examples": [ - { - "description": "var result = returnTwo(4);\n// result is 6" - } - ], - "name": "returnTwo", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "returnTwo", - "kind": "function" - } - ], - "namespace": "returnTwo" - } -] \ No newline at end of file diff --git a/test/fixture/sync/throws.output.md b/test/fixture/sync/throws.output.md deleted file mode 100644 index 379677656..000000000 --- a/test/fixture/sync/throws.output.md +++ /dev/null @@ -1,24 +0,0 @@ - - -### Table of Contents - -- [returnTwo](#returntwo) - -## returnTwo - -This function returns the number plus two. - -**Parameters** - -- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number - -**Examples** - -```javascript -var result = returnTwo(4); -// result is 6 -``` - -- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if number is 3 - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numbertwo diff --git a/test/fixture/sync/throws.output.md.json b/test/fixture/sync/throws.output.md.json deleted file mode 100644 index 9cfcf897b..000000000 --- a/test/fixture/sync/throws.output.md.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ], - "data": { - "id": "returntwo", - "htmlAttributes": { - "id": "returntwo" - }, - "hProperties": { - "id": "returntwo" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "var result = returnTwo(4);\n// result is 6" - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Throws " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", - "type": "link", - "children": [ - { - "type": "text", - "value": "Error" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "if number is 3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/trailing-only.input.js b/test/fixture/sync/trailing-only.input.js deleted file mode 100644 index b2571bd84..000000000 --- a/test/fixture/sync/trailing-only.input.js +++ /dev/null @@ -1,7 +0,0 @@ -function fooBaz() { - return 2; -} -/** - * this is a type - * @returns {number} nothing - */ diff --git a/test/fixture/sync/trailing-only.output.json b/test/fixture/sync/trailing-only.output.json deleted file mode 100644 index cb71c4fea..000000000 --- a/test/fixture/sync/trailing-only.output.json +++ /dev/null @@ -1,163 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "nothing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - } - }, - "errors": [ - { - "message": "could not determine @name for hierarchy" - } - ], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - {} - ], - "namespace": "undefined" - } -] \ No newline at end of file diff --git a/test/fixture/sync/trailing-only.output.md b/test/fixture/sync/trailing-only.output.md deleted file mode 100644 index 63511b984..000000000 --- a/test/fixture/sync/trailing-only.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -## - -this is a type - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** nothing diff --git a/test/fixture/sync/trailing-only.output.md.json b/test/fixture/sync/trailing-only.output.md.json deleted file mode 100644 index 4e76f746d..000000000 --- a/test/fixture/sync/trailing-only.output.md.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "" - } - ], - "data": { - "id": "", - "htmlAttributes": { - "id": "" - }, - "hProperties": { - "id": "" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/trailing.input.js b/test/fixture/sync/trailing.input.js deleted file mode 100644 index 5e11b97c0..000000000 --- a/test/fixture/sync/trailing.input.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * ONE - * @returns {number} something - */ -function fooBar() { - return 1; -} -/** - * TWO - * @returns {number} something - */ -function fooBaz() { - return 2; -} -/** - * this is a type - * @class Something - */ diff --git a/test/fixture/sync/trailing.output.json b/test/fixture/sync/trailing.output.json deleted file mode 100644 index b5937fcb5..000000000 --- a/test/fixture/sync/trailing.output.json +++ /dev/null @@ -1,426 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "ONE", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "something", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - } - }, - "errors": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "name": "fooBar", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "fooBar", - "kind": "function" - } - ], - "namespace": "fooBar" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TWO", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "something", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 11, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "errors": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "name": "fooBaz", - "kind": "function", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "fooBaz", - "kind": "function" - } - ], - "namespace": "fooBaz" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "Something" - } - ], - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 18, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "errors": [], - "kind": "class", - "name": "Something", - "members": { - "instance": [], - "static": [], - "events": [] - }, - "path": [ - { - "name": "Something", - "kind": "class" - } - ], - "namespace": "Something" - } -] \ No newline at end of file diff --git a/test/fixture/sync/trailing.output.md b/test/fixture/sync/trailing.output.md deleted file mode 100644 index 1848b96a3..000000000 --- a/test/fixture/sync/trailing.output.md +++ /dev/null @@ -1,23 +0,0 @@ - - -### Table of Contents - -- [fooBar](#foobar) -- [fooBaz](#foobaz) -- [Something](#something) - -## fooBar - -ONE - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something - -## fooBaz - -TWO - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something - -## Something - -this is a type diff --git a/test/fixture/sync/trailing.output.md.json b/test/fixture/sync/trailing.output.md.json deleted file mode 100644 index 4e5a2e4f2..000000000 --- a/test/fixture/sync/trailing.output.md.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fooBar" - } - ], - "data": { - "id": "foobar", - "htmlAttributes": { - "id": "foobar" - }, - "hProperties": { - "id": "foobar" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "ONE", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fooBaz" - } - ], - "data": { - "id": "foobaz", - "htmlAttributes": { - "id": "foobaz" - }, - "hProperties": { - "id": "foobaz" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TWO", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 4, - "offset": 3 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Something" - } - ], - "data": { - "id": "something", - "htmlAttributes": { - "id": "something" - }, - "hProperties": { - "id": "something" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "this is a type", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/sync/typedef.input.js b/test/fixture/sync/typedef.input.js deleted file mode 100644 index 2747c8de7..000000000 --- a/test/fixture/sync/typedef.input.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * A type definition. - * @name MyType - * @typedef {Object} MyType - * @property {number} prop1 - one property - * @property {string} prop2 - another property - */ - diff --git a/test/fixture/sync/typedef.output.md b/test/fixture/sync/typedef.output.md deleted file mode 100644 index 01f5eede6..000000000 --- a/test/fixture/sync/typedef.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [MyType](#mytype) - -## MyType - -A type definition. - -Type: [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - -**Properties** - -- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** one property -- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** another property diff --git a/test/fixture/sync/typedef.output.md.json b/test/fixture/sync/typedef.output.md.json deleted file mode 100644 index f898cfac4..000000000 --- a/test/fixture/sync/typedef.output.md.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyType" - } - ], - "data": { - "id": "mytype", - "htmlAttributes": { - "id": "mytype" - }, - "hProperties": { - "id": "mytype" - } - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A type definition.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "one property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "another property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json index 0867306b0..5637943ad 100644 --- a/test/fixture/system-import.output.json +++ b/test/fixture/system-import.output.json @@ -85,7 +85,11 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], "returns": [ { "description": { @@ -140,12 +144,16 @@ } } }, + "title": "returns", "type": { "type": "NameExpression", "name": "number" } } ], + "sees": [], + "throws": [], + "todos": [], "name": "simple.input", "kind": "function", "members": { diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json index 3413addb6..6ef343f9a 100644 --- a/test/fixture/system-import.output.md.json +++ b/test/fixture/system-import.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "simple.input" } - ], - "data": { - "id": "simpleinput", - "htmlAttributes": { - "id": "simpleinput" - }, - "hProperties": { - "id": "simpleinput" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json index c2fbb41fd..6441556d2 100644 --- a/test/fixture/this-class.output.json +++ b/test/fixture/this-class.output.json @@ -32,9 +32,9 @@ } } }, + "augments": [], "errors": [], - "kind": "module", - "name": "bookshelf", + "examples": [], "params": [ { "title": "param", @@ -42,6 +42,13 @@ "lineNumber": 4 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "module", + "name": "bookshelf", "members": { "instance": [], "static": [], @@ -87,9 +94,9 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "Book", + "examples": [], "params": [ { "title": "param", @@ -97,6 +104,13 @@ "lineNumber": 4 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "Book", "members": { "instance": [ { @@ -175,7 +189,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "title", "memberof": "Book", "scope": "instance", @@ -240,9 +262,9 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "BookShelf", + "examples": [], "params": [ { "title": "param", @@ -250,6 +272,13 @@ "lineNumber": 10 } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "BookShelf", "members": { "instance": [ { @@ -328,7 +357,15 @@ } } }, + "augments": [], "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], "name": "title", "memberof": "BookShelf", "scope": "instance", diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json index 63cc89d71..e7b15ff40 100644 --- a/test/fixture/this-class.output.md.json +++ b/test/fixture/this-class.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "bookshelf" } - ], - "data": { - "id": "bookshelf", - "htmlAttributes": { - "id": "bookshelf" - }, - "hProperties": { - "id": "bookshelf" - } - } + ] }, { "type": "strong", @@ -69,16 +60,7 @@ "type": "text", "value": "Book" } - ], - "data": { - "id": "book", - "htmlAttributes": { - "id": "book" - }, - "hProperties": { - "id": "book" - } - } + ] }, { "type": "strong", @@ -125,16 +107,7 @@ "type": "text", "value": "title" } - ], - "data": { - "id": "title", - "htmlAttributes": { - "id": "title" - }, - "hProperties": { - "id": "title" - } - } + ] }, { "type": "paragraph", @@ -179,16 +152,7 @@ "type": "text", "value": "BookShelf" } - ], - "data": { - "id": "bookshelf-1", - "htmlAttributes": { - "id": "bookshelf-1" - }, - "hProperties": { - "id": "bookshelf-1" - } - } + ] }, { "type": "strong", @@ -235,16 +199,7 @@ "type": "text", "value": "title" } - ], - "data": { - "id": "title-1", - "htmlAttributes": { - "id": "title-1" - }, - "hProperties": { - "id": "title-1" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json index ce4194e12..50d5dcb33 100644 --- a/test/fixture/type_application.output.json +++ b/test/fixture/type_application.output.json @@ -102,11 +102,12 @@ } } }, + "augments": [], "errors": [], - "kind": "class", - "name": "Address6", + "examples": [], "params": [ { + "title": "param", "name": "address", "lineNumber": 3, "description": { @@ -176,6 +177,13 @@ } } ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "Address6", "members": { "instance": [], "static": [], diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json index 8b378fa26..a77cd28e9 100644 --- a/test/fixture/type_application.output.md.json +++ b/test/fixture/type_application.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "Address6" } - ], - "data": { - "id": "address6", - "htmlAttributes": { - "id": "address6" - }, - "hProperties": { - "id": "address6" - } - } + ] }, { "type": "paragraph", diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json index 6e5959cb4..66d9c42c1 100644 --- a/test/fixture/var-function-param-return.output.json +++ b/test/fixture/var-function-param-return.output.json @@ -24,9 +24,9 @@ } } }, + "augments": [], "errors": [], - "name": "f", - "kind": "function", + "examples": [], "params": [ { "title": "param", @@ -38,14 +38,21 @@ } } ], + "properties": [], "returns": [ { + "title": "returns", "type": { "type": "NameExpression", "name": "boolean" } } ], + "sees": [], + "throws": [], + "todos": [], + "name": "f", + "kind": "function", "members": { "instance": [], "static": [], diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json index 205b981b9..cc30bcd50 100644 --- a/test/fixture/var-function-param-return.output.md.json +++ b/test/fixture/var-function-param-return.output.md.json @@ -13,16 +13,7 @@ "type": "text", "value": "f" } - ], - "data": { - "id": "f", - "htmlAttributes": { - "id": "f" - }, - "hProperties": { - "id": "f" - } - } + ] }, { "type": "strong", diff --git a/test/format_type.js b/test/format_type.js index 570a627d5..589b68cc9 100644 --- a/test/format_type.js +++ b/test/format_type.js @@ -2,7 +2,7 @@ 'use strict'; var _formatType = require('../lib/output/util/format_type'), - createLinkerStack = require('../lib/output/util/linker_stack'), + LinkerStack = require('../lib/output/util/linker_stack'), remark = require('remark'), parse = require('doctrine').parse, test = require('tap').test; @@ -10,12 +10,12 @@ var _formatType = require('../lib/output/util/format_type'), function stringify(children) { return remark().stringify({ type: 'paragraph', - children: children + children }); } test('formatType', function (t) { - var linkerStack = createLinkerStack({}); + var linkerStack = new LinkerStack({}); var formatType = _formatType.bind(undefined, linkerStack.link); [ ['Foo', 'Foo'], diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js index 67ce55eaa..1ba50537e 100644 --- a/test/lib/flow_doctrine.js +++ b/test/lib/flow_doctrine.js @@ -9,11 +9,10 @@ function toComment(fn, filename) { return parse({ file: filename, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - })[0]; + }, {})[0]; } - test('flowDoctrine', function (t) { var types = FLOW_TYPES.filter(function (type) { diff --git a/test/lib/git/mock_repo.js b/test/lib/git/mock_repo.js index a4b3d3fe4..0301d2d8c 100644 --- a/test/lib/git/mock_repo.js +++ b/test/lib/git/mock_repo.js @@ -1,3 +1,4 @@ +'use strict'; module.exports = { master: { '/my': { diff --git a/test/lib/github.js b/test/lib/github.js index 2d623f695..e1e0407cf 100644 --- a/test/lib/github.js +++ b/test/lib/github.js @@ -12,7 +12,7 @@ function toComment(fn, filename) { return parse({ file: filename, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }).map(github); + }, {}).map(github); } function evaluate(fn) { @@ -23,7 +23,7 @@ test('github', function (t) { mock(mockRepo.master); - t.equal(evaluate(function () { + t.deepEqual(evaluate(function () { /** * get one * @returns {number} one @@ -31,9 +31,10 @@ test('github', function (t) { function getOne() { return 1; } - })[0].context.github, - 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8', - 'gets github url'); + })[0].context.github, { + path: 'index.js', + url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }, 'gets github url'); mock.restore(); @@ -63,7 +64,7 @@ test('enterprise repository', function (t) { mock(mockRepo.enterprise); - t.equal(evaluate(function () { + t.deepEqual(evaluate(function () { /** * get one * @returns {number} one @@ -71,9 +72,10 @@ test('enterprise repository', function (t) { function getOne() { return 1; } - })[0].context.github, - 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8', - 'gets github enterprise url'); + })[0].context.github, { + path: 'index.js', + url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }, 'gets github enterprise url'); mock.restore(); diff --git a/test/lib/hierarchy.js b/test/lib/hierarchy.js index 18f07cf2b..f17d5ff91 100644 --- a/test/lib/hierarchy.js +++ b/test/lib/hierarchy.js @@ -8,7 +8,7 @@ function toComments(fn, filename) { return parse({ file: filename || 'test.js', source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }); + }, {}); } function evaluate(fn, callback) { diff --git a/test/lib/infer/access.js b/test/lib/infer/access.js index 76454a1c3..aa5ffd707 100644 --- a/test/lib/infer/access.js +++ b/test/lib/infer/access.js @@ -2,13 +2,13 @@ var test = require('tap').test, parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name')(), + inferName = require('../../../lib/infer/name'), inferAccess = require('../../../lib/infer/access'); function toComment(fn) { return parse({ source: '(' + fn.toString() + ')' - })[0]; + }, {})[0]; } function evaluate(fn, re) { diff --git a/test/lib/infer/kind.js b/test/lib/infer/kind.js index 0231f6cc1..6fd11c380 100644 --- a/test/lib/infer/kind.js +++ b/test/lib/infer/kind.js @@ -1,14 +1,14 @@ 'use strict'; /*eslint-disable no-unused-vars*/ var test = require('tap').test, - inferKind = require('../../../lib/infer/kind')(), + inferKind = require('../../../lib/infer/kind'), parse = require('../../../lib/parsers/javascript'); function toComment(fn, filename) { return parse({ file: filename, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - })[0]; + }, {})[0]; } test('inferKind', function (t) { diff --git a/test/lib/infer/membership.js b/test/lib/infer/membership.js index 746b54553..373230b68 100644 --- a/test/lib/infer/membership.js +++ b/test/lib/infer/membership.js @@ -6,9 +6,9 @@ var test = require('tap').test, function toComment(fn, file) { return parse({ - file: file, + file, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }); + }, {}); } function pick(obj, props) { @@ -111,6 +111,7 @@ test('inferMembership - explicit', function (t) { scope: 'instance' }, 'instance object assignment'); + /* eslint object-shorthand: 0 */ t.deepEqual(pick(evaluate(function () { Foo.prototype = { /** @@ -123,6 +124,18 @@ test('inferMembership - explicit', function (t) { scope: 'instance' }, 'instance object assignment, function'); + t.deepEqual(pick(evaluate(function () { + Foo.prototype = { + /** + * Test + */ + bar() {} + }; + })[0], ['memberof', 'scope']), { + memberof: 'Foo', + scope: 'instance' + }, 'instance object assignment, shorthand function'); + t.deepEqual(pick(evaluate(function () { var Foo = { /** Test */ @@ -252,7 +265,7 @@ test('inferMembership - explicit', function (t) { t.equal(evaluate(function () { lend(/** @lends Foo */{}); - })[0], undefined, 'inferMembership - drops lends'); + })[0].memberof, undefined, 'inferMembership - drops lends'); t.end(); }); @@ -288,7 +301,7 @@ test('inferMembership - exports', function (t) { /** @module mod */ exports.foo = { /** bar */ - bar: function () {} + bar() {} }; })[1].memberof, 'mod.foo'); @@ -302,7 +315,7 @@ test('inferMembership - exports', function (t) { /** @module mod */ exports.foo.prototype = { /** bar */ - bar: function () {} + bar() {} }; })[1].memberof, 'mod.foo'); @@ -340,7 +353,7 @@ test('inferMembership - module.exports', function (t) { /** @module mod */ module.exports.foo = { /** bar */ - bar: function () {} + bar() {} }; })[1].memberof, 'mod.foo'); @@ -354,7 +367,7 @@ test('inferMembership - module.exports', function (t) { /** @module mod */ module.exports.prototype = { /** bar */ - bar: function () {} + bar() {} }; })[1].memberof, 'mod'); @@ -428,7 +441,7 @@ test('inferMembership - https://github.com/documentationjs/documentation/issues/ t.deepEqual(pick(evaluate(function () { Foo.prototype = { /** Test */ - bar: function () { + bar() { lend(); lend(); } diff --git a/test/lib/infer/name.js b/test/lib/infer/name.js index c155ba781..084a3b980 100644 --- a/test/lib/infer/name.js +++ b/test/lib/infer/name.js @@ -2,13 +2,13 @@ var test = require('tap').test, parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name')(); + inferName = require('../../../lib/infer/name'); function toComment(fn, file) { return parse({ - file: file, + file, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - })[0]; + }, {})[0]; } function evaluate(fn, file) { @@ -50,7 +50,7 @@ test('inferName', function (t) { // Identifier (comment attached here) // FunctionExpression /** Test */ - name: function () {} + name() {} }; }).name, 'name', 'property, function'); diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js index b318918c4..b320847ab 100644 --- a/test/lib/infer/params.js +++ b/test/lib/infer/params.js @@ -2,13 +2,13 @@ var test = require('tap').test, parse = require('../../../lib/parsers/javascript'), - inferParams = require('../../../lib/infer/params')(); + inferParams = require('../../../lib/infer/params'); function toComment(fn, file) { return parse({ - file: file, + file, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - })[0]; + }, {})[0]; } function evaluate(fn, file) { diff --git a/test/lib/infer/type.js b/test/lib/infer/type.js index 6777d79dc..387ddc0c1 100644 --- a/test/lib/infer/type.js +++ b/test/lib/infer/type.js @@ -2,13 +2,13 @@ var test = require('tap').test, parse = require('../../../lib/parsers/javascript'), - inferKind = require('../../../lib/infer/kind')(), - inferType = require('../../../lib/infer/type')(); + inferKind = require('../../../lib/infer/kind'), + inferType = require('../../../lib/infer/type'); function toComment(code) { return parse({ source: code - })[0]; + }, {})[0]; } function evaluate(code) { diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js index 2c0fef558..b9271f490 100644 --- a/test/lib/input/shallow.js +++ b/test/lib/input/shallow.js @@ -5,8 +5,7 @@ var test = require('tap').test, shallow = require('../../../lib/input/shallow'); test('shallow deps', function (t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], {}, function (err, deps) { - t.ifError(err); + shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], {}).then(deps => { t.equal(deps.length, 1); t.ok(deps[0], 'has path'); t.end(); @@ -17,8 +16,7 @@ test('shallow deps multi', function (t) { shallow([ path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), path.resolve(path.join(__dirname, '../../fixture/es6.output.json')) - ], {}, function (err, deps) { - t.ifError(err); + ], {}).then(deps => { t.equal(deps.length, 2); t.ok(deps[0], 'has path'); t.end(); @@ -28,30 +26,23 @@ test('shallow deps multi', function (t) { test('shallow deps directory', function (t) { shallow([ path.resolve(path.join(__dirname, '../../fixture/html')) - ], {}, function (err, deps) { - t.ifError(err); + ], {}).then(deps => { t.equal(deps.length, 1); - t.ok(deps[0].match(/input.js/), 'is the input file'); + t.ok(deps[0].file.match(/input.js/), 'is the input file'); + t.end(); + }).catch(err => { + t.fail(err); t.end(); }); }); -test('shallow deps not found', function (t) { - t.throws(function () { - shallow([ - 'not-found-file' - ], {}); - }, 'not found'); - t.end(); -}); - test('throws on non-string or object input', function (t) { - t.throws(function () { - shallow([ - true - ], {}); - }, 'indexes should be either strings or objects'); - t.end(); + shallow([ + true + ], {}).catch(err => { + t.equal(err.message, 'Indexes should be either strings or objects'); + t.end(); + }); }); test('shallow deps literal', function (t) { @@ -61,8 +52,7 @@ test('shallow deps literal', function (t) { }; shallow([ obj - ], {}, function (err, deps) { - t.ifError(err); + ], {}).then(deps => { t.equal(deps[0], obj); t.end(); }); diff --git a/test/lib/lint.js b/test/lib/lint.js index 8b769ade5..c1464e6d3 100644 --- a/test/lib/lint.js +++ b/test/lib/lint.js @@ -9,7 +9,7 @@ function toComment(fn, filename) { return parse({ file: filename, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - })[0]; + }, {})[0]; } function evaluate(fn) { diff --git a/test/lib/load_config.js b/test/lib/load_config.js deleted file mode 100644 index 64ee5d48f..000000000 --- a/test/lib/load_config.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - loadConfig = require('../../lib/load_config'); - -test('loadConfig', function (t) { - - t.throws(function () { - loadConfig('DOES-NOT-EXIST'); - }); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.json')), - { foo: 'bar' }); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_comments.json')), - { foo: 'bar' }, 'config with comments'); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.yaml')), - { foo: 'bar' }, 'config.yaml'); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config.yml')), - { foo: 'bar' }, 'config.yml'); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config')), - { foo: 'bar' }, 'config in yaml without extension'); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_links.yml')), - { foo: 'hello [link](https://github.com/my/link) world' }, 'config with markdown link'); - - t.deepEqual(loadConfig(path.join(__dirname, '../config_fixture/config_file.yml')),{ - toc: [{ - name: 'snowflake', - file: path.join(__dirname, '../fixture/snowflake.md') - }] - }, 'config with file reference'); - - t.end(); -}); diff --git a/test/lib/merge_config.js b/test/lib/merge_config.js new file mode 100644 index 000000000..bab68574b --- /dev/null +++ b/test/lib/merge_config.js @@ -0,0 +1,69 @@ +'use strict'; + +var test = require('tap').test, + path = require('path'), + _ = require('lodash'), + mergeConfig = require('../../lib/merge_config'); + +test('bad config', function (t) { + mergeConfig({ config: 'DOES-NOT-EXIST' }) + .catch(err => { + t.ok(err); + t.end(); + }); +}); + +test('nc(mergeConfig)', function (t) { + + // Omit configuration from output, for simplicity + var nc = _.curryRight(_.omit, 2)(['config', 'no-package', 'parseExtension', 'project-homepage', + 'project-name', 'project-version']); + + Promise.all([ + [ + { config: path.join(__dirname, '../config_fixture/config.json') }, + { foo: 'bar' } + + ], [ + { passThrough: true, config: path.join(__dirname, '../config_fixture/config.json') }, + { foo: 'bar', passThrough: true } + + ], [ + { config: path.join(__dirname, '../config_fixture/config_comments.json') }, + { foo: 'bar' } + + ], [ + { config: path.join(__dirname, '../config_fixture/config.yaml') }, + { foo: 'bar' } + + ], [ + { config: path.join(__dirname, '../config_fixture/config.yml') }, + { foo: 'bar' } + + ], [ + { config: path.join(__dirname, '../config_fixture/config') }, + { foo: 'bar' } + + ], [ + { config: path.join(__dirname, '../config_fixture/config_links.yml') }, + { foo: 'hello [link](https://github.com/my/link) world' } + + ], [ + { config: path.join(__dirname, '../config_fixture/config_file.yml') }, + { + toc: [{ + name: 'snowflake', + file: path.join(__dirname, '../fixture/snowflake.md') + }] + } + ] + ].map(pair => + mergeConfig(Object.assign(pair[0], { 'no-package': true })) + .then(nc) + .then(res => { + t.deepEqual(res, pair[1]); + }) + )).then(res => { + t.end(); + }); +}); diff --git a/test/lib/nest.js b/test/lib/nest.js index 5b4aa286b..d05c96f19 100644 --- a/test/lib/nest.js +++ b/test/lib/nest.js @@ -8,13 +8,13 @@ function toComment(fn, filename) { return parse({ file: filename, source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }).map(nest); + }, {}).map(nest); } test('nest params - no params', function (t) { - t.equal(toComment(function () { + t.deepEqual(toComment(function () { /** @name foo */ - })[0].params, undefined, 'no params'); + })[0].params, [], 'no params'); t.end(); }); diff --git a/test/lib/output/util/formatters.js b/test/lib/output/util/formatters.js index 4a95b72a1..04dc55429 100644 --- a/test/lib/output/util/formatters.js +++ b/test/lib/output/util/formatters.js @@ -1,3 +1,4 @@ +'use strict'; var test = require('tap').test; var formatters = require('../../../../lib/output/util/formatters')(getHref); diff --git a/test/lib/parse.js b/test/lib/parse.js index be1b7eda0..aef852939 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -21,7 +21,7 @@ function evaluate(fn, filename) { return parse({ file: filename || 'test.js', source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }); + }, {}); } function addJSDocTag(tree) { @@ -622,6 +622,7 @@ test('parse - @param', function (t) { /** @param test */ })[0].params[0], { name: 'test', + title: 'param', lineNumber: 0 }, 'name'); @@ -629,6 +630,7 @@ test('parse - @param', function (t) { /** @param {number} test */ })[0].params[0], { name: 'test', + title: 'param', type: { name: 'number', type: 'NameExpression' @@ -640,6 +642,7 @@ test('parse - @param', function (t) { /** @param {number} test - desc */ })[0].params[0], { name: 'test', + title: 'param', type: { name: 'number', type: 'NameExpression' @@ -664,6 +667,7 @@ test('parse - @prop', function (t) { /** @prop {number} test */ })[0].properties[0], { name: 'test', + title: 'property', type: { name: 'number', type: 'NameExpression' @@ -675,6 +679,7 @@ test('parse - @prop', function (t) { /** @prop {number} test - desc */ })[0].properties[0], { name: 'test', + title: 'property', type: { name: 'number', type: 'NameExpression' @@ -691,6 +696,7 @@ test('parse - @property', function (t) { /** @property {number} test */ })[0].properties[0], { name: 'test', + title: 'property', type: { name: 'number', type: 'NameExpression' @@ -702,6 +708,7 @@ test('parse - @property', function (t) { /** @property {number} test - desc */ })[0].properties[0], { name: 'test', + title: 'property', type: { name: 'number', type: 'NameExpression' @@ -741,6 +748,7 @@ test('parse - @return', function (t) { t.deepEqual(evaluate(function () { /** @return test */ })[0].returns[0], { + title: 'returns', description: remark().parse('test') }, 'description'); @@ -748,6 +756,7 @@ test('parse - @return', function (t) { /** @return {number} test */ })[0].returns[0], { description: remark().parse('test'), + title: 'returns', type: { name: 'number', type: 'NameExpression' @@ -761,6 +770,7 @@ test('parse - @returns', function (t) { t.deepEqual(evaluate(function () { /** @returns test */ })[0].returns[0], { + title: 'returns', description: remark().parse('test') }, 'description'); @@ -768,6 +778,7 @@ test('parse - @returns', function (t) { /** @returns {number} test */ })[0].returns[0], { description: remark().parse('test'), + title: 'returns', type: { name: 'number', type: 'NameExpression' diff --git a/test/lib/parsers/javascript.js b/test/lib/parsers/javascript.js index 3c7e18499..3541d357a 100644 --- a/test/lib/parsers/javascript.js +++ b/test/lib/parsers/javascript.js @@ -8,8 +8,8 @@ function toComments(source, filename, opts) { source = typeof source === 'string' ? source : '(' + source.toString() + ')'; return parse({ file: filename || 'test.js', - source: source - }, opts); + source + }, opts || {}); } test('parse - leading comment', function (t) { diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js index b9378271e..dc80b2c0a 100644 --- a/test/lib/parsers/polyglot.js +++ b/test/lib/parsers/polyglot.js @@ -9,29 +9,64 @@ var test = require('tap').test, test('polyglot', function (t) { var file = path.resolve(path.join(__dirname, '../../fixture/polyglot/blend.cpp')); var result = polyglot({ - file: file, + file, source: fs.readFileSync(file, 'utf8') }); delete result[0].context.file; delete result[0].context.sortKey; t.deepEqual(result, [{ errors: [], + augments: [], + examples: [], + properties: [], + throws: [], + todos: [], + sees: [], context: { loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } }, description: remark().parse('This method moves a hex to a color'), loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, - name: 'hexToUInt32Color', params: [ - { lineNumber: 3, name: 'hex', type: { name: 'string', type: 'NameExpression' } } ], + name: 'hexToUInt32Color', params: [{ + lineNumber: 3, + title: 'param', + name: 'hex', + type: { + name: 'string', + type: 'NameExpression' + }} + ], returns: [ { + title: 'returns', description: remark().parse('color'), - type: { name: 'number', type: 'NameExpression' } } ], - tags: [ { description: null, lineNumber: 2, name: 'hexToUInt32Color', title: 'name' }, - { description: null, lineNumber: 3, name: 'hex', title: 'param', type: { + type: { + name: 'number', + type: 'NameExpression' + } + } + ], + tags: [{ + description: null, + lineNumber: 2, + name: 'hexToUInt32Color', + title: 'name' + }, + { + description: null, + lineNumber: 3, + name: 'hex', + title: 'param', + type: { name: 'string', type: 'NameExpression' - } }, - { description: 'color', lineNumber: 4, title: 'returns', type: { + } + }, + { + description: 'color', + lineNumber: 4, + title: 'returns', + type: { name: 'number', type: 'NameExpression' - } } ] } ], 'polyglot parser'); + } + }]}], 'polyglot parser'); t.end(); }); diff --git a/test/lib/server.js b/test/lib/server.js index 301510830..e20808c3b 100644 --- a/test/lib/server.js +++ b/test/lib/server.js @@ -39,7 +39,7 @@ test('server - throws on bad port', function (t) { test('server', function (t) { var server = new Server(4001); t.ok(server, 'server is initialized'); - server.start(function () { + server.start().then(function () { t.test('start can be called more than once, without a callback', function (tt) { server.start(); @@ -78,7 +78,7 @@ test('server', function (t) { }); t.test('cleanup', function (tt) { - server.stop(function () { + server.stop().then(function () { tt.end(); }); }); diff --git a/test/linker.js b/test/linker.js index f3cca7c7a..3e9c6be5b 100644 --- a/test/linker.js +++ b/test/linker.js @@ -1,15 +1,16 @@ -var createLinkerStack = require('../lib/output/util/linker_stack'), +'use strict'; +var LinkerStack = require('../lib/output/util/linker_stack'), test = require('tap').test; test('linkerStack', function (t) { - var linkerStack = createLinkerStack({}); + var linkerStack = new LinkerStack({}); t.equal(linkerStack.link('string'), 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String', 'Default global resolution of string'); - t.equal(createLinkerStack({ + t.equal(new LinkerStack({ paths: { Point: 'http://geojson.org/geojson-spec.html#point' } @@ -18,7 +19,7 @@ test('linkerStack', function (t) { 'Custom hardcoded path for a GeoJSON type'); - t.equal(createLinkerStack({ + t.equal(new LinkerStack({ paths: { Image: 'http://custom.com/' } @@ -27,7 +28,7 @@ test('linkerStack', function (t) { 'Prefers config link to native.'); - var linker = createLinkerStack({ + var linker = new LinkerStack({ paths: { Image: 'http://custom.com/' } diff --git a/test/normalize.js b/test/normalize.js index e977f8d36..a55135e47 100644 --- a/test/normalize.js +++ b/test/normalize.js @@ -1,3 +1,4 @@ +'use strict'; var walk = require('../lib/walk'); module.exports = function (comments) { diff --git a/test/test.js b/test/test.js index db67a9141..e818a505a 100644 --- a/test/test.js +++ b/test/test.js @@ -35,8 +35,7 @@ function readOptionsFromFile(file) { if (fs.existsSync(path.join(__dirname, '../.git'))) { test('git option', function (t) { var file = path.join(__dirname, './fixture/simple.input.js'); - documentation.build([file], { github: true }, function (err, result) { - t.ifError(err); + documentation.build([file], { github: true }).then(result => { normalize(result); var outputfile = file.replace('.input.js', '.output.github.json'); if (UPDATE) { @@ -45,8 +44,7 @@ if (fs.existsSync(path.join(__dirname, '../.git'))) { var expect = require(outputfile); t.deepEqual(result, expect, 'produces correct JSON'); - outputMarkdown(result, {}, function (err, result) { - t.ifError(err); + outputMarkdown(result, {}).then(result => { var outputfile = file.replace('.input.js', '.output.github.md'); if (UPDATE) { fs.writeFileSync(outputfile, result, 'utf8'); @@ -61,7 +59,8 @@ if (fs.existsSync(path.join(__dirname, '../.git'))) { test('document-exported error', function (t) { var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); - documentation.build([file], { documentExported: true }, function (err, result) { + documentation.build([file], { documentExported: true }).then(result => { + }, err => { t.match(err.message, /Unable to find the value x/g, 'Produces a descriptive error'); t.end(); }); @@ -72,8 +71,7 @@ test('external modules option', function (t) { path.join(__dirname, 'fixture', 'external.input.js') ], { external: '(external|external/node_modules/*)' - }, function (err, result) { - t.ifError(err); + }).then(result => { normalize(result); var outputfile = path.join(__dirname, 'fixture', '_external-deps-included.json'); if (UPDATE) { @@ -88,8 +86,9 @@ test('external modules option', function (t) { test('bad input', function (tt) { glob.sync(path.join(__dirname, 'fixture/bad', '*.input.js')).forEach(function (file) { tt.test(path.basename(file), function (t) { - documentation.build([file], readOptionsFromFile(file), function (error, res) { + documentation.build([file], readOptionsFromFile(file)).then(res => { t.equal(res, undefined); + }).catch(error => { // make error a serializable object error = JSON.parse(JSON.stringify(error)); // remove system-specific path @@ -111,17 +110,13 @@ test('bad input', function (tt) { test('html', function (tt) { glob.sync(path.join(__dirname, 'fixture/html', '*.input.js')).forEach(function (file) { tt.test(path.basename(file), function (t) { - documentation.build([file], readOptionsFromFile(file), function (err, result) { - t.ifError(err); - outputHtml(result, null, function (err, result) { - t.ifError(err); - var clean = result.sort(function (a, b) { - return a.path > b.path; - }).filter(function (r) { - return r.path.match(/(html)$/); - }).map(function (r) { - return r.contents; - }).join('\n'); + documentation.build([file], readOptionsFromFile(file)) + .then(result => outputHtml(result, {})) + .then(result => { + var clean = result.sort((a, b) => a.path > b.path) + .filter(r => r.path.match(/(html)$/)) + .map(r => r.contents) + .join('\n'); var outputfile = file.replace('.input.js', '.output.files'); if (UPDATE) { fs.writeFileSync(outputfile, clean, 'utf8'); @@ -129,8 +124,10 @@ test('html', function (tt) { var expect = fs.readFileSync(outputfile, 'utf8'); t.deepEqual(clean, expect); t.end(); + }) + .catch(err => { + t.fail(err); }); - }); }); }); tt.end(); @@ -139,12 +136,10 @@ test('html', function (tt) { test('outputs', function (ttt) { glob.sync(path.join(__dirname, 'fixture', '*.input.js')).forEach(function (file) { ttt.test(path.basename(file), function (tt) { - documentation.build([file], readOptionsFromFile(file), function (err, result) { - tt.ifError(err); + documentation.build([file], readOptionsFromFile(file)).then(result => { tt.test('markdown', function (t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: true }, function (err, result) { - t.ifError(err); + outputMarkdown(_.cloneDeep(result), { markdownToc: true }).then(result => { var outputfile = file.replace('.input.js', '.output.md'); if (UPDATE) { fs.writeFileSync(outputfile, result, 'utf8'); @@ -152,13 +147,12 @@ test('outputs', function (ttt) { var expect = fs.readFileSync(outputfile, 'utf8'); t.equal(result.toString(), expect, 'markdown output correct'); t.end(); - }); + }).catch(error => t.ifError(error)); }); if (file.match(/es6.input.js/)) { tt.test('no markdown TOC', function (t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: false }, function (err, result) { - t.ifError(err); + outputMarkdown(_.cloneDeep(result), { markdownToc: false }).then(result => { var outputfile = file.replace('.input.js', '.output-toc.md'); if (UPDATE) { fs.writeFileSync(outputfile, result, 'utf8'); @@ -166,13 +160,12 @@ test('outputs', function (ttt) { var expect = fs.readFileSync(outputfile, 'utf8'); t.equal(result.toString(), expect, 'markdown output correct'); t.end(); - }); + }).catch(error => t.ifError(error)); }); } tt.test('markdown AST', function (t) { - outputMarkdownAST(_.cloneDeep(result), {}, function (err, result) { - t.ifError(err); + outputMarkdownAST(_.cloneDeep(result), {}).then(result => { var outputfile = file.replace('.input.js', '.output.md.json'); if (UPDATE) { fs.writeFileSync(outputfile, JSON.stringify(result, null, 2), 'utf8'); @@ -180,7 +173,7 @@ test('outputs', function (ttt) { var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); t.deepEqual(result, expect, 'markdown AST output correct'); t.end(); - }); + }).catch(error => t.ifError(error)); }); tt.test('JSON', function (t) { @@ -206,62 +199,12 @@ test('outputs', function (ttt) { ttt.end(); }); -test('outputs - sync', function (ttt) { - glob.sync(path.join(__dirname, 'fixture/sync', '*.input.js')).forEach(function (file) { - ttt.test(path.basename(file), function (tt) { - var result = documentation.buildSync([file], readOptionsFromFile(file)); - - tt.test('markdown', function (t) { - outputMarkdown(result, { markdownToc: true }, function (err, result) { - t.ifError(err); - var outputfile = file.replace('.input.js', '.output.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }); - }); - - tt.test('markdown AST', function (t) { - outputMarkdownAST(result, {}, function (err, result) { - t.ifError(err); - var outputfile = file.replace('.input.js', '.output.md.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2), 'utf8'); - } - var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); - t.deepEqual(result, expect, 'markdown AST output correct'); - t.end(); - }); - }); - - tt.test('JSON', function (t) { - normalize(result); - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(makePOJO(result), expect); - t.end(); - }); - - tt.end(); - }); - }); - ttt.end(); -}); - test('highlightAuto md output', function (t) { var file = path.join(__dirname, 'fixture/auto_lang_hljs/multilanguage.input.js'), hljsConfig = {hljs: {highlightAuto: true, languages: ['js', 'css', 'html']}}; - documentation.build(file, null, function (err, result) { - t.ifError(err); - outputMarkdown(result, hljsConfig, function (err, result) { - t.ifError(err); + documentation.build(file, {}).then(result => { + outputMarkdown(result, hljsConfig).then(result => { var outputfile = file.replace('.input.js', '.output.md'); if (UPDATE) { fs.writeFileSync(outputfile, result, 'utf8'); @@ -278,11 +221,8 @@ test('config', function (t) { var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); documentation.build([file], { config: path.join(__dirname, 'fixture', 'simple.config.yml') - }, function (err, out) { - t.ifError(err); - outputMarkdown(out, {}, function (err, md) { - t.ifError(err); - + }).then(out => outputMarkdown(out, {})) + .then(md => { if (UPDATE) { fs.writeFileSync(outputfile, md); } @@ -290,16 +230,17 @@ test('config', function (t) { t.equal(md, result, 'rendered markdown is equal'); t.end(); + }) + .catch(err => { + t.fail(err); }); - }); }); test('multi-file input', function (t) { documentation.build([ path.join(__dirname, 'fixture', 'simple.input.js'), path.join(__dirname, 'fixture', 'simple-two.input.js') - ], null, function (err, result) { - t.ifError(err); + ], {}).then(result => { normalize(result); var outputfile = path.join(__dirname, 'fixture', '_multi-file-input.json'); if (UPDATE) { @@ -313,8 +254,7 @@ test('multi-file input', function (t) { test('accepts simple relative paths', function (t) { chdir(__dirname, function () { - documentation.build('fixture/simple.input.js', null, function (err, data) { - t.ifError(err); + documentation.build('test/fixture/simple.input.js', {}).then(data => { t.equal(data.length, 1, 'simple has no dependencies'); t.end(); }); @@ -323,8 +263,7 @@ test('accepts simple relative paths', function (t) { test('.lint', function (t) { chdir(__dirname, function () { - documentation.lint('fixture/simple.input.js', null, function (err, data) { - t.ifError(err); + documentation.lint('test/fixture/simple.input.js', {}).then(data => { t.equal(data, '', 'outputs lint information'); t.end(); }); @@ -333,7 +272,7 @@ test('.lint', function (t) { test('.lint with bad input', function (t) { chdir(__dirname, function () { - documentation.lint('fixture/bad/syntax.input.js', null, function (err, data) { + documentation.lint('test/fixture/bad/syntax.input.js', {}).catch(err => { t.ok(err, 'returns an error when syntax is incorrect'); t.end(); }); diff --git a/test/utils.js b/test/utils.js index e9b075614..539bf347e 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,3 +1,4 @@ +'use strict'; var http = require('http'), concat = require('concat-stream'); From 8295363beddf8946bb0fde27537ead8d0a632776 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 29 Jan 2017 17:04:19 -0500 Subject: [PATCH 005/555] console.errors when in html serving mode --- lib/serve/error_page.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/serve/error_page.js b/lib/serve/error_page.js index 03c414c77..443fe26d4 100644 --- a/lib/serve/error_page.js +++ b/lib/serve/error_page.js @@ -27,6 +27,7 @@ ansiHTML.setColors({ */ function errorPage(error/*: Error*/) { var errorText = error.toString(); + console.error(error); if (error.codeFrame) { errorText += '
' + ansiHTML(error.codeFrame) + '
'; } From 8cc34b661f93ab71a4d8367dba59cea1ab97a93d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 29 Jan 2017 18:35:19 -0500 Subject: [PATCH 006/555] fix(scopes): Support inner scope (#665) * fix(scopes): Support inner scope The purpose and usage of inner is still unclear, unfortunately, so this is an interim fix at best. Fixes https://github.com/documentationjs/documentation/issues/652 * Improve comment typedef while we're at it --- declarations/comment.js | 33 +++- default_theme/index._ | 12 ++ lib/hierarchy.js | 49 +++-- lib/output/markdown_ast.js | 6 + lib/parse.js | 2 + lib/serve/error_page.js | 1 + test/fixture/_external-deps-included.json | 18 +- test/fixture/_multi-file-input.json | 12 +- test/fixture/boolean-literal-type.output.json | 6 +- test/fixture/class.output.json | 18 +- ...exported-export-default-object.output.json | 12 +- ...-exported-export-default-value.output.json | 6 +- test/fixture/document-exported.output.json | 180 +++++++++++------ test/fixture/es6-class.output.json | 24 ++- test/fixture/es6-default2.output.json | 6 +- test/fixture/es6-import.output.json | 18 +- test/fixture/es6.input.js | 7 + test/fixture/es6.output.json | 182 +++++++++++------- test/fixture/event.output.json | 6 +- test/fixture/example-caption.output.json | 6 +- test/fixture/external.output.json | 6 +- test/fixture/factory.output.json | 18 +- test/fixture/html/nested.config-output.html | 3 + test/fixture/html/nested.output.files | 3 + test/fixture/infer-private.output.json | 12 +- test/fixture/inheritance.output.json | 12 +- test/fixture/inline-link.output.json | 12 +- test/fixture/internal.output.json | 6 +- test/fixture/literal_types.output.json | 12 +- test/fixture/memberedclass.output.json | 18 +- test/fixture/merge-infered-type.output.json | 6 +- test/fixture/meta.output.json | 6 +- test/fixture/multisignature.output.json | 12 +- test/fixture/nearby_params.output.json | 6 +- test/fixture/nest_params.output.json | 12 +- .../newline-in-description.output.json | 6 +- test/fixture/no-name.output.json | 6 +- .../optional-record-field-type.output.json | 6 +- test/fixture/params.output.json | 54 ++++-- test/fixture/polyglot/blend.json | 6 +- test/fixture/react-jsx.output.json | 6 +- test/fixture/simple-hashbang.output.json | 6 +- test/fixture/simple-two.output.json | 6 +- test/fixture/simple.output.github.json | 6 +- test/fixture/simple.output.json | 6 +- test/fixture/sort-order-alpha.output.json | 72 ++++--- test/fixture/sorting/output.json | 18 +- test/fixture/string-literal-key.output.json | 12 +- test/fixture/system-import.output.json | 6 +- test/fixture/this-class.output.json | 30 ++- test/fixture/type_application.output.json | 6 +- .../var-function-param-return.output.json | 6 +- 52 files changed, 678 insertions(+), 328 deletions(-) diff --git a/declarations/comment.js b/declarations/comment.js index a737ef123..64268e630 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -71,7 +71,9 @@ declare type CommentTag = { declare type CommentMembers = { static: Array, instance: Array, - events: Array + events: Array, + global: Array, + inner: Array }; declare type CommentExample = { @@ -84,6 +86,20 @@ declare type Remark = { children: Array }; +declare type Access = 'private' | 'public' | 'protected'; +declare type Scope = 'instance' | 'static' | 'inner' | 'global'; +declare type Kind = 'class' | + 'constant' | + 'event' | + 'external' | + 'file' | + 'function' | + 'member' | + 'mixin' | + 'module' | + 'namespace' | + 'typedef'; + declare type Comment = { errors: Array, tags: Array, @@ -106,10 +122,11 @@ declare type Comment = { members: CommentMembers, name?: string, - kind?: string, + kind?: Kind, + memberof?: string, - scope?: string, - access?: string, + scope?: Scope, + access?: Access, alias?: string, copyright?: string, @@ -126,6 +143,12 @@ declare type Comment = { path?: Array<{ name: string, - scope: string + scope: Scope }> }; + +declare type ReducedComment = { + name: string, + kind: ?Kind, + scope?: ?Scope +} diff --git a/default_theme/index._ b/default_theme/index._ index 1934773aa..99392f6d8 100644 --- a/default_theme/index._ +++ b/default_theme/index._ @@ -56,6 +56,18 @@ <% }) %> <% } %> + <% if (doc.members.inner && doc.members.inner.length) { %> + + <% } %> <% if (doc.members.events && doc.members.events.length) { %>
  • Events
  • diff --git a/lib/hierarchy.js b/lib/hierarchy.js index 422d31362..0c17fcffe 100644 --- a/lib/hierarchy.js +++ b/lib/hierarchy.js @@ -10,12 +10,18 @@ var hasOwnProperty = Object.prototype.hasOwnProperty; */ let isEvent = member => member.kind === 'event'; -/*:: -declare type ReducedComment = { - name: string, - kind: ?string, - scope?: ?string -} */ +/** + * We need to have members of all valid JSDoc scopes. + * @private + */ +let getMembers = () => ({ + global: Object.create(null), + inner: Object.create(null), + instance: Object.create(null), + events: Object.create(null), + static: Object.create(null) +}); + /** * Pick only relevant properties from a comment to store them in @@ -49,12 +55,10 @@ function pick(comment/*: Comment */)/*: ?ReducedComment */ { module.exports = function (comments/*: Array*/) { var id = 0, root = { - members: { - instance: Object.create(null), - static: Object.create(null) - } + members: getMembers() }; + comments.forEach(comment => { var path = []; @@ -86,10 +90,7 @@ module.exports = function (comments/*: Array*/) { if (!hasOwnProperty.call(node.members[scope], name)) { node.members[scope][name] = { comments: [], - members: { - instance: Object.create(null), - static: Object.create(null) - } + members: getMembers() }; } @@ -138,7 +139,7 @@ module.exports = function (comments/*: Array*/) { comment.members[scope] = node.members[scope]; } - var events = comment.members.events || []; + var events = comment.members.events; var groups = []; if (comment.members.instance.length) { @@ -155,6 +156,20 @@ module.exports = function (comments/*: Array*/) { comment.members.static = groups[false] || []; } + if (comment.members.inner.length) { + groups = _.groupBy(comment.members.inner, isEvent); + + events = events.concat(groups[true] || []); + comment.members.inner = groups[false] || []; + } + + if (comment.members.global.length) { + groups = _.groupBy(comment.members.global, isEvent); + + events = events.concat(groups[true] || []); + comment.members.global = groups[false] || []; + } + comment.members.events = events; comment.path = path.map(pick) @@ -163,7 +178,9 @@ module.exports = function (comments/*: Array*/) { var scopeChars = { instance: '#', - static: '.' + static: '.', + inner: '~', + global: '' }; comment.namespace = comment.path.reduce((memo, part) => { diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index 1dd95acff..8c9748fb4 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -212,12 +212,18 @@ function buildMarkdownAST(comments/*: Array */, config/*: Documentation .concat(throwsSection(comment)) .concat(returnsSection(comment)) .concat(metaSection(comment)) + .concat(!!comment.members.global.length && + comment.members.global.reduce((memo, child) => + memo.concat(generate(depth + 1, child)), [])) .concat(!!comment.members.instance.length && comment.members.instance.reduce((memo, child) => memo.concat(generate(depth + 1, child)), [])) .concat(!!comment.members.static.length && comment.members.static.reduce((memo, child) => memo.concat(generate(depth + 1, child)), [])) + .concat(!!comment.members.inner.length && + comment.members.inner.reduce((memo, child) => + memo.concat(generate(depth + 1, child)), [])) .filter(Boolean); } diff --git a/lib/parse.js b/lib/parse.js index 2a547cb65..176f99032 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -21,6 +21,7 @@ var flatteners = { * @returns {undefined} has side-effects */ 'access': function (result, tag) { + // doctrine ensures that tag.access is valid result.access = tag.access; }, 'alias': flattenName, @@ -208,6 +209,7 @@ var flatteners = { * @returns {undefined} has side-effects */ 'kind': function (result, tag) { + // doctrine ensures that tag.kind is valid result.kind = tag.kind; }, 'lends': flattenDescription, diff --git a/lib/serve/error_page.js b/lib/serve/error_page.js index 443fe26d4..ec2fcafd9 100644 --- a/lib/serve/error_page.js +++ b/lib/serve/error_page.js @@ -1,4 +1,5 @@ /* @flow */ +/* eslint no-console: 0 */ 'use strict'; var File = require('vinyl'); var ansiHTML = require('ansi-html'); diff --git a/test/fixture/_external-deps-included.json b/test/fixture/_external-deps-included.json index 7968ca9cf..33c6f92e3 100644 --- a/test/fixture/_external-deps-included.json +++ b/test/fixture/_external-deps-included.json @@ -121,9 +121,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -291,9 +293,11 @@ "name": "main", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -461,9 +465,11 @@ "name": "index", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/_multi-file-input.json b/test/fixture/_multi-file-input.json index d3a6bf704..11a72d624 100644 --- a/test/fixture/_multi-file-input.json +++ b/test/fixture/_multi-file-input.json @@ -238,9 +238,11 @@ "name": "returnTwo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -408,9 +410,11 @@ "name": "simple.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/boolean-literal-type.output.json b/test/fixture/boolean-literal-type.output.json index 69345a958..fb5f85589 100644 --- a/test/fixture/boolean-literal-type.output.json +++ b/test/fixture/boolean-literal-type.output.json @@ -72,9 +72,11 @@ "name": "f", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json index 2f517cc09..fd28ff3fc 100644 --- a/test/fixture/class.output.json +++ b/test/fixture/class.output.json @@ -167,6 +167,8 @@ "kind": "class", "name": "MyClass", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -400,9 +402,11 @@ "memberof": "MyClass", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -575,9 +579,11 @@ "memberof": "MyClass", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -593,8 +599,8 @@ "namespace": "MyClass#getUndefined" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/document-exported-export-default-object.output.json b/test/fixture/document-exported-export-default-object.output.json index 74cd9bffa..fda6f1de9 100644 --- a/test/fixture/document-exported-export-default-object.output.json +++ b/test/fixture/document-exported-export-default-object.output.json @@ -35,9 +35,11 @@ "todos": [], "name": "document-exported-export-default-object.input", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -82,9 +84,11 @@ "todos": [], "name": "x", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/document-exported-export-default-value.output.json b/test/fixture/document-exported-export-default-value.output.json index 8b6095ade..78ffad1f7 100644 --- a/test/fixture/document-exported-export-default-value.output.json +++ b/test/fixture/document-exported-export-default-value.output.json @@ -35,9 +35,11 @@ "todos": [], "name": "document-exported-export-default-value.input", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json index 230b19314..671a4b4a1 100644 --- a/test/fixture/document-exported.output.json +++ b/test/fixture/document-exported.output.json @@ -36,6 +36,8 @@ "name": "z", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": "", @@ -76,9 +78,11 @@ "memberof": "z", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -94,8 +98,8 @@ "namespace": "z#zMethod" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -148,9 +152,11 @@ "name": "x", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -197,6 +203,8 @@ "name": "Class", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": "", @@ -237,9 +245,11 @@ "memberof": "Class", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -293,9 +303,11 @@ "memberof": "Class", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -355,9 +367,11 @@ "memberof": "Class", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -373,6 +387,7 @@ "namespace": "Class#classSetter" } ], + "events": [], "static": [ { "description": "", @@ -413,9 +428,11 @@ "memberof": "Class", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -469,9 +486,11 @@ "memberof": "Class", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -531,9 +550,11 @@ "memberof": "Class", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -548,8 +569,7 @@ ], "namespace": "Class.staticSetter" } - ], - "events": [] + ] }, "path": [ { @@ -600,9 +620,11 @@ "name": "boolean" }, "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -648,9 +670,11 @@ "todos": [], "name": "y2Default", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -764,9 +788,11 @@ "name": "y4", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -812,7 +838,10 @@ "todos": [], "name": "object", "members": { + "global": [], + "inner": [], "instance": [], + "events": [], "static": [ { "description": "", @@ -852,9 +881,11 @@ "memberof": "object", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -906,9 +937,11 @@ "memberof": "object", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -922,8 +955,7 @@ ], "namespace": "object.func" } - ], - "events": [] + ] }, "path": [ { @@ -969,9 +1001,11 @@ "name": "method", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1018,9 +1052,11 @@ "name": "getter", "kind": "member", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1073,9 +1109,11 @@ "name": "setter", "kind": "member", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1122,9 +1160,11 @@ "name": "f1", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1171,9 +1211,11 @@ "name": "f3", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1224,9 +1266,11 @@ "name": "number" }, "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1277,9 +1321,11 @@ "name": "string" }, "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1330,9 +1376,11 @@ "name": "string" }, "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1389,9 +1437,11 @@ "name": "f4", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1437,9 +1487,11 @@ "todos": [], "name": "o1", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1485,9 +1537,11 @@ "name": "om1", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1595,9 +1649,11 @@ "name": "f5", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1643,9 +1699,11 @@ "todos": [], "name": "o2", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1691,9 +1749,11 @@ "name": "om2", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json index cb01e1dbb..2c76b4bf4 100644 --- a/test/fixture/es6-class.output.json +++ b/test/fixture/es6-class.output.json @@ -92,9 +92,11 @@ "name": "Foo", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -192,6 +194,8 @@ "name": "Bar", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -304,9 +308,11 @@ "memberof": "Bar", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -420,9 +426,11 @@ "memberof": "Bar", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -437,8 +445,8 @@ "namespace": "Bar#bar" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json index f75e389b3..5388784fe 100644 --- a/test/fixture/es6-default2.output.json +++ b/test/fixture/es6-default2.output.json @@ -49,9 +49,11 @@ "name": "es6-default2.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json index c1126f032..97eac7c72 100644 --- a/test/fixture/es6-import.output.json +++ b/test/fixture/es6-import.output.json @@ -163,9 +163,11 @@ "name": "multiplyTwice", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -262,9 +264,11 @@ "todos": [], "name": "es6-ext", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -431,9 +435,11 @@ "name": "simple.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index 4f88d9a69..fcef40a07 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -88,6 +88,13 @@ function functionWithRest(...someParams) { * So does this one, with types */ function functionWithRestAndType(...someParams: number) { + + /** + * This is an inner member. We are still trying to figure out + * what these are for. + * @inner + */ + var x = 10; } // FUNCTION TYPES diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index b4d8eafae..95be6730b 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -120,9 +120,11 @@ "name": "destructure", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -255,9 +257,11 @@ "name": "destructure", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -520,9 +524,11 @@ "name": "multiply", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -620,6 +626,8 @@ "name": "Sink", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -711,9 +719,11 @@ "memberof": "Sink", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -818,9 +828,11 @@ "memberof": "Sink", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -929,9 +941,11 @@ "memberof": "Sink", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1129,9 +1143,11 @@ "memberof": "Sink", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1147,6 +1163,7 @@ "namespace": "Sink#constructor" } ], + "events": [], "static": [ { "description": { @@ -1238,9 +1255,11 @@ "memberof": "Sink", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1255,8 +1274,7 @@ ], "namespace": "Sink.hello" } - ], - "events": [] + ] }, "path": [ { @@ -1424,9 +1442,11 @@ "name": "makeABasket", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1682,9 +1702,11 @@ "name": "makeASink", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1791,9 +1813,11 @@ "name": "functionWithRest", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1874,7 +1898,7 @@ "column": 0 }, "end": { - "line": 91, + "line": 98, "column": 1 } } @@ -1904,9 +1928,11 @@ "name": "functionWithRestAndType", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1972,22 +1998,22 @@ "tags": [], "loc": { "start": { - "line": 95, + "line": 102, "column": 0 }, "end": { - "line": 97, + "line": 104, "column": 3 } }, "context": { "loc": { "start": { - "line": 98, + "line": 105, "column": 0 }, "end": { - "line": 98, + "line": 105, "column": 24 } } @@ -2004,9 +2030,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2082,22 +2110,22 @@ ], "loc": { "start": { - "line": 102, + "line": 109, "column": 0 }, "end": { - "line": 105, + "line": 112, "column": 3 } }, "context": { "loc": { "start": { - "line": 106, + "line": 113, "column": 0 }, "end": { - "line": 106, + "line": 113, "column": 38 } } @@ -2174,9 +2202,11 @@ "name": "es6.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2242,22 +2272,22 @@ "tags": [], "loc": { "start": { - "line": 108, + "line": 115, "column": 0 }, "end": { - "line": 110, + "line": 117, "column": 3 } }, "context": { "loc": { "start": { - "line": 111, + "line": 118, "column": 0 }, "end": { - "line": 113, + "line": 120, "column": 1 } } @@ -2280,9 +2310,11 @@ "name": "veryImportantTransform", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2354,22 +2386,22 @@ ], "loc": { "start": { - "line": 123, + "line": 130, "column": 0 }, "end": { - "line": 126, + "line": 133, "column": 3 } }, "context": { "loc": { "start": { - "line": 127, + "line": 134, "column": 0 }, "end": { - "line": 127, + "line": 134, "column": 27 } } @@ -2387,9 +2419,11 @@ "name": "iAmProtected", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2461,22 +2495,22 @@ ], "loc": { "start": { - "line": 129, + "line": 136, "column": 0 }, "end": { - "line": 132, + "line": 139, "column": 3 } }, "context": { "loc": { "start": { - "line": 133, + "line": 140, "column": 0 }, "end": { - "line": 133, + "line": 140, "column": 24 } } @@ -2494,9 +2528,11 @@ "name": "iAmPublic", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2562,22 +2598,22 @@ "tags": [], "loc": { "start": { - "line": 141, + "line": 148, "column": 0 }, "end": { - "line": 143, + "line": 150, "column": 3 } }, "context": { "loc": { "start": { - "line": 144, + "line": 151, "column": 0 }, "end": { - "line": 144, + "line": 151, "column": 42 } } @@ -2593,9 +2629,11 @@ "todos": [], "name": "execute", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2660,22 +2698,22 @@ "tags": [], "loc": { "start": { - "line": 146, + "line": 153, "column": 0 }, "end": { - "line": 146, + "line": 153, "column": 32 } }, "context": { "loc": { "start": { - "line": 147, + "line": 154, "column": 0 }, "end": { - "line": 153, + "line": 160, "column": 1 } } @@ -2687,7 +2725,7 @@ { "title": "param", "name": "array1", - "lineNumber": 148, + "lineNumber": 155, "type": { "type": "TypeApplication", "expression": { @@ -2705,7 +2743,7 @@ { "title": "param", "name": "array2", - "lineNumber": 149, + "lineNumber": 156, "type": { "type": "TypeApplication", "expression": { @@ -2770,9 +2808,11 @@ "name": "isArrayEqualWith", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/event.output.json b/test/fixture/event.output.json index e34cd3413..5db9fa967 100644 --- a/test/fixture/event.output.json +++ b/test/fixture/event.output.json @@ -245,9 +245,11 @@ "kind": "event", "name": "Map#mousemove", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/example-caption.output.json b/test/fixture/example-caption.output.json index fba5a26bd..fbe9d6d85 100644 --- a/test/fixture/example-caption.output.json +++ b/test/fixture/example-caption.output.json @@ -219,9 +219,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/external.output.json b/test/fixture/external.output.json index b7f770108..92a116ccc 100644 --- a/test/fixture/external.output.json +++ b/test/fixture/external.output.json @@ -121,9 +121,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json index 1b16eea16..8173663b3 100644 --- a/test/fixture/factory.output.json +++ b/test/fixture/factory.output.json @@ -157,9 +157,11 @@ "name": "area", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -220,9 +222,11 @@ "kind": "class", "name": "area", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -340,9 +344,11 @@ "memberof": "chart", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index c5ce6d5fa..534109b8d 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -97,6 +97,7 @@

    documentation

+
  • Events
  • @@ -175,6 +176,7 @@

    documentation

+ @@ -202,6 +204,7 @@

documentation

+ diff --git a/test/fixture/html/nested.output.files b/test/fixture/html/nested.output.files index 0e7da8b2b..13a20901c 100644 --- a/test/fixture/html/nested.output.files +++ b/test/fixture/html/nested.output.files @@ -87,6 +87,7 @@ +
  • Events
  • @@ -165,6 +166,7 @@
+ @@ -192,6 +194,7 @@ + diff --git a/test/fixture/infer-private.output.json b/test/fixture/infer-private.output.json index 238054aec..431535636 100644 --- a/test/fixture/infer-private.output.json +++ b/test/fixture/infer-private.output.json @@ -87,6 +87,8 @@ "name": "C", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -178,9 +180,11 @@ "memberof": "C", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -196,8 +200,8 @@ "namespace": "C#m" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json index ceffdaf3c..e0c55a4c5 100644 --- a/test/fixture/inheritance.output.json +++ b/test/fixture/inheritance.output.json @@ -92,9 +92,11 @@ "name": "SpecialArray", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -161,9 +163,11 @@ "memberof": "module", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/inline-link.output.json b/test/fixture/inline-link.output.json index 8d6da3d3b..95ae461d5 100644 --- a/test/fixture/inline-link.output.json +++ b/test/fixture/inline-link.output.json @@ -229,9 +229,11 @@ "name": "addOne", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -650,9 +652,11 @@ "name": "inline-link.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/internal.output.json b/test/fixture/internal.output.json index b7f770108..92a116ccc 100644 --- a/test/fixture/internal.output.json +++ b/test/fixture/internal.output.json @@ -121,9 +121,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/literal_types.output.json b/test/fixture/literal_types.output.json index 05a2aec1e..858b92501 100644 --- a/test/fixture/literal_types.output.json +++ b/test/fixture/literal_types.output.json @@ -107,9 +107,11 @@ "name": "f", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -191,9 +193,11 @@ "name": "g", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json index 5f744fd15..23a82c5cf 100644 --- a/test/fixture/memberedclass.output.json +++ b/test/fixture/memberedclass.output.json @@ -106,6 +106,8 @@ "name": "MyClass", "memberof": "com.Test", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -339,9 +341,11 @@ "memberof": "com.Test.MyClass", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -357,6 +361,7 @@ "namespace": "MyClass#getFoo" } ], + "events": [], "static": [ { "description": { @@ -516,9 +521,11 @@ "memberof": "com.Test.MyClass", "scope": "static", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -533,8 +540,7 @@ ], "namespace": "MyClass.getUndefined" } - ], - "events": [] + ] }, "path": [ { diff --git a/test/fixture/merge-infered-type.output.json b/test/fixture/merge-infered-type.output.json index 34a57c58b..61f6b15c2 100644 --- a/test/fixture/merge-infered-type.output.json +++ b/test/fixture/merge-infered-type.output.json @@ -257,9 +257,11 @@ "name": "addFive", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/meta.output.json b/test/fixture/meta.output.json index d1f4d258b..8181094f5 100644 --- a/test/fixture/meta.output.json +++ b/test/fixture/meta.output.json @@ -232,9 +232,11 @@ "name": "meta.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json index aa98ebe77..ba7426e9a 100644 --- a/test/fixture/multisignature.output.json +++ b/test/fixture/multisignature.output.json @@ -163,9 +163,11 @@ "name": "getTheTime", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -403,9 +405,11 @@ "name": "getTheTime", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json index 9c910f9b3..a8f367ebd 100644 --- a/test/fixture/nearby_params.output.json +++ b/test/fixture/nearby_params.output.json @@ -512,9 +512,11 @@ "kind": "function", "name": "sessions.create", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json index d45d2b42d..265b19938 100644 --- a/test/fixture/nest_params.output.json +++ b/test/fixture/nest_params.output.json @@ -350,9 +350,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -821,9 +823,11 @@ "todos": [], "name": "foo", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json index ea76bdb60..11dac1a0d 100644 --- a/test/fixture/newline-in-description.output.json +++ b/test/fixture/newline-in-description.output.json @@ -168,9 +168,11 @@ "throws": [], "todos": [], "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [], "namespace": "" diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json index 5bbbeaefb..79026c20e 100644 --- a/test/fixture/no-name.output.json +++ b/test/fixture/no-name.output.json @@ -110,9 +110,11 @@ "throws": [], "todos": [], "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [], "namespace": "" diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json index b39cb57d2..2f633ef1e 100644 --- a/test/fixture/optional-record-field-type.output.json +++ b/test/fixture/optional-record-field-type.output.json @@ -82,9 +82,11 @@ ] }, "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index ec85f63aa..4cad94599 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -194,9 +194,11 @@ "name": "addThem", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -381,9 +383,11 @@ "name": "fishesAndFoxes", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -506,9 +510,11 @@ "name": "withDefault", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -606,6 +612,8 @@ "name": "Foo", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -770,9 +778,11 @@ "memberof": "Foo", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -788,8 +798,8 @@ "namespace": "Foo#method" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1248,9 +1258,11 @@ "kind": "class", "name": "Address6", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -1797,9 +1809,11 @@ "kind": "class", "name": "GeoJSONSource", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2047,9 +2061,11 @@ "name": "myfunc", "kind": "constant", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -2217,9 +2233,11 @@ "name": "foo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/polyglot/blend.json b/test/fixture/polyglot/blend.json index 2f77adbc8..ab09462fa 100644 --- a/test/fixture/polyglot/blend.json +++ b/test/fixture/polyglot/blend.json @@ -182,9 +182,11 @@ "todos": [], "name": "hexToUInt32Color", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json index 298cf5575..1ffc1ba8f 100644 --- a/test/fixture/react-jsx.output.json +++ b/test/fixture/react-jsx.output.json @@ -87,9 +87,11 @@ "name": "apples", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json index 453b89139..f03bd9afb 100644 --- a/test/fixture/simple-hashbang.output.json +++ b/test/fixture/simple-hashbang.output.json @@ -157,9 +157,11 @@ "name": "simple-hashbang.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json index 9036ad0da..a6d86ceea 100644 --- a/test/fixture/simple-two.output.json +++ b/test/fixture/simple-two.output.json @@ -238,9 +238,11 @@ "name": "returnTwo", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json index 14359fd38..fee8d21ce 100644 --- a/test/fixture/simple.output.github.json +++ b/test/fixture/simple.output.github.json @@ -158,9 +158,11 @@ "name": "simple.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json index 5637943ad..94432e345 100644 --- a/test/fixture/simple.output.json +++ b/test/fixture/simple.output.json @@ -157,9 +157,11 @@ "name": "simple.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json index f4e2faf10..c2ae8e8f9 100644 --- a/test/fixture/sort-order-alpha.output.json +++ b/test/fixture/sort-order-alpha.output.json @@ -36,9 +36,11 @@ "name": "a", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -85,9 +87,11 @@ "name": "b", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -134,6 +138,8 @@ "name": "C", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": "", @@ -174,9 +180,11 @@ "memberof": "C", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -230,9 +238,11 @@ "memberof": "C", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -286,9 +296,11 @@ "memberof": "C", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -342,9 +354,11 @@ "memberof": "C", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -360,8 +374,8 @@ "namespace": "C#A" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -408,6 +422,8 @@ "name": "D", "kind": "class", "members": { + "global": [], + "inner": [], "instance": [ { "description": "", @@ -448,9 +464,11 @@ "memberof": "D", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -504,9 +522,11 @@ "memberof": "D", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -560,9 +580,11 @@ "memberof": "D", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -616,9 +638,11 @@ "memberof": "D", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -634,8 +658,8 @@ "namespace": "D#A" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/sorting/output.json b/test/fixture/sorting/output.json index 705f499b8..65df1ea6f 100644 --- a/test/fixture/sorting/output.json +++ b/test/fixture/sorting/output.json @@ -87,9 +87,11 @@ "name": "bananas", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -187,9 +189,11 @@ "name": "carrots", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -287,9 +291,11 @@ "name": "apples", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json index f159e0ba9..a92400ba9 100644 --- a/test/fixture/string-literal-key.output.json +++ b/test/fixture/string-literal-key.output.json @@ -44,9 +44,11 @@ "name": "MyContainerObject", "kind": "constant", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -143,9 +145,11 @@ "todos": [], "name": "foo", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json index 5637943ad..94432e345 100644 --- a/test/fixture/system-import.output.json +++ b/test/fixture/system-import.output.json @@ -157,9 +157,11 @@ "name": "simple.input", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json index 6441556d2..b62cb5464 100644 --- a/test/fixture/this-class.output.json +++ b/test/fixture/this-class.output.json @@ -50,9 +50,11 @@ "kind": "module", "name": "bookshelf", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -112,6 +114,8 @@ "kind": "class", "name": "Book", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -202,9 +206,11 @@ "memberof": "Book", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -219,8 +225,8 @@ "namespace": "Book#title" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -280,6 +286,8 @@ "kind": "class", "name": "BookShelf", "members": { + "global": [], + "inner": [], "instance": [ { "description": { @@ -370,9 +378,11 @@ "memberof": "BookShelf", "scope": "instance", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { @@ -387,8 +397,8 @@ "namespace": "BookShelf#title" } ], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json index 50d5dcb33..d2c81ef6a 100644 --- a/test/fixture/type_application.output.json +++ b/test/fixture/type_application.output.json @@ -185,9 +185,11 @@ "kind": "class", "name": "Address6", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json index 66d9c42c1..be9937633 100644 --- a/test/fixture/var-function-param-return.output.json +++ b/test/fixture/var-function-param-return.output.json @@ -54,9 +54,11 @@ "name": "f", "kind": "function", "members": { + "global": [], + "inner": [], "instance": [], - "static": [], - "events": [] + "events": [], + "static": [] }, "path": [ { From d884fc725e67577041b18748592e46b2d415ee15 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 29 Jan 2017 18:54:35 -0500 Subject: [PATCH 007/555] Support deprecated tag --- default_theme/section._ | 15 +- lib/output/markdown_ast.js | 4 +- lib/parse.js | 6 +- test/fixture/html/nested.config-output.html | 402 +------------------- test/fixture/html/nested.output.files | 402 +------------------- 5 files changed, 49 insertions(+), 780 deletions(-) diff --git a/default_theme/section._ b/default_theme/section._ index a75159b83..4ef057fee 100644 --- a/default_theme/section._ +++ b/default_theme/section._ @@ -24,7 +24,7 @@ <%= formatType(section.type) %>

<% } %> - <% if (section.augments) { %> + <% if (section.augments.length) { %>

Extends <% if (section.augments) { %> @@ -35,13 +35,14 @@

<% } %> + <% if (section.deprecated) { %>
Deprecated: <%= md(section.deprecated, true) %>
<% }%> <% if (section.version) { %>
Version: <%- section.version %>
<% }%> <% if (section.license) { %>
License: <%- section.license %>
<% }%> <% if (section.author) { %>
Author: <%- section.author %>
<% }%> - <% if (section.copyright) { %>
Copyright: <%- section.copyright %>
<% }%> + <% if (section.copyright) { %>
Copyright: <%= md(section.copyright, true) %>
<% }%> <% if (section.since) { %>
Since: <%- section.since %>
<% }%> - <% if (section.params) { %> + <% if (section.params.length) { %>
Parameters
<% section.params.forEach(function(param) { %> @@ -81,7 +82,7 @@
<% } %> - <% if (section.properties) { %> + <% if (section.properties.length) { %>
Properties
<% section.properties.forEach(function(property) { %> @@ -108,7 +109,7 @@
<% } %> - <% if (section.returns) { %> + <% if (section.returns.length) { %> <% section.returns.forEach(function(ret) { %>
Returns
<%= formatType(ret.type) %><% if (ret.description) { %>: @@ -117,7 +118,7 @@ <% }) %> <% } %> - <% if (section.throws) { %> + <% if (section.throws.length) { %>
Throws
    <% section.throws.forEach(function(throws) { %> @@ -126,7 +127,7 @@
<% } %> - <% if (section.examples) { %> + <% if (section.examples.length) { %>
Example
<% section.examples.forEach(function(example) { %> <% if (example.caption) { %>

<%= md(example.caption) %>

<% } %> diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index 8c9748fb4..4058603f4 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -174,14 +174,14 @@ function buildMarkdownAST(comments/*: Array */, config/*: Documentation } function metaSection(comment/*: Comment */) { - let meta = ['version', 'since', 'copyright', 'author', 'license'] + let meta = ['version', 'since', 'copyright', 'author', 'license', 'deprecated'] .filter(tag => comment[tag]); return !!meta.length && [u('strong', [u('text', 'Meta')])].concat( u('list', { ordered: false }, meta .map(tag => { let metaContent; - if (tag === 'copyright') { + if (tag === 'copyright' || tag === 'deprecated') { metaContent = comment[tag]; } else { metaContent = u('text', comment[tag]); diff --git a/lib/parse.js b/lib/parse.js index 176f99032..1b859a56b 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -77,7 +77,11 @@ var flatteners = { 'copyright': flattenMarkdownDescription, 'default': todo, 'defaultvalue': synonym('default'), - 'deprecated': flattenMarkdownDescription, + deprecated(result, tag) { + let description = tag.description || 'This is deprecated.'; + result.deprecated = parseMarkdown(description); + }, + flattenMarkdownDescription, 'desc': synonym('description'), 'description': flattenMarkdownDescription, 'emits': synonym('fires'), diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index 534109b8d..0367dc120 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -279,6 +279,7 @@

+
Parameters
@@ -296,27 +297,12 @@

-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- -
Static Members
@@ -342,19 +328,13 @@

isClass(other: Object, also: any): boolean
-

- Extends - - - -

- +
Parameters
@@ -380,11 +360,6 @@

-
Properties
-
- -
- @@ -397,16 +372,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -437,19 +404,13 @@

isWeird(other: Weird): boolean
-

- Extends - - - -

- +
Parameters
@@ -467,11 +428,6 @@

-
Properties
-
- -
- @@ -484,16 +440,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -523,19 +471,13 @@

isBuffer(buf: (Buffer | string), size: number?): boolean
-

- Extends - - - -

- +
Parameters
@@ -563,11 +505,6 @@

-
Properties
-
- -
- @@ -580,16 +517,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -619,19 +548,13 @@

isArrayOfBuffers(buffers: Array<Buffer>): number
-

- Extends - - - -

- +
Parameters
@@ -650,11 +573,6 @@

-
Properties
-
- -
- @@ -667,11 +585,6 @@

-
Throws
-
    - -
-
Example
@@ -710,48 +623,22 @@

MAGIC_NUMBER
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -790,32 +677,16 @@

getFoo(): Number
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -829,11 +700,6 @@

-
Throws
-
    - -
-
Example
@@ -872,19 +738,13 @@

withOptions(options: Object, otherOptions: number?)
-

- Extends - - - -

- +
Parameters
@@ -938,27 +798,12 @@

-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- - @@ -996,48 +841,22 @@

event
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1077,19 +896,13 @@

CustomError(other: any, also: any)
-

- Extends - - - -

- +
Parameters
@@ -1143,20 +956,10 @@

- - -
Throws
-
    - -
- -
Example
- - @@ -1189,32 +992,16 @@

bar(): Klass
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1228,16 +1015,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1268,19 +1047,13 @@

bar(toys: ...Number): undefined
-

- Extends - - - -

- +
Parameters
@@ -1298,11 +1071,6 @@

-
Properties
-
- -
- @@ -1315,16 +1083,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1357,32 +1117,16 @@

bar(): undefined
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1396,16 +1140,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1436,48 +1172,22 @@

new Foo()
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1504,48 +1214,22 @@

bar
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1587,48 +1271,22 @@

customStreams
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1653,48 +1311,22 @@

new passthrough()
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + diff --git a/test/fixture/html/nested.output.files b/test/fixture/html/nested.output.files index 13a20901c..42111c5aa 100644 --- a/test/fixture/html/nested.output.files +++ b/test/fixture/html/nested.output.files @@ -241,6 +241,7 @@ +
Parameters
@@ -258,27 +259,12 @@ -
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- -
Static Members
@@ -304,19 +290,13 @@ This is a [link to something that does not exist]DoesNotisClass(other: Object, also: any): boolean -

- Extends - - - -

- +
Parameters
@@ -342,11 +322,6 @@ This is a [link to something that does not exist]DoesNotProperties -
- -
- @@ -359,16 +334,8 @@ This is a [link to something that does not exist]DoesNotThrows -
    - -
- -
Example
- - @@ -399,19 +366,13 @@ the referenced class type

isWeird(other: Weird): boolean
-

- Extends - - - -

- +
Parameters
@@ -429,11 +390,6 @@ the referenced class type

-
Properties
-
- -
- @@ -446,16 +402,8 @@ the referenced class type

-
Throws
-
    - -
- -
Example
- - @@ -485,19 +433,13 @@ the referenced class type

isBuffer(buf: (Buffer | string), size: number?): boolean
-

- Extends - - - -

- +
Parameters
@@ -525,11 +467,6 @@ the referenced class type

-
Properties
-
- -
- @@ -542,16 +479,8 @@ the referenced class type

-
Throws
-
    - -
- -
Example
- - @@ -581,19 +510,13 @@ the referenced class type

isArrayOfBuffers(buffers: Array<Buffer>): number
-

- Extends - - - -

- +
Parameters
@@ -612,11 +535,6 @@ the referenced class type

-
Properties
-
- -
- @@ -629,11 +547,6 @@ the referenced class type

-
Throws
-
    - -
-
Example
@@ -672,48 +585,22 @@ k.isArrayOfBuffers();
MAGIC_NUMBER
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -752,32 +639,16 @@ k.isArrayOfBuffers();
getFoo(): Number
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -791,11 +662,6 @@ k.isArrayOfBuffers(); -
Throws
-
    - -
-
Example
@@ -834,19 +700,13 @@ k.isArrayOfBuffers();
withOptions(options: Object, otherOptions: number?)
-

- Extends - - - -

- +
Parameters
@@ -900,27 +760,12 @@ k.isArrayOfBuffers(); -
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- - @@ -958,48 +803,22 @@ k.isArrayOfBuffers();
event
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1039,19 +858,13 @@ k.isArrayOfBuffers();
CustomError(other: any, also: any)
-

- Extends - - - -

- +
Parameters
@@ -1105,20 +918,10 @@ k.isArrayOfBuffers(); - - -
Throws
-
    - -
- -
Example
- - @@ -1151,32 +954,16 @@ like a klass

bar(): Klass
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1190,16 +977,8 @@ like a klass

-
Throws
-
    - -
- -
Example
- - @@ -1230,19 +1009,13 @@ like a klass

bar(toys: ...Number): undefined
-

- Extends - - - -

- +
Parameters
@@ -1260,11 +1033,6 @@ like a klass

-
Properties
-
- -
- @@ -1277,16 +1045,8 @@ like a klass

-
Throws
-
    - -
- -
Example
- - @@ -1319,32 +1079,16 @@ like a klass. This needs a undefined -

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1358,16 +1102,8 @@ like a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a Object, also: any): boolean -

- Extends - - - -

- +
Parameters
@@ -380,11 +360,6 @@

-
Properties
-
- -
- @@ -397,16 +372,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -437,19 +404,13 @@

isWeird(other: Weird): boolean
-

- Extends - - - -

- +
Parameters
@@ -467,11 +428,6 @@

-
Properties
-
- -
- @@ -484,16 +440,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -523,19 +471,13 @@

isBuffer(buf: (Buffer | string), size: number?): boolean
-

- Extends - - - -

- +
Parameters
@@ -563,11 +505,6 @@

-
Properties
-
- -
- @@ -580,16 +517,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -619,19 +548,13 @@

isArrayOfBuffers(buffers: Array<Buffer>): number
-

- Extends - - - -

- +
Parameters
@@ -650,11 +573,6 @@

-
Properties
-
- -
- @@ -667,11 +585,6 @@

-
Throws
-
    - -
-
Example
@@ -710,48 +623,22 @@

MAGIC_NUMBER
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -790,32 +677,16 @@

getFoo(): Number
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -829,11 +700,6 @@

-
Throws
-
    - -
-
Example
@@ -872,19 +738,13 @@

withOptions(options: Object, otherOptions: number?)
-

- Extends - - - -

- +
Parameters
@@ -938,27 +798,12 @@

-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- - @@ -996,48 +841,22 @@

event
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1077,19 +896,13 @@

CustomError(other: any, also: any)
-

- Extends - - - -

- +
Parameters
@@ -1143,20 +956,10 @@

- - -
Throws
-
    - -
- -
Example
- - @@ -1189,32 +992,16 @@

bar(): Klass
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1228,16 +1015,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1268,19 +1047,13 @@

bar(toys: ...Number): undefined
-

- Extends - - - -

- +
Parameters
@@ -1298,11 +1071,6 @@

-
Properties
-
- -
- @@ -1315,16 +1083,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1357,32 +1117,16 @@

bar(): undefined
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1396,16 +1140,8 @@

-
Throws
-
    - -
- -
Example
- - @@ -1436,48 +1172,22 @@

new Foo()
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1504,48 +1214,22 @@

bar
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1587,48 +1271,22 @@

customStreams
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1653,48 +1311,22 @@

new passthrough()
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + diff --git a/test/fixture/html/nested.output.files b/test/fixture/html/nested.output.files index 13a20901c..42111c5aa 100644 --- a/test/fixture/html/nested.output.files +++ b/test/fixture/html/nested.output.files @@ -241,6 +241,7 @@ +
Parameters
@@ -258,27 +259,12 @@ -
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- -
Static Members
@@ -304,19 +290,13 @@ This is a [link to something that does not exist]DoesNotisClass(other: Object, also: any): boolean -

- Extends - - - -

- +
Parameters
@@ -342,11 +322,6 @@ This is a [link to something that does not exist]DoesNotProperties -
- -
- @@ -359,16 +334,8 @@ This is a [link to something that does not exist]DoesNotThrows -
    - -
- -
Example
- - @@ -399,19 +366,13 @@ the referenced class type

isWeird(other: Weird): boolean
-

- Extends - - - -

- +
Parameters
@@ -429,11 +390,6 @@ the referenced class type

-
Properties
-
- -
- @@ -446,16 +402,8 @@ the referenced class type

-
Throws
-
    - -
- -
Example
- - @@ -485,19 +433,13 @@ the referenced class type

isBuffer(buf: (Buffer | string), size: number?): boolean
-

- Extends - - - -

- +
Parameters
@@ -525,11 +467,6 @@ the referenced class type

-
Properties
-
- -
- @@ -542,16 +479,8 @@ the referenced class type

-
Throws
-
    - -
- -
Example
- - @@ -581,19 +510,13 @@ the referenced class type

isArrayOfBuffers(buffers: Array<Buffer>): number
-

- Extends - - - -

- +
Parameters
@@ -612,11 +535,6 @@ the referenced class type

-
Properties
-
- -
- @@ -629,11 +547,6 @@ the referenced class type

-
Throws
-
    - -
-
Example
@@ -672,48 +585,22 @@ k.isArrayOfBuffers();
MAGIC_NUMBER
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -752,32 +639,16 @@ k.isArrayOfBuffers();
getFoo(): Number
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -791,11 +662,6 @@ k.isArrayOfBuffers(); -
Throws
-
    - -
-
Example
@@ -834,19 +700,13 @@ k.isArrayOfBuffers();
withOptions(options: Object, otherOptions: number?)
-

- Extends - - - -

- +
Parameters
@@ -900,27 +760,12 @@ k.isArrayOfBuffers(); -
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- - @@ -958,48 +803,22 @@ k.isArrayOfBuffers();
event
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
- - - -
Throws
-
    - -
- -
Example
- + @@ -1039,19 +858,13 @@ k.isArrayOfBuffers();
CustomError(other: any, also: any)
-

- Extends - - - -

- +
Parameters
@@ -1105,20 +918,10 @@ k.isArrayOfBuffers(); - - -
Throws
-
    - -
- -
Example
- - @@ -1151,32 +954,16 @@ like a klass

bar(): Klass
-

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1190,16 +977,8 @@ like a klass

-
Throws
-
    - -
- -
Example
- - @@ -1230,19 +1009,13 @@ like a klass

bar(toys: ...Number): undefined
-

- Extends - - - -

- +
Parameters
@@ -1260,11 +1033,6 @@ like a klass

-
Properties
-
- -
- @@ -1277,16 +1045,8 @@ like a klass

-
Throws
-
    - -
- -
Example
- - @@ -1319,32 +1079,16 @@ like a klass. This needs a undefined -

- Extends - - - -

- - - -
Parameters
-
- -
-
Properties
-
- -
+ @@ -1358,16 +1102,8 @@ like a klass. This needs a klass. This needs a klass. This needs a klass. This needs a klass. This needs a + +### Table of Contents + +- [x](#x) +- [x2](#x2) +- [T](#t) +- [T2](#t2) + +## x + +x + +Type: function ([T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## x2 + +x2 + +Type: function (a: [T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## T + +T + +Type: function ([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} + +## T2 + +T2 + +Type: function (a: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} diff --git a/test/fixture/flow-unnamed-params.output.md.json b/test/fixture/flow-unnamed-params.output.md.json new file mode 100644 index 000000000..a21691184 --- /dev/null +++ b/test/fixture/flow-unnamed-params.output.md.json @@ -0,0 +1,431 @@ +{ + "type": "root", + "children": [ + { + "type": "html", + "value": "" + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "x" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "x", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 2, + "offset": 1 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 2, + "offset": 1 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Type: " + }, + { + "type": "text", + "value": "function (" + }, + { + "href": "#t", + "url": "#t", + "type": "link", + "children": [ + { + "type": "text", + "value": "T" + } + ] + }, + { + "type": "text", + "value": ")" + }, + { + "type": "text", + "value": ": " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "x2" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "x2", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 3, + "offset": 2 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 3, + "offset": 2 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Type: " + }, + { + "type": "text", + "value": "function (" + }, + { + "type": "text", + "value": "a: " + }, + { + "href": "#t", + "url": "#t", + "type": "link", + "children": [ + { + "type": "text", + "value": "T" + } + ] + }, + { + "type": "text", + "value": ")" + }, + { + "type": "text", + "value": ": " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "T" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "T", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 2, + "offset": 1 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 2, + "offset": 1 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Type: " + }, + { + "type": "text", + "value": "function (" + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": ">" + }, + { + "type": "text", + "value": ")" + }, + { + "type": "text", + "value": ": " + }, + { + "type": "text", + "value": "{" + }, + { + "type": "text", + "value": "num: " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": "}" + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "T2" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "T2", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 3, + "offset": 2 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 3, + "offset": 2 + }, + "indent": [] + } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Type: " + }, + { + "type": "text", + "value": "function (" + }, + { + "type": "text", + "value": "a: " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": ">" + }, + { + "type": "text", + "value": ")" + }, + { + "type": "text", + "value": ": " + }, + { + "type": "text", + "value": "{" + }, + { + "type": "text", + "value": "num: " + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + }, + { + "type": "text", + "value": "}" + } + ] + } + ] +} \ No newline at end of file From 802dc4cf2c4a289ae3ac001ce5e874c429b28314 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 24 Feb 2017 11:56:00 -0500 Subject: [PATCH 011/555] fix(inference): Robust parsing for shorthand object methods This extends findTarget and the membership interference steps, treating ObjectProperty within var-assigned objects the same as we did for ObjectMethods. It also adds tests that specifically test findTarget directly. Fixes https://github.com/documentationjs/documentation/issues/649 and fixes https://github.com/documentationjs/documentation/issues/678 --- lib/infer/finders.js | 8 +- lib/infer/membership.js | 23 +- test/fixture/document-exported.output.json | 558 +++++++++--------- test/fixture/document-exported.output.md | 28 +- test/fixture/document-exported.output.md.json | 48 +- test/fixture/params.input.js | 12 + test/fixture/params.output.json | 247 +++++++- test/fixture/params.output.md | 14 + test/fixture/params.output.md.json | 127 ++++ test/lib/infer/finders.js | 53 ++ 10 files changed, 792 insertions(+), 326 deletions(-) create mode 100644 test/lib/infer/finders.js diff --git a/lib/infer/finders.js b/lib/infer/finders.js index fe6808c59..8fd63f55d 100644 --- a/lib/infer/finders.js +++ b/lib/infer/finders.js @@ -22,15 +22,19 @@ function findTarget(path/*: Object */) { path = path.get('declaration'); } - // var x = init; if (t.isVariableDeclaration(path)) { + // var x = init; path = path.get('declarations')[0]; - // foo.x = TARGET } else if (t.isExpressionStatement(path)) { + // foo.x = TARGET path = path.get('expression').get('right'); + } else if (t.isObjectProperty(path)) { + // var foo = { x: TARGET }; + path = path.get('value'); } + return path.node && path; } diff --git a/lib/infer/membership.js b/lib/infer/membership.js index 3da6353c8..b5618f145 100644 --- a/lib/infer/membership.js +++ b/lib/infer/membership.js @@ -296,14 +296,23 @@ module.exports = function () { } } - // Foo = { bar() {} }; - // Foo.prototype = { bar() {} }; - // Foo.bar = { baz() {} }; + // Shorthand methods on ordinary objects if (n.isObjectMethod(path.node) && - n.isObjectExpression(path.parentPath) && - n.isAssignmentExpression(path.parentPath.parentPath)) { - identifiers = extractIdentifiers(path.parentPath.parentPath.get('left')); - if (identifiers.length >= 1) { + n.isObjectExpression(path.parentPath)) { + + // Foo = { bar() {} }; + // Foo.prototype = { bar() {} }; + // Foo.bar = { baz() {} }; + if (n.isAssignmentExpression(path.parentPath.parentPath)) { + identifiers = extractIdentifiers(path.parentPath.parentPath.get('left')); + if (identifiers.length >= 1) { + inferMembershipFromIdentifiers(comment, identifiers); + } + } + + // var Foo = { bar() {} }; + if (n.isVariableDeclarator(path.parentPath.parentPath)) { + identifiers = [path.parentPath.parentPath.get('id').node.name]; inferMembershipFromIdentifiers(comment, identifiers); } } diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json index 671a4b4a1..f44342daf 100644 --- a/test/fixture/document-exported.output.json +++ b/test/fixture/document-exported.output.json @@ -843,6 +843,183 @@ "instance": [], "events": [], "static": [ + { + "description": "", + "tags": [], + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "context": { + "loc": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 13, + "column": 13 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "method", + "kind": "function", + "memberof": "object", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "object" + }, + { + "name": "method", + "kind": "function", + "scope": "static" + } + ], + "namespace": "object.method" + }, + { + "description": "", + "tags": [], + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 17 + } + }, + "context": { + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 14, + "column": 17 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "getter", + "kind": "member", + "memberof": "object", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "object" + }, + { + "name": "getter", + "kind": "member", + "scope": "static" + } + ], + "namespace": "object.getter" + }, + { + "description": "", + "tags": [], + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 18 + } + }, + "context": { + "loc": { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 18 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "v", + "lineNumber": 15 + } + ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "setter", + "kind": "member", + "memberof": "object", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "object" + }, + { + "name": "setter", + "kind": "member", + "scope": "static" + } + ], + "namespace": "object.setter" + }, { "description": "", "tags": [], @@ -964,165 +1141,6 @@ ], "namespace": "object" }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 13 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "method", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "method", - "kind": "function" - } - ], - "namespace": "method" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "getter", - "kind": "member", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "getter", - "kind": "member" - } - ], - "namespace": "getter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 15 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "setter", - "kind": "member", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "setter", - "kind": "member" - } - ], - "namespace": "setter" - }, { "description": "", "tags": [], @@ -1491,7 +1509,65 @@ "inner": [], "instance": [], "events": [], - "static": [] + "static": [ + { + "description": "", + "tags": [], + "loc": { + "start": { + "line": 73, + "column": 2 + }, + "end": { + "line": 73, + "column": 10 + } + }, + "context": { + "loc": { + "start": { + "line": 73, + "column": 2 + }, + "end": { + "line": 73, + "column": 10 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "om1", + "kind": "function", + "memberof": "o1", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "o1" + }, + { + "name": "om1", + "kind": "function", + "scope": "static" + } + ], + "namespace": "o1.om1" + } + ] }, "path": [ { @@ -1500,57 +1576,6 @@ ], "namespace": "o1" }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - }, - "context": { - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om1", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "om1", - "kind": "function" - } - ], - "namespace": "om1" - }, { "description": { "type": "root", @@ -1703,7 +1728,65 @@ "inner": [], "instance": [], "events": [], - "static": [] + "static": [ + { + "description": "", + "tags": [], + "loc": { + "start": { + "line": 79, + "column": 4 + }, + "end": { + "line": 79, + "column": 12 + } + }, + "context": { + "loc": { + "start": { + "line": 79, + "column": 4 + }, + "end": { + "line": 79, + "column": 12 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "om2", + "kind": "function", + "memberof": "o2", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "o2" + }, + { + "name": "om2", + "kind": "function", + "scope": "static" + } + ], + "namespace": "o2.om2" + } + ] }, "path": [ { @@ -1711,56 +1794,5 @@ } ], "namespace": "o2" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - }, - "context": { - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om2", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "om2", - "kind": "function" - } - ], - "namespace": "om2" } ] \ No newline at end of file diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md index c87825624..67a06f971 100644 --- a/test/fixture/document-exported.output.md +++ b/test/fixture/document-exported.output.md @@ -16,11 +16,11 @@ - [y2Default](#y2default) - [y4](#y4) - [object](#object) + - [method](#method) + - [getter](#getter) + - [setter](#setter) - [prop](#prop) - [func](#func) -- [method](#method) -- [getter](#getter) -- [setter](#setter) - [f1](#f1) - [f3](#f3) - [T](#t) @@ -28,10 +28,10 @@ - [T4](#t4) - [f4](#f4) - [o1](#o1) -- [om1](#om1) + - [om1](#om1) - [f5](#f5) - [o2](#o2) -- [om2](#om2) + - [om2](#om2) ## z @@ -83,20 +83,20 @@ Returns **void** ## object -### prop - -### func - -## method +### method -## getter +### getter -## setter +### setter **Parameters** - `v` +### prop + +### func + ## f1 ## f3 @@ -121,7 +121,7 @@ Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference ## o1 -## om1 +### om1 ## f5 @@ -133,4 +133,4 @@ f5 comment ## o2 -## om2 +### om2 diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json index ad889a0a2..c694294c2 100644 --- a/test/fixture/document-exported.output.md.json +++ b/test/fixture/document-exported.output.md.json @@ -389,26 +389,6 @@ { "depth": 3, "type": "heading", - "children": [ - { - "type": "text", - "value": "prop" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "func" - } - ] - }, - { - "depth": 2, - "type": "heading", "children": [ { "type": "text", @@ -417,7 +397,7 @@ ] }, { - "depth": 2, + "depth": 3, "type": "heading", "children": [ { @@ -427,7 +407,7 @@ ] }, { - "depth": 2, + "depth": 3, "type": "heading", "children": [ { @@ -473,6 +453,26 @@ } ] }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "prop" + } + ] + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "func" + } + ] + }, { "depth": 2, "type": "heading", @@ -650,7 +650,7 @@ ] }, { - "depth": 2, + "depth": 3, "type": "heading", "children": [ { @@ -761,7 +761,7 @@ ] }, { - "depth": 2, + "depth": 3, "type": "heading", "children": [ { diff --git a/test/fixture/params.input.js b/test/fixture/params.input.js index 28bea72b6..4b5d53bc8 100644 --- a/test/fixture/params.input.js +++ b/test/fixture/params.input.js @@ -34,6 +34,18 @@ class Foo { } } +/** + * Traditional object + */ +var TraditionalObject = { + /** + * This method should acquire the param x + */ + traditionalMethod: function (x) { + return x; + } +}; + /** * Represents an IPv6 address * diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index 4cad94599..1f02a2ee2 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -809,6 +809,221 @@ ], "namespace": "Foo" }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Traditional object", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 37, + "column": 0 + }, + "end": { + "line": 39, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 40, + "column": 0 + }, + "end": { + "line": 47, + "column": 2 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "TraditionalObject", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method should acquire the param x", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 39, + "offset": 38 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 39, + "offset": 38 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 39, + "offset": 38 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 41, + "column": 2 + }, + "end": { + "line": 43, + "column": 5 + } + }, + "context": { + "loc": { + "start": { + "line": 44, + "column": 2 + }, + "end": { + "line": 46, + "column": 3 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "x", + "lineNumber": 44 + } + ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "traditionalMethod", + "kind": "function", + "memberof": "TraditionalObject", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "TraditionalObject" + }, + { + "name": "traditionalMethod", + "kind": "function", + "scope": "static" + } + ], + "namespace": "TraditionalObject.traditionalMethod" + } + ] + }, + "path": [ + { + "name": "TraditionalObject" + } + ], + "namespace": "TraditionalObject" + }, { "description": { "type": "root", @@ -965,22 +1180,22 @@ ], "loc": { "start": { - "line": 37, + "line": 49, "column": 0 }, "end": { - "line": 48, + "line": 60, "column": 3 } }, "context": { "loc": { "start": { - "line": 49, + "line": 61, "column": 0 }, "end": { - "line": 49, + "line": 61, "column": 22 } } @@ -1443,22 +1658,22 @@ ], "loc": { "start": { - "line": 51, + "line": 63, "column": 0 }, "end": { - "line": 62, + "line": 74, "column": 3 } }, "context": { "loc": { "start": { - "line": 63, + "line": 75, "column": 0 }, "end": { - "line": 65, + "line": 77, "column": 1 } } @@ -1903,22 +2118,22 @@ ], "loc": { "start": { - "line": 67, + "line": 79, "column": 0 }, "end": { - "line": 74, + "line": 86, "column": 3 } }, "context": { "loc": { "start": { - "line": 75, + "line": 87, "column": 0 }, "end": { - "line": 75, + "line": 87, "column": 37 } } @@ -2143,22 +2358,22 @@ ], "loc": { "start": { - "line": 77, + "line": 89, "column": 0 }, "end": { - "line": 82, + "line": 94, "column": 3 } }, "context": { "loc": { "start": { - "line": 83, + "line": 95, "column": 0 }, "end": { - "line": 85, + "line": 97, "column": 1 } } diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md index e0395b3fb..aed20ddb1 100644 --- a/test/fixture/params.output.md +++ b/test/fixture/params.output.md @@ -7,6 +7,8 @@ - [withDefault](#withdefault) - [Foo](#foo) - [method](#method) +- [TraditionalObject](#traditionalobject) + - [traditionalMethod](#traditionalmethod) - [Address6](#address6) - [GeoJSONSource](#geojsonsource) - [myfunc](#myfunc) @@ -56,6 +58,18 @@ The method - `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method +## TraditionalObject + +Traditional object + +### traditionalMethod + +This method should acquire the param x + +**Parameters** + +- `x` + ## Address6 Represents an IPv6 address diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json index 36439eb13..69bff4d98 100644 --- a/test/fixture/params.output.md.json +++ b/test/fixture/params.output.md.json @@ -761,6 +761,133 @@ } ] }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "TraditionalObject" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Traditional object", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "traditionalMethod" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This method should acquire the param x", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 39, + "offset": 38 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 39, + "offset": 38 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "x" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, { "depth": 2, "type": "heading", diff --git a/test/lib/infer/finders.js b/test/lib/infer/finders.js new file mode 100644 index 000000000..f591ffe0d --- /dev/null +++ b/test/lib/infer/finders.js @@ -0,0 +1,53 @@ +'use strict'; + +var test = require('tap').test, + parse = require('../../../lib/parsers/javascript'), + findTarget = require('../../../lib/infer/finders').findTarget; + +function toComment(fn) { + + if (typeof fn == 'function') { + fn = '(' + fn.toString() + ')'; + } + + return parse({ + source: fn + }, {})[0]; +} + +function evaluate(fn, re) { + return toComment(fn); +} + +test('findTarget', function (t) { + t.equal(findTarget(toComment(function () { + /** Test */ + var x = 10; + }).context.ast).type, 'VariableDeclarator', 'variable declarator'); + + t.equal(findTarget(toComment(function () { + var z = {}; + + /** Test */ + z.y = 10; + }).context.ast).type, 'NumericLiteral', 'assigned object value'); + + t.equal(findTarget(toComment(function () { + var z = { + /** Test */ + y: 10 + }; + }).context.ast).type, 'NumericLiteral', 'object property'); + + t.equal(findTarget(toComment(` + /** Test */ + export var z = 10; + `).context.ast).type, 'VariableDeclarator', 'variable declarator in export'); + + t.equal(findTarget(toComment(` + /** Test */ + export default 10; + `).context.ast).type, 'NumericLiteral', 'default export'); + + t.end(); +}); From 84c9215811f38b6133e9b15a85a98fccba04f3d3 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 24 Feb 2017 15:36:55 -0500 Subject: [PATCH 012/555] fix(inference): Refactor membership inference - Tags with `@lends` are now filtered out early on, so they never generate documentation. Lends tags are structural hints only. - Uses built-in type checks instead of babel-types where appropriate. - More internal documentation - Now reuses code for parsing lends between different forms Previously broken syntax, now working: ```js /** parent */ export default function() { /** child */ this.a = 1; } ``` --- lib/infer/membership.js | 258 ++++--- lib/is_jsdoc_comment.js | 2 +- lib/module_filters.js | 1 - lib/parsers/javascript.js | 3 +- test/fixture/default-export-function.input.js | 5 + .../default-export-function.output.json | 214 ++++++ .../fixture/default-export-function.output.md | 14 + .../default-export-function.output.md.json | 99 +++ ...exported-export-default-object.output.json | 14 +- test/fixture/es6.input.js | 1 + test/fixture/lends.input.js | 26 + test/fixture/lends.output.json | 630 ++++++++++++++++++ test/fixture/lends.output.md | 33 + test/fixture/lends.output.md.json | 466 +++++++++++++ test/lib/infer/membership.js | 14 +- test/lib/parse.js | 8 - 16 files changed, 1655 insertions(+), 133 deletions(-) create mode 100644 test/fixture/default-export-function.input.js create mode 100644 test/fixture/default-export-function.output.json create mode 100644 test/fixture/default-export-function.output.md create mode 100644 test/fixture/default-export-function.output.md.json create mode 100644 test/fixture/lends.input.js create mode 100644 test/fixture/lends.output.json create mode 100644 test/fixture/lends.output.md create mode 100644 test/fixture/lends.output.md.json diff --git a/lib/infer/membership.js b/lib/infer/membership.js index b5618f145..062dad3c4 100644 --- a/lib/infer/membership.js +++ b/lib/infer/membership.js @@ -7,24 +7,31 @@ var n = require('babel-types'), isJSDocComment = require('../../lib/is_jsdoc_comment'), parse = require('../../lib/parse'); +function inferModuleName(comment) { + return (comment.kind === 'module' && comment.name) || + pathParse(comment.context.file).name; +} + /** * Given an AST node, try to find a comment in front of it that * has a `lends` tag, and if it has that, return the tag, split by * .s. * * @private - * @param {Object} node AST node + * @param {Object} path AST node * @returns {string|undefined} lends identifier, if any */ -function findLendsIdentifiers(node) { - if (!node || !node.leadingComments) { +function findLendsIdentifiers(path) { + if (!path || !path.get('leadingComments')) { return; } - for (var i = 0; i < node.leadingComments.length; i++) { - var comment = node.leadingComments[i]; - if (isJSDocComment(comment)) { - var lends = parse(comment.value).lends; + var leadingComments = path.get('leadingComments'); + + for (var i = 0; i < leadingComments.length; i++) { + var comment = leadingComments[i]; + if (isJSDocComment(comment.node)) { + var lends = parse(comment.node.value).lends; if (lends) { return lends.split('.'); } @@ -33,13 +40,16 @@ function findLendsIdentifiers(node) { } /** - * Extract and return the identifiers for expressions of type this.foo + * Extract and return the identifiers for expressions of + * type this.foo * - * @param {NodePath} path AssignmentExpression, MemberExpression, or Identifier + * @param {NodePath} path AssignmentExpression, MemberExpression, + * or Identifier + * @param {Comment} comment * @returns {Array} identifiers * @private */ -function extractThis(path) { +function extractThis(path, comment) { var identifiers = []; path.traverse({ @@ -60,14 +70,22 @@ function extractThis(path) { identifiers.push(scope.path.parentPath.parentPath.node.id.name, 'prototype'); } + // function OldClass() { this.foo = 1 } if (n.isFunctionDeclaration(scope.block)) { - identifiers.push(scope.block.id.name, 'prototype'); - } else if (n.isFunctionExpression(scope.block)) { - if (n.isVariableDeclarator(scope.path.parentPath)) { + // named function like + // function OldClass() { ... } + if (scope.block.id) { + identifiers.push(scope.block.id.name, 'prototype'); + } else if (n.isExportDefaultDeclaration(path.scope.parentBlock)) { + identifiers.push(inferModuleName(comment)); + } + // var Binding = function OldClass() { this.foo = 1 } + } else if (n.isFunctionExpression((scope.block))) { + if (scope.path.parentPath.isVariableDeclarator()) { /** var Bar = function(foo) { this.foo = foo; }; */ identifiers = identifiers .concat(scope.path.parentPath.get('id').node.name).concat('prototype'); - } else if (n.isAssignmentExpression(scope.path.parentPath)) { + } else if (scope.path.parentPath.isAssignmentExpression()) { /** this.Bar = function(foo) { this.foo = foo; }; */ identifiers = identifiers .concat(extractIdentifiers(scope.path.parentPath.get('left'))).concat('prototype'); @@ -169,10 +187,6 @@ function normalizeMemberof(comment/*: Comment*/)/*: Comment */ { module.exports = function () { var currentModule; - function inferModuleName(comment) { - return (comment.kind === 'module' && comment.name) || - pathParse(comment.context.file).name; - } /** * Set `memberof` and `instance`/`static` tags on `comment` based on the @@ -185,13 +199,13 @@ module.exports = function () { * @param {Array} identifiers array of identifier names * @param {string} explicitScope if derived from an es6 class, whether or * not this method had the static keyword - * @returns {undefined} mutates `comment` + * @returns {Comment} returns mutated `comment` * @private */ function inferMembershipFromIdentifiers(comment, identifiers, explicitScope) { if (identifiers.length === 1 && identifiers[0] === 'module' && comment.name === 'exports') { comment.name = inferModuleName(currentModule || comment); - return; + return comment; } /* @@ -215,142 +229,166 @@ module.exports = function () { comment.scope = 'static'; } } + return comment; } - return function inferMembership(comment/*: Comment */) { - + function shouldSkipInference(comment/*: Comment */)/*: boolean */ { + // If someone uses the @name tag, they explicitly ask for inference + // to be skipped. if (comment.tags.some(tag => tag.title === 'name')) { - return comment; + return true; } - if (comment.kind === 'module') { - currentModule = comment; + // Lends tags are go-betweens that let people reassign membership + // in bulk: they themselves don't get an inference step + if (comment.lends) { + return true; } - if (comment.lends) { + // If this chunk doesn't have code attached, like if it was the result + // of a polyglot parse, don't try to infer anything. + if (!comment.context.ast) { + return true; + } + + return false; + } + + return function inferMembership(comment/*: Comment */) { + + // First skip inference if the user indicates it or if it isn't possible. + if (shouldSkipInference(comment)) { return comment; } + // If someone explicitly specifies the parent of this chunk, don't + // try to infer it, just return what they specified. if (comment.memberof) { return normalizeMemberof(comment); } - if (!comment.context.ast) { - return comment; + if (comment.kind === 'module') { + currentModule = comment; } var path = comment.context.ast; - var identifiers; - + // INFERENCE =============================================================== // Deal with an oddity of espree: the jsdoc comment is attached to a different // node in the two expressions `a.b = c` vs `a.b = function () {}`. - if (n.isExpressionStatement(path.node) && - n.isAssignmentExpression(path.node.expression) && - n.isMemberExpression(path.node.expression.left)) { + if (path.isExpressionStatement() && + path.get('expression').isAssignmentExpression() && + path.get('expression').get('left').isMemberExpression()) { path = path.get('expression').get('left'); } // Same as above but for `b: c` vs `b: function () {}`. - if (n.isObjectProperty(path.node) && - n.isIdentifier(path.node.key)) { + if (path.isObjectProperty() && + path.get('key').isIdentifier()) { path = path.get('key'); } + // Forms: + // // Foo.bar = ...; // Foo.prototype.bar = ...; // Foo.bar.baz = ...; - if (n.isMemberExpression(path.node)) { - identifiers = [].concat( - extractThis(path), + // + // Lends is not supported in this codepath. + if (path.isMemberExpression()) { + var memberIdentifiers = [].concat( + extractThis(path, comment), extractIdentifiers(path) ); - if (identifiers.length >= 2) { - inferMembershipFromIdentifiers(comment, identifiers.slice(0, -1)); + if (memberIdentifiers.length >= 2) { + return inferMembershipFromIdentifiers(comment, memberIdentifiers.slice(0, -1)); } + return comment; } - // /** @lends Foo */{ bar: ... } - if (n.isIdentifier(path.node) && - n.isObjectProperty(path.parentPath) && - n.isObjectExpression(path.parentPath.parentPath)) { - // The @lends comment is sometimes attached to the first property rather than - // the object expression itself. - identifiers = findLendsIdentifiers(path.parentPath.parentPath.node) || - findLendsIdentifiers(path.parentPath.parentPath.node.properties[0]); - if (identifiers) { - inferMembershipFromIdentifiers(comment, identifiers); - } - } + // Like straight membership, classes don't need + // to support lends. + // + // class Foo { bar() { } } + // var Foo = class { bar() { } } + // class Foo { prop: T } + // var Foo = class { prop: T } + if ((path.isClassMethod() || path.isClassProperty()) && + path.parentPath.isClassBody() && + path.parentPath.parentPath.isClass()) { - // Foo = { bar: ... }; - // Foo.prototype = { bar: ... }; - // Foo.bar = { baz: ... }; - if (n.isIdentifier(path.node) && - n.isObjectProperty(path.parentPath) && - n.isObjectExpression(path.parentPath.parentPath) && - n.isAssignmentExpression(path.parentPath.parentPath.parentPath)) { - identifiers = extractIdentifiers(path.parentPath.parentPath.parentPath.get('left')); - if (identifiers.length >= 1) { - inferMembershipFromIdentifiers(comment, identifiers); + var scope = 'instance'; + if (path.node.static == true) { + scope = 'static'; } - } - // Shorthand methods on ordinary objects - if (n.isObjectMethod(path.node) && - n.isObjectExpression(path.parentPath)) { - - // Foo = { bar() {} }; - // Foo.prototype = { bar() {} }; - // Foo.bar = { baz() {} }; - if (n.isAssignmentExpression(path.parentPath.parentPath)) { - identifiers = extractIdentifiers(path.parentPath.parentPath.get('left')); - if (identifiers.length >= 1) { - inferMembershipFromIdentifiers(comment, identifiers); - } + if (path.parentPath.parentPath.isExpression()) { + return inferMembershipFromIdentifiers(comment, + extractIdentifiers(path.parentPath.parentPath.parentPath.get('left')), + scope); } - // var Foo = { bar() {} }; - if (n.isVariableDeclarator(path.parentPath.parentPath)) { - identifiers = [path.parentPath.parentPath.get('id').node.name]; - inferMembershipFromIdentifiers(comment, identifiers); + var declarationNode = path.parentPath.parentPath.node; + if (!declarationNode.id) { + // export default function () {} + // export default class {} + // Use module name instead. + return inferMembershipFromIdentifiers(comment, [pathParse(comment.context.file).name], scope); } + + return inferMembershipFromIdentifiers(comment, [declarationNode.id.name], scope); } - // var Foo = { bar: ... } - if (n.isIdentifier(path) && - n.isObjectProperty(path.parentPath) && - n.isObjectExpression(path.parentPath.parentPath) && - n.isVariableDeclarator(path.parentPath.parentPath.parentPath)) { - identifiers = [path.parentPath.parentPath.parentPath.node.id.name]; - inferMembershipFromIdentifiers(comment, identifiers); + // Whether something is an ObjectMethod (shorthand like foo() {} ) + // or ObjectProperty (old fashioned like foo: function() {} ) + // doesn't matter for the membership phase, as long as we end up knowing + // that it belongs to an object. So we first establish objectParent, + // and then have the logic for the numerous ways an object can be named. + var objectParent; + + if (path.isIdentifier() && + path.parentPath.isObjectProperty() && + path.parentPath.parentPath.isObjectExpression()) { + objectParent = path.parentPath.parentPath; + } else if (path.isObjectMethod() && + path.parentPath.isObjectExpression()) { + objectParent = path.parentPath; } - // class Foo { bar() { } } - // var Foo = class { bar() { } } - // class Foo { prop: T } - // var Foo = class { prop: T } - if ((n.isClassMethod(path) || n.isClassProperty(path)) && - n.isClassBody(path.parentPath) && - n.isClass(path.parentPath.parentPath)) { - if (n.isExpression(path.parentPath.parentPath)) { - identifiers = extractIdentifiers(path.parentPath.parentPath.parentPath.get('left')); - } else { - var declarationNode = path.parentPath.parentPath.node; - if (!declarationNode.id) { - // export default function () {} - // export default class {} - // Use module name instead. - identifiers = [pathParse(comment.context.file).name]; - } else { - identifiers = [declarationNode.id.name]; - } - } - var scope = 'instance'; - if (path.node.static == true) { - scope = 'static'; + // Confirm that the thing being documented is a property of an object. + if (objectParent) { + + // The @lends comment is sometimes attached to the first property rather than + // the object expression itself. + var lendsIdentifiers = findLendsIdentifiers(objectParent) || + findLendsIdentifiers(objectParent.get('properties')[0]); + + if (lendsIdentifiers) { + + return inferMembershipFromIdentifiers(comment, lendsIdentifiers); + + } else if (objectParent.parentPath.isAssignmentExpression()) { + + // Foo = { ... }; + // Foo.prototype = { ... }; + // Foo.bar = { ... }; + return inferMembershipFromIdentifiers(comment, + extractIdentifiers(objectParent.parentPath.get('left'))); + + } else if (objectParent.parentPath.isVariableDeclarator()) { + + // var Foo = { ... }; + return inferMembershipFromIdentifiers(comment, + [objectParent.parentPath.get('id').node.name]); + + } else if (objectParent.parentPath.isExportDefaultDeclaration()) { + + // export default { ... }; + return inferMembershipFromIdentifiers(comment, + [inferModuleName(currentModule || comment)]); + } - inferMembershipFromIdentifiers(comment, identifiers, scope); + } // var function Foo() { diff --git a/lib/is_jsdoc_comment.js b/lib/is_jsdoc_comment.js index fd5a70f32..79835a428 100644 --- a/lib/is_jsdoc_comment.js +++ b/lib/is_jsdoc_comment.js @@ -11,7 +11,7 @@ * comments. * * @name isJSDocComment - * @param {Object} comment an ast node of the comment + * @param {Object} comment an ast path of the comment * @return {boolean} whether it is valid */ module.exports = function isJSDocComment(comment/*: { diff --git a/lib/module_filters.js b/lib/module_filters.js index 6c10b1855..501d7a7d9 100644 --- a/lib/module_filters.js +++ b/lib/module_filters.js @@ -12,7 +12,6 @@ var internalModuleRegexp = process.platform === 'win32' ? /** * Module filters - * @private */ module.exports = { internalOnly: internalModuleRegexp.test.bind(internalModuleRegexp), diff --git a/lib/parsers/javascript.js b/lib/parsers/javascript.js index cd9ff2edc..3a8db26e6 100644 --- a/lib/parsers/javascript.js +++ b/lib/parsers/javascript.js @@ -45,7 +45,8 @@ function parseJavaScript(data/*: Object*/, walkComments.bind(null, 'leadingComments', true), walkComments.bind(null, 'innerComments', false), walkComments.bind(null, 'trailingComments', false) - ], fn => fn(ast, data, addComment)).filter(Boolean); + ], fn => fn(ast, data, addComment)) + .filter(comment => comment && !comment.lends); } function _addComment(visited, data, commentValue, commentLoc, path, nodeLoc, includeContext) { diff --git a/test/fixture/default-export-function.input.js b/test/fixture/default-export-function.input.js new file mode 100644 index 000000000..10741869d --- /dev/null +++ b/test/fixture/default-export-function.input.js @@ -0,0 +1,5 @@ +/** i am foo */ +export default function() { + /** i am foo's son */ + this.bar = () => { } +}; diff --git a/test/fixture/default-export-function.output.json b/test/fixture/default-export-function.output.json new file mode 100644 index 000000000..41c8774b9 --- /dev/null +++ b/test/fixture/default-export-function.output.json @@ -0,0 +1,214 @@ +[ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "i am foo", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "context": { + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "default-export-function.input", + "kind": "function", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "default-export-function.input", + "kind": "function" + } + ], + "namespace": "default-export-function.input" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "i am foo's son", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "context": { + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 22 + } + } + }, + "augments": [], + "errors": [ + { + "message": "@memberof reference to default-export-function.input not found", + "commentLineNumber": 0 + } + ], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "bar", + "kind": "function", + "memberof": "default-export-function.input", + "scope": "static", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "bar", + "kind": "function", + "scope": "static" + } + ], + "namespace": ".bar" + } +] \ No newline at end of file diff --git a/test/fixture/default-export-function.output.md b/test/fixture/default-export-function.output.md new file mode 100644 index 000000000..f5751264f --- /dev/null +++ b/test/fixture/default-export-function.output.md @@ -0,0 +1,14 @@ + + +### Table of Contents + +- [default-export-function.input](#default-export-functioninput) +- [bar](#bar) + +## default-export-function.input + +i am foo + +## bar + +i am foo's son diff --git a/test/fixture/default-export-function.output.md.json b/test/fixture/default-export-function.output.md.json new file mode 100644 index 000000000..bebb70b41 --- /dev/null +++ b/test/fixture/default-export-function.output.md.json @@ -0,0 +1,99 @@ +{ + "type": "root", + "children": [ + { + "type": "html", + "value": "" + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "default-export-function.input" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "i am foo", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "bar" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "i am foo's son", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ] +} \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-object.output.json b/test/fixture/document-exported-export-default-object.output.json index fda6f1de9..891d8bc4c 100644 --- a/test/fixture/document-exported-export-default-object.output.json +++ b/test/fixture/document-exported-export-default-object.output.json @@ -74,7 +74,12 @@ } }, "augments": [], - "errors": [], + "errors": [ + { + "message": "@memberof reference to document-exported-export-default-object.input not found", + "commentLineNumber": 0 + } + ], "examples": [], "params": [], "properties": [], @@ -83,6 +88,8 @@ "throws": [], "todos": [], "name": "x", + "memberof": "document-exported-export-default-object.input", + "scope": "static", "members": { "global": [], "inner": [], @@ -92,9 +99,10 @@ }, "path": [ { - "name": "x" + "name": "x", + "scope": "static" } ], - "namespace": "x" + "namespace": ".x" } ] \ No newline at end of file diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index fcef40a07..f89783c1d 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -158,3 +158,4 @@ export function isArrayEqualWith( ): boolean { return true; } + diff --git a/test/fixture/lends.input.js b/test/fixture/lends.input.js new file mode 100644 index 000000000..4aa9a25b7 --- /dev/null +++ b/test/fixture/lends.input.js @@ -0,0 +1,26 @@ +/** + * A neat layout view + * @class TheClass + * @augments Augmented + */ +export default TheClass( + /** @lends TheClass.prototype */ + { + /** + * My neat function + * @param {string} word your word + * @returns {string} your word but one better + */ + foo: function(word) { + return word + 1; + }, + /** + * My neat function + * @param {string} word your word + * @returns {string} your word but one better + */ + bar(word) { + return word + 1; + } + } +) diff --git a/test/fixture/lends.output.json b/test/fixture/lends.output.json new file mode 100644 index 000000000..351407dda --- /dev/null +++ b/test/fixture/lends.output.json @@ -0,0 +1,630 @@ +[ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A neat layout view", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + } + } + }, + "tags": [ + { + "title": "class", + "description": null, + "lineNumber": 2, + "type": null, + "name": "TheClass" + }, + { + "title": "augments", + "description": null, + "lineNumber": 3, + "type": null, + "name": "Augmented" + } + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 26, + "column": 1 + } + } + }, + "augments": [ + { + "title": "augments", + "description": null, + "lineNumber": 3, + "type": null, + "name": "Augmented" + } + ], + "errors": [], + "examples": [], + "params": [], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "kind": "class", + "name": "TheClass", + "members": { + "global": [], + "inner": [], + "instance": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "My neat function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + } + } + }, + "tags": [ + { + "title": "param", + "description": "your word", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "string" + }, + "name": "word" + }, + { + "title": "returns", + "description": "your word but one better", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "loc": { + "start": { + "line": 9, + "column": 4 + }, + "end": { + "line": 13, + "column": 7 + } + }, + "context": { + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 16, + "column": 5 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "word", + "lineNumber": 2, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + } + } + }, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "properties": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word but one better", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + } + } + }, + "title": "returns", + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "sees": [], + "throws": [], + "todos": [], + "name": "foo", + "kind": "function", + "memberof": "TheClass", + "scope": "instance", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "TheClass", + "kind": "class" + }, + { + "name": "foo", + "kind": "function", + "scope": "instance" + } + ], + "namespace": "TheClass#foo" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "My neat function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + } + } + }, + "tags": [ + { + "title": "param", + "description": "your word", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "string" + }, + "name": "word" + }, + { + "title": "returns", + "description": "your word but one better", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "context": { + "loc": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 24, + "column": 5 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "word", + "lineNumber": 2, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + } + } + }, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "properties": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word but one better", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + } + } + }, + "title": "returns", + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "sees": [], + "throws": [], + "todos": [], + "name": "bar", + "kind": "function", + "memberof": "TheClass", + "scope": "instance", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "TheClass", + "kind": "class" + }, + { + "name": "bar", + "kind": "function", + "scope": "instance" + } + ], + "namespace": "TheClass#bar" + } + ], + "events": [], + "static": [] + }, + "path": [ + { + "name": "TheClass", + "kind": "class" + } + ], + "namespace": "TheClass" + } +] \ No newline at end of file diff --git a/test/fixture/lends.output.md b/test/fixture/lends.output.md new file mode 100644 index 000000000..23ccc043c --- /dev/null +++ b/test/fixture/lends.output.md @@ -0,0 +1,33 @@ + + +### Table of Contents + +- [TheClass](#theclass) + - [foo](#foo) + - [bar](#bar) + +## TheClass + +**Extends Augmented** + +A neat layout view + +### foo + +My neat function + +**Parameters** + +- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word + +Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better + +### bar + +My neat function + +**Parameters** + +- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word + +Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better diff --git a/test/fixture/lends.output.md.json b/test/fixture/lends.output.md.json new file mode 100644 index 000000000..03620a2fe --- /dev/null +++ b/test/fixture/lends.output.md.json @@ -0,0 +1,466 @@ +{ + "type": "root", + "children": [ + { + "type": "html", + "value": "" + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "TheClass" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Extends " + }, + { + "type": "text", + "value": "Augmented" + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "A neat layout view", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 19, + "offset": 18 + }, + "indent": [] + } + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "foo" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "My neat function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "word" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word but one better", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ] + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "bar" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "My neat function", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "word" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 10, + "offset": 9 + }, + "indent": [] + } + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "your word but one better", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 25, + "offset": 24 + }, + "indent": [] + } + } + ] + } + ] +} \ No newline at end of file diff --git a/test/lib/infer/membership.js b/test/lib/infer/membership.js index 373230b68..bd7d35165 100644 --- a/test/lib/infer/membership.js +++ b/test/lib/infer/membership.js @@ -209,7 +209,7 @@ test('inferMembership - explicit', function (t) { /** Test */ bar: 0 }); - })[1], ['memberof', 'scope']), { + })[0], ['memberof', 'scope']), { memberof: 'Foo', scope: 'static' }, 'lends, static'); @@ -219,7 +219,7 @@ test('inferMembership - explicit', function (t) { /** Test */ bar: function () {} }); - })[1], ['memberof', 'scope']), { + })[0], ['memberof', 'scope']), { memberof: 'Foo', scope: 'static' }, 'inferMembership - lends, static, function'); @@ -229,7 +229,7 @@ test('inferMembership - explicit', function (t) { /** Test */ bar: 0 }); - })[1], ['memberof', 'scope']), { + })[0], ['memberof', 'scope']), { memberof: 'Foo', scope: 'instance' }); @@ -239,7 +239,7 @@ test('inferMembership - explicit', function (t) { /** Test */ bar: function () {} }); - })[1], ['memberof', 'scope']), { + })[0], ['memberof', 'scope']), { memberof: 'Foo', scope: 'instance' }, 'inferMembership - lends, instance, function'); @@ -261,11 +261,7 @@ test('inferMembership - explicit', function (t) { t.equal(evaluate(function () { lend(/** @lends Foo */{}); /** Test */ - })[1].memberof, undefined, 'inferMembership - lends applies only to following object'); - - t.equal(evaluate(function () { - lend(/** @lends Foo */{}); - })[0].memberof, undefined, 'inferMembership - drops lends'); + })[0].memberof, undefined, 'inferMembership - lends applies only to following object'); t.end(); }); diff --git a/test/lib/parse.js b/test/lib/parse.js index aef852939..5bde5893f 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -454,14 +454,6 @@ test('parse - @kind', function (t) { t.end(); }); -test('parse - @lends', function (t) { - t.equal(evaluate(function () { - /** @lends lendee */ - })[0].lends, 'lendee', 'lends'); - - t.end(); -}); - test('parse - @license', function (t) { t.end(); }); From f07285a9200162908efa5dfc3076cb32d1425c6e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 24 Feb 2017 16:33:12 -0500 Subject: [PATCH 013/555] feat(markdown): Add `@see` tag output in Markdown (#682) Refs https://github.com/documentationjs/documentation/issues/673 --- declarations/comment.js | 2 +- lib/output/markdown_ast.js | 11 ++ test/fixture/meta.input.js | 3 + test/fixture/meta.output.json | 216 +++++++++++++++++++++++++++++-- test/fixture/meta.output.md | 4 + test/fixture/meta.output.md.json | 181 ++++++++++++++++++++++++++ 6 files changed, 408 insertions(+), 9 deletions(-) diff --git a/declarations/comment.js b/declarations/comment.js index 64268e630..1f8924f4b 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -110,7 +110,7 @@ declare type Comment = { params: Array, properties: Array, returns: Array, - sees: Array, + sees: Array, throws: Array, todos: Array, diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index 4058603f4..b93e6a776 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -162,6 +162,16 @@ function buildMarkdownAST(comments/*: Array */, config/*: Documentation ]); } + function seeLink(comment/*: Comment */) { + return comment.sees.length > 0 && u('list', { ordered: false }, comment.sees.map(see => + u('listItem', [ + u('strong', [ + u('text', 'See: ') + ].concat(see.children)) + ]) + )); + } + function githubLink(comment/*: Comment */) { return comment.context && comment.context.github && u('paragraph', [ u('link', { @@ -204,6 +214,7 @@ function buildMarkdownAST(comments/*: Array */, config/*: Documentation return [u('heading', { depth }, [u('text', comment.name || '')])] .concat(githubLink(comment)) .concat(augmentsLink(comment)) + .concat(seeLink(comment)) .concat(comment.description ? comment.description.children : []) .concat(typeSection(comment)) .concat(paramSection(comment)) diff --git a/test/fixture/meta.input.js b/test/fixture/meta.input.js index adfd4fdd0..890aa7615 100644 --- a/test/fixture/meta.input.js +++ b/test/fixture/meta.input.js @@ -1,6 +1,9 @@ /** * This function returns the number one. * @returns {number} numberone + * @see {@link http://github.com/|github} + * @see TestCase + * @see [markdown link](http://foo.com/) * @version 1.0.0 * @since 2.0.0 * @copyright Tom MacWright diff --git a/test/fixture/meta.output.json b/test/fixture/meta.output.json index 8181094f5..38acd1703 100644 --- a/test/fixture/meta.output.json +++ b/test/fixture/meta.output.json @@ -62,25 +62,40 @@ "name": "number" } }, + { + "title": "see", + "description": "{@link http://github.com/|github}", + "lineNumber": 3 + }, + { + "title": "see", + "description": "TestCase", + "lineNumber": 4 + }, + { + "title": "see", + "description": "[markdown link](http://foo.com/)", + "lineNumber": 5 + }, { "title": "version", "description": "1.0.0", - "lineNumber": 3 + "lineNumber": 6 }, { "title": "since", "description": "2.0.0", - "lineNumber": 4 + "lineNumber": 7 }, { "title": "copyright", "description": "Tom MacWright", - "lineNumber": 5 + "lineNumber": 8 }, { "title": "license", "description": "BSD", - "lineNumber": 6 + "lineNumber": 9 } ], "loc": { @@ -89,18 +104,18 @@ "column": 0 }, "end": { - "line": 8, + "line": 11, "column": 3 } }, "context": { "loc": { "start": { - "line": 9, + "line": 12, "column": 0 }, "end": { - "line": 12, + "line": 15, "column": 2 } } @@ -171,7 +186,192 @@ } } ], - "sees": [], + "sees": [ + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "link", + "url": "http://github.com/", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "github" + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 34, + "offset": 33 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 34, + "offset": 33 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 34, + "offset": 33 + } + } + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "TestCase", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + } + } + }, + { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "link", + "title": null, + "url": "http://foo.com/", + "children": [ + { + "type": "text", + "value": "markdown link", + "position": { + "start": { + "line": 1, + "column": 2, + "offset": 1 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 33, + "offset": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 33, + "offset": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 33, + "offset": 32 + } + } + } + ], "throws": [], "todos": [], "version": "1.0.0", diff --git a/test/fixture/meta.output.md b/test/fixture/meta.output.md index 8e262387f..d45e106d4 100644 --- a/test/fixture/meta.output.md +++ b/test/fixture/meta.output.md @@ -6,6 +6,10 @@ ## meta.input +- **See: [github](http://github.com/)** +- **See: TestCase** +- **See: [markdown link](http://foo.com/)** + This function returns the number one. Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/meta.output.md.json b/test/fixture/meta.output.md.json index 451588533..d8cdaee45 100644 --- a/test/fixture/meta.output.md.json +++ b/test/fixture/meta.output.md.json @@ -15,6 +15,187 @@ } ] }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "See: " + }, + { + "type": "paragraph", + "children": [ + { + "type": "link", + "url": "http://github.com/", + "title": null, + "jsdoc": true, + "children": [ + { + "type": "text", + "value": "github" + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 34, + "offset": 33 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 34, + "offset": 33 + }, + "indent": [] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "See: " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "TestCase", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 9, + "offset": 8 + }, + "indent": [] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "See: " + }, + { + "type": "paragraph", + "children": [ + { + "type": "link", + "title": null, + "url": "http://foo.com/", + "children": [ + { + "type": "text", + "value": "markdown link", + "position": { + "start": { + "line": 1, + "column": 2, + "offset": 1 + }, + "end": { + "line": 1, + "column": 15, + "offset": 14 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 33, + "offset": 32 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 33, + "offset": 32 + }, + "indent": [] + } + } + ] + } + ] + } + ] + }, { "type": "paragraph", "children": [ From a92b9ff28e5be914483dd071b4b26de160858e98 Mon Sep 17 00:00:00 2001 From: Glenn Reyes Date: Sat, 11 Mar 2017 20:55:11 +0100 Subject: [PATCH 014/555] Switch to shield style CircleCI badge (#692) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 37e9f46b7..9f4388744 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # documentation -[![Circle CI](https://circleci.com/gh/documentationjs/documentation/tree/master.svg?style=svg)](https://circleci.com/gh/documentationjs/documentation/tree/master) +[![Circle CI](https://circleci.com/gh/documentationjs/documentation/tree/master.svg?style=shield)](https://circleci.com/gh/documentationjs/documentation/tree/master) [![npm version](https://badge.fury.io/js/documentation.svg)](http://badge.fury.io/js/documentation) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/documentationjs/documentation?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![David](https://david-dm.org/documentationjs/documentation.svg)](https://david-dm.org/documentationjs/documentation) From d053391b5eba1fc9c6beb9933034fdd851648ed4 Mon Sep 17 00:00:00 2001 From: Andrei Mihailov Date: Thu, 16 Mar 2017 13:57:43 +0000 Subject: [PATCH 015/555] Update README.md (#695) Fixes #693 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f4388744..9ae967c85 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,12 @@ bin/documentation.js build src/** -f html -o docs # document index.js, ignoring any files it requires or imports bin/documentation.js build index.js -f md --shallow -# build, serve, and live-update html docs for app.js +# build and serve html docs for app.js bin/documentation.js serve app.js +# build, serve, and live-update html docs for app.js +bin/documentation.js serve --watch app.js + # validate JSDoc syntax in util.js bin/documentation.js lint util.js From 72e04b885c671fa07ce6d55e59b920ace3d62c07 Mon Sep 17 00:00:00 2001 From: John Kerssens Date: Sun, 26 Mar 2017 12:16:59 -0700 Subject: [PATCH 016/555] chore(docs): fixing spelling --- docs/FAQ.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/FAQ.md b/docs/FAQ.md index 29f748fa1..e3dc69b81 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -4,7 +4,7 @@ in JavaScript. It exposes multiple interfaces for users: * with `npm i -g documentation`, it provides a binary for command-line usage -* install `documentation` with `npm` to use the node-facing interace +* install `documentation` with `npm` to use the node-facing interface `documentation` runs in [node.js](https://nodejs.org/) but supports JavaScript that runs in _any environment_. You can use it to document browser libraries, @@ -51,7 +51,7 @@ documentation. * `documentation` can generate multiple formats. When you create a website, `documentation` can take your documentation and generate beautiful HTML output. -* The JSDoc syntax exposes a powerful, standardized type syntax to, for example, +* The JSDoc syntax exposes a powerful, standardized type syntax to, for example, express parameter types like 'an array of strings'. as `Array`, and to support custom object types with inter-linking * The [eslint valid-jsdoc rule](http://eslint.org/docs/rules/valid-jsdoc.html) @@ -70,7 +70,7 @@ that file uses `require` or `import` to include other source files, those source files will be documented too. You can customize this behavior by specifying the `--shallow` command-line -option. With `--shallow` specified, dependendencies aren't followed: documentation.js +option. With `--shallow` specified, dependencies aren't followed: documentation.js processes only those files you explicitly name. If you're using ES modules, you enable the option `--document-exported` to automatically From 5fe1859da8345d25ef97abd06d0c0a4b27c4fbcc Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 31 Mar 2017 04:35:11 +0300 Subject: [PATCH 017/555] text(windows): Fix tests on Windows platform * Fixed find_git test for windows platform. * Fixed github test on windows platform. * Fixed bin tests which are executed process from node.js * On windows platform uses DOUBLE EXCLAMATION MARK instead of WARNING SIGN. --- test/bin-readme.js | 2 +- test/bin-watch-serve.js | 3 ++- test/bin.js | 7 +++++-- test/lib/git/find_git.js | 7 +++++-- test/lib/github.js | 5 ++++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/test/bin-readme.js b/test/bin-readme.js index 381258d6b..103ea5d29 100644 --- a/test/bin-readme.js +++ b/test/bin-readme.js @@ -18,7 +18,7 @@ function documentation(args, options, callback, parseJSON) { options.maxBuffer = 1024 * 1024; - args.unshift(path.join(__dirname, '../bin/documentation.js')); + args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); exec(args.join(' '), options, callback); } diff --git a/test/bin-watch-serve.js b/test/bin-watch-serve.js index b54d3da49..f7d601171 100644 --- a/test/bin-watch-serve.js +++ b/test/bin-watch-serve.js @@ -18,9 +18,10 @@ function documentation(args, options, callback, parseJSON) { } options.maxBuffer = 1024 * 1024; + args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); return spawn( - path.join(__dirname, '../bin/documentation.js'), + 'node', args, options); } diff --git a/test/bin.js b/test/bin.js index 533b98ba4..293e57069 100644 --- a/test/bin.js +++ b/test/bin.js @@ -20,7 +20,7 @@ function documentation(args, options, callback, parseJSON) { options.maxBuffer = 1024 * 1024; - args.unshift(path.join(__dirname, '../bin/documentation.js')); + args.unshift('node '+ path.join(__dirname, '..', 'bin', 'documentation.js')); exec(args.join(' '), options, function (err, stdout, stderr) { if (err) { @@ -240,12 +240,15 @@ test('lint command', function (group) { group.test('generates lint output', options, function (t) { documentation(['lint fixture/lint/lint.input.js'], function (err, data) { - var output = path.join(__dirname, 'fixture/lint/lint.output.js'); + var output = path.join(__dirname, 'fixture', 'lint', 'lint.output.js'); data = data.toString().split('\n').slice(2).join('\n'); if (process.env.UPDATE) { fs.writeFileSync(output, data); } t.equal(err.code, 1); + if (os.type() === 'Windows_NT') { + data = data.replace('‼', '⚠'); + } t.equal(data, fs.readFileSync(output, 'utf8'), 'outputs lint'); t.end(); }); diff --git a/test/lib/git/find_git.js b/test/lib/git/find_git.js index 79f6d8cf5..beb2dc0cb 100644 --- a/test/lib/git/find_git.js +++ b/test/lib/git/find_git.js @@ -3,16 +3,19 @@ var test = require('tap').test, mock = require('mock-fs'), mockRepo = require('./mock_repo'), + path = require('path'), findGit = require('../../../lib/git/find_git'); test('findGit', function (t) { mock(mockRepo.master); + const root = path.parse(__dirname).root; + t.equal( findGit( - '/my/repository/path/index.js'), - '/my/repository/path/.git', 'finds git path'); + root + path.join('my', 'repository', 'path', 'index.js')), + root + path.join('my', 'repository', 'path', '.git'), 'finds git path'); mock.restore(); diff --git a/test/lib/github.js b/test/lib/github.js index e1e0407cf..67bede965 100644 --- a/test/lib/github.js +++ b/test/lib/github.js @@ -4,6 +4,7 @@ var test = require('tap').test, mock = require('mock-fs'), + path = require('path'), mockRepo = require('./git/mock_repo'), parse = require('../../lib/parsers/javascript'), github = require('../../lib/github'); @@ -15,8 +16,10 @@ function toComment(fn, filename) { }, {}).map(github); } +const root = path.parse(__dirname).root; + function evaluate(fn) { - return toComment(fn, '/my/repository/path/index.js'); + return toComment(fn, root + path.join('my', 'repository', 'path', 'index.js')); } test('github', function (t) { From e2915dc19cf4b9dca42865f712b0b41f1304b21a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Apr 2017 13:14:04 -0400 Subject: [PATCH 018/555] feat(core): Support Flow interface declarations * Add support for interface declarations * Support exported interfaces/type aliases * Update test fixtures * Add interface type, fix test * Fix comment style and typo --- declarations/comment.js | 3 +- lib/infer/augments.js | 45 +++++-- lib/infer/finders.js | 16 --- lib/infer/kind.js | 2 + lib/infer/properties.js | 14 ++- test/fixture/interface.input.js | 7 ++ test/fixture/interface.output.json | 132 +++++++++++++++++++++ test/fixture/interface.output.md | 16 +++ test/fixture/interface.output.md.json | 163 ++++++++++++++++++++++++++ 9 files changed, 364 insertions(+), 34 deletions(-) create mode 100644 test/fixture/interface.input.js create mode 100644 test/fixture/interface.output.json create mode 100644 test/fixture/interface.output.md create mode 100644 test/fixture/interface.output.md.json diff --git a/declarations/comment.js b/declarations/comment.js index 1f8924f4b..a876bd6e0 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -98,7 +98,8 @@ declare type Kind = 'class' | 'mixin' | 'module' | 'namespace' | - 'typedef'; + 'typedef' | + 'interface'; declare type Comment = { errors: Array, diff --git a/lib/infer/augments.js b/lib/infer/augments.js index 0d4920b29..474ca1fb8 100644 --- a/lib/infer/augments.js +++ b/lib/infer/augments.js @@ -3,7 +3,7 @@ /* @flow */ var generate = require('babel-generator').default, - findClass = require('./finders').findClass; + findTarget = require('./finders').findTarget; /** * Infers an `augments` tag from an ES6 class declaration @@ -16,18 +16,37 @@ function inferAugments(comment/*: Comment */) { return comment; } - var path = findClass(comment.context.ast); - - /* - * A superclass can be a single name, like React, - * or a MemberExpression like React.Component, - * so we generate code from the AST rather than assuming - * we can access a name like `path.node.superClass.name` - */ - if (path && path.node.superClass) { - comment.augments.push({ - title: 'augments', - name: generate(path.node.superClass).code + var path = findTarget(comment.context.ast); + + if (!path) { + return comment; + } + + if (path.isClass()) { + /* + * A superclass can be a single name, like React, + * or a MemberExpression like React.Component, + * so we generate code from the AST rather than assuming + * we can access a name like `path.node.superClass.name` + */ + if (path.node.superClass) { + comment.augments.push({ + title: 'augments', + name: generate(path.node.superClass).code + }); + } + } else if (path.isInterfaceDeclaration()) { + /* + * extends is an array of interface identifiers or + * qualified type identifiers, so we generate code + * from the AST rather than assuming we can acces + * a name. + */ + path.node.extends.forEach(node => { + comment.augments.push({ + title: 'extends', + name: generate(node).code + }); }); } diff --git a/lib/infer/finders.js b/lib/infer/finders.js index 8fd63f55d..6fd56fb5d 100644 --- a/lib/infer/finders.js +++ b/lib/infer/finders.js @@ -38,20 +38,4 @@ function findTarget(path/*: Object */) { return path.node && path; } -/** - * Try to find a JavaScript class that this comment refers to, - * whether an expression in an assignment, or a declaration. - * - * @param {Object} path abstract syntax tree path - * @returns {?Object} ast path, if one is found. - * @private - */ -function findClass(path/*: Object*/) { - var target = findTarget(path); - if (target && (target.isClassDeclaration() || target.isClassExpression())) { - return target; - } -} - module.exports.findTarget = findTarget; -module.exports.findClass = findClass; diff --git a/lib/infer/kind.js b/lib/infer/kind.js index d058899fc..8bd45f876 100644 --- a/lib/infer/kind.js +++ b/lib/infer/kind.js @@ -32,6 +32,8 @@ function inferKind(comment/*: Comment*/) { } } else if (t.isTypeAlias(node)) { comment.kind = 'typedef'; + } else if (t.isInterfaceDeclaration(node)) { + comment.kind = 'interface'; } else if (t.isVariableDeclaration(node)) { if (node.kind === 'const') { comment.kind = 'constant'; diff --git a/lib/infer/properties.js b/lib/infer/properties.js index 4b6112d15..baed1fac5 100644 --- a/lib/infer/properties.js +++ b/lib/infer/properties.js @@ -2,8 +2,8 @@ 'use strict'; /* @flow */ -var t = require('babel-types'), - flowDoctrine = require('../flow_doctrine'); +var flowDoctrine = require('../flow_doctrine'), + findTarget = require('./finders').findTarget; function prefixedName(name, prefix) { if (prefix.length) { @@ -56,8 +56,14 @@ function inferProperties(comment/*: Comment */)/*: Comment */ { } } - if (t.isTypeAlias(comment.context.ast)) { - inferProperties(comment.context.ast.node.right, []); + var path = findTarget(comment.context.ast); + + if (path) { + if (path.isTypeAlias()) { + inferProperties(path.node.right, []); + } else if (path.isInterfaceDeclaration()) { + inferProperties(path.node.body, []); + } } return comment; diff --git a/test/fixture/interface.input.js b/test/fixture/interface.input.js new file mode 100644 index 000000000..5389c6b24 --- /dev/null +++ b/test/fixture/interface.input.js @@ -0,0 +1,7 @@ +/** + * This is my interface. + */ +interface Foo extends Bar, Baz { + prop1: number; + prop2: string; +} diff --git a/test/fixture/interface.output.json b/test/fixture/interface.output.json new file mode 100644 index 000000000..013e347e5 --- /dev/null +++ b/test/fixture/interface.output.json @@ -0,0 +1,132 @@ +[ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is my interface.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 22, + "offset": 21 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 22, + "offset": 21 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 22, + "offset": 21 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + } + }, + "augments": [ + { + "title": "extends", + "name": "Bar" + }, + { + "title": "extends", + "name": "Baz" + } + ], + "errors": [], + "examples": [], + "params": [], + "properties": [ + { + "title": "property", + "name": "prop1", + "lineNumber": 5, + "type": { + "type": "NameExpression", + "name": "number" + } + }, + { + "title": "property", + "name": "prop2", + "lineNumber": 6, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "Foo", + "kind": "interface", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "Foo", + "kind": "interface" + } + ], + "namespace": "Foo" + } +] \ No newline at end of file diff --git a/test/fixture/interface.output.md b/test/fixture/interface.output.md new file mode 100644 index 000000000..7ef9cf99d --- /dev/null +++ b/test/fixture/interface.output.md @@ -0,0 +1,16 @@ + + +### Table of Contents + +- [Foo](#foo) + +## Foo + +**Extends Bar, Baz** + +This is my interface. + +**Properties** + +- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** +- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/test/fixture/interface.output.md.json b/test/fixture/interface.output.md.json new file mode 100644 index 000000000..96610ee59 --- /dev/null +++ b/test/fixture/interface.output.md.json @@ -0,0 +1,163 @@ +{ + "type": "root", + "children": [ + { + "type": "html", + "value": "" + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "Foo" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Extends " + }, + { + "type": "text", + "value": "Bar, Baz" + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is my interface.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 22, + "offset": 21 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 22, + "offset": 21 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Properties" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "prop1" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "prop2" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + } + ] +} \ No newline at end of file From 25152edeb92bde164e5a41d962506560b2996636 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Apr 2017 14:25:45 -0400 Subject: [PATCH 019/555] style(prettier): Use prettier for code formatting (#710) * style(prettier): Use prettier for code formatting This saves us style issues. Also adds husky and lint-staged for pre-commit testing Refs https://github.com/documentationjs/documentation/issues/709 --- lib/commands/build.js | 43 +- lib/commands/lint.js | 37 +- lib/commands/readme.js | 81 +- lib/commands/serve.js | 51 +- lib/commands/shared_options.js | 22 +- lib/extractors/comments.js | 27 +- lib/extractors/exported.js | 70 +- lib/filter_access.js | 6 +- lib/flow_doctrine.js | 153 +- lib/garbage_collect.js | 2 +- lib/git/find_git.js | 3 +- lib/git/url_prefix.js | 26 +- lib/github.js | 13 +- lib/hierarchy.js | 64 +- lib/infer/access.js | 12 +- lib/infer/augments.js | 3 +- lib/infer/finders.js | 11 +- lib/infer/kind.js | 3 +- lib/infer/membership.js | 118 +- lib/infer/name.js | 10 +- lib/infer/params.js | 108 +- lib/infer/properties.js | 13 +- lib/infer/return.js | 23 +- lib/infer/should_skip_inference.js | 2 +- lib/infer/type.js | 33 +- lib/inline_tokenizer.js | 30 +- lib/input/dependency.js | 82 +- lib/input/shallow.js | 21 +- lib/is_jsdoc_comment.js | 12 +- lib/lint.js | 38 +- lib/merge_config.js | 63 +- lib/module_filters.js | 25 +- lib/nest.js | 27 +- lib/output/highlighter.js | 7 +- lib/output/html.js | 4 +- lib/output/json.js | 4 +- lib/output/markdown.js | 12 +- lib/output/markdown_ast.js | 408 ++-- lib/output/util/format_type.js | 167 +- lib/output/util/formatters.js | 52 +- lib/output/util/linker_stack.js | 13 +- lib/output/util/reroute_links.js | 11 +- lib/parse.js | 184 +- lib/parse_markdown.js | 2 +- lib/parsers/javascript.js | 40 +- lib/parsers/parse_to_ast.js | 3 +- lib/parsers/polyglot.js | 3 +- lib/serve/error_page.js | 2 +- lib/serve/server.js | 36 +- lib/smart_glob.js | 27 +- lib/sort.js | 67 +- lib/walk.js | 6 +- package.json | 16 +- test/bin-readme.js | 156 +- test/bin-watch-serve.js | 61 +- test/bin.js | 648 ++++--- .../auto_lang_hljs/multilanguage.input.js | 2 +- .../bad/{syntax.input.js => syntax.input} | 0 test/fixture/bad/syntax.output.json | 4 +- test/fixture/class.input.js | 4 +- test/fixture/class.output.json | 2 +- test/fixture/custom_theme/index.js | 12 +- test/fixture/default-export-function.input.js | 4 +- test/fixture/document-exported-bad/x.js | 2 +- ...nt-exported-export-default-object.input.js | 2 +- test/fixture/document-exported.input.js | 29 +- test/fixture/document-exported.output.json | 50 +- test/fixture/document-exported/x.js | 2 +- test/fixture/document-exported/y.js | 2 +- test/fixture/es6-class.input.js | 11 +- test/fixture/es6-class.output.json | 30 +- test/fixture/es6-default2.input.js | 2 +- test/fixture/es6-default2.output.json | 2 +- test/fixture/es6-import.input.js | 6 +- test/fixture/es6-import.output.json | 2 +- test/fixture/es6.input.js | 33 +- test/fixture/es6.output.json | 124 +- test/fixture/factory.input.js | 7 +- test/fixture/factory.output.json | 26 +- test/fixture/flow-unnamed-params.input.js | 6 +- test/fixture/flow-unnamed-params.output.json | 6 +- test/fixture/html/nested.input.js | 19 +- test/fixture/inheritance.input.js | 5 +- test/fixture/inheritance.output.json | 12 +- test/fixture/inline-link.input.js | 2 +- test/fixture/interface.input.js | 4 +- test/fixture/lends.input.js | 2 +- test/fixture/lends.output.json | 2 +- .../lint/{lint.output.js => lint.output} | 0 test/fixture/literal_types.input.js | 2 +- test/fixture/memberedclass.input.js | 19 +- test/fixture/memberedclass.output.json | 30 +- test/fixture/meta.input.js | 2 +- test/fixture/nearby_params.input.js | 5 +- test/fixture/nearby_params.output.json | 2 +- test/fixture/nest_params.input.js | 3 +- test/fixture/nest_params.output.json | 12 +- test/fixture/node_modules/external/index.js | 1 - .../fixture/node_modules/external/lib/main.js | 2 +- .../external/node_modules/external2/index.js | 2 +- test/fixture/node_modules/external2/index.js | 2 +- .../optional-record-field-type.input.js | 2 +- test/fixture/params.input.js | 5 +- test/fixture/params.output.json | 56 +- test/fixture/readme/index.js | 9 +- test/fixture/simple-hashbang.input.js | 2 +- test/fixture/simple-singlestar.input.js | 2 +- test/fixture/simple-triplestar.input.js | 2 +- test/fixture/simple.input.js | 2 +- test/fixture/string-literal-key.input.js | 4 +- test/fixture/string-literal-key.output.json | 16 +- test/fixture/system-import.input.js | 2 +- test/fixture/this-class.input.js | 12 +- test/fixture/this-class.output.json | 22 +- .../var-function-param-return.input.js | 2 +- .../var-function-param-return.output.json | 2 +- test/format_type.js | 112 +- test/lib/filter_access.js | 186 +- test/lib/flow_doctrine.js | 261 ++- test/lib/git/find_git.js | 11 +- test/lib/git/mock_repo.js | 12 +- test/lib/git/url_prefix.js | 28 +- test/lib/github.js | 85 +- test/lib/hierarchy.js | 88 +- test/lib/infer/access.js | 73 +- test/lib/infer/finders.js | 84 +- test/lib/infer/kind.js | 234 ++- test/lib/infer/membership.js | 1007 ++++++---- test/lib/infer/name.js | 344 ++-- test/lib/infer/params.js | 72 +- test/lib/infer/type.js | 72 +- test/lib/input/shallow.js | 52 +- test/lib/lint.js | 62 +- test/lib/merge_config.js | 120 +- test/lib/nest.js | 55 +- test/lib/output/util/formatters.js | 70 +- test/lib/parse.js | 1711 ++++++++++------- test/lib/parsers/javascript.js | 109 +- test/lib/parsers/polyglot.js | 123 +- test/lib/server.js | 67 +- test/lib/sort.js | 348 ++-- test/lib/walk.js | 94 +- test/linker.js | 62 +- test/normalize.js | 4 +- test/test.js | 351 ++-- test/utils.js | 19 +- 146 files changed, 5796 insertions(+), 3919 deletions(-) rename test/fixture/bad/{syntax.input.js => syntax.input} (100%) rename test/fixture/lint/{lint.output.js => lint.output} (100%) diff --git a/lib/commands/build.js b/lib/commands/build.js index c22a5d88a..52b7dbb22 100644 --- a/lib/commands/build.js +++ b/lib/commands/build.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; - var streamArray = require('stream-array'), sharedOptions = require('./shared_options'), path = require('path'), @@ -21,17 +20,20 @@ module.exports.describe = 'build documentation'; * @returns {Object} yargs with options * @private */ -module.exports.builder = extend({}, +module.exports.builder = extend( + {}, sharedOptions.sharedOutputOptions, - sharedOptions.sharedInputOptions, { + sharedOptions.sharedInputOptions, + { example: 'documentation build foo.js -f md > API.md', output: { describe: 'output location. omit for stdout, otherwise is a filename ' + - 'for single-file outputs and a directory name for multi-file outputs like html', + 'for single-file outputs and a directory name for multi-file outputs like html', default: 'stdout', alias: 'o' } - }); + } +); /* * The `build` command. Requires either `--output` or the `callback` argument. @@ -41,27 +43,35 @@ module.exports.builder = extend({}, * The former case, with the callback, is used by the `serve` command, which is * just a thin wrapper around this one. */ -module.exports.handler = function build(argv/*: Object*/) { +module.exports.handler = function build(argv /*: Object*/) { var watcher; argv._handled = true; if (!argv.input.length) { try { - argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + argv.input = [ + JSON.parse( + fs.readFileSync(path.resolve('package.json'), 'utf8') + ).main || 'index.js' + ]; } catch (e) { - throw new Error('documentation was given no files and was not run in a module directory'); + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); } } if (argv.f === 'html' && argv.o === 'stdout') { - throw new Error('The HTML output mode requires a destination directory set with -o'); + throw new Error( + 'The HTML output mode requires a destination directory set with -o' + ); } function generator() { - return documentation.build(argv.input, argv) + return documentation + .build(argv.input, argv) .then(comments => - documentation.formats[argv.format](comments, argv) - .then(onFormatted)) + documentation.formats[argv.format](comments, argv).then(onFormatted)) .catch(err => { /* eslint no-console: 0 */ if (err instanceof Error) { @@ -97,9 +107,12 @@ module.exports.handler = function build(argv/*: Object*/) { watcher = chokidar.watch(argv.input); watcher.on('all', debounce(generator, 300)); } - documentation.expandInputs(argv.input, argv).then(files => - watcher.add(files.map(data => - typeof data === 'string' ? data : data.file))); + documentation + .expandInputs(argv.input, argv) + .then(files => + watcher.add( + files.map(data => typeof data === 'string' ? data : data.file) + )); } return generator(); diff --git a/lib/commands/lint.js b/lib/commands/lint.js index 1e7acad44..2b9d06d77 100644 --- a/lib/commands/lint.js +++ b/lib/commands/lint.js @@ -19,25 +19,34 @@ module.exports.builder = {}; * @returns {undefined} has side-effects * @private */ -module.exports.handler = function (argv/*: Object*/) { +module.exports.handler = function(argv /*: Object*/) { argv._handled = true; if (!argv.input.length) { try { - argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + argv.input = [ + JSON.parse( + fs.readFileSync(path.resolve('package.json'), 'utf8') + ).main || 'index.js' + ]; } catch (e) { - throw new Error('documentation was given no files and was not run in a module directory'); + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); } } - documentation.lint(argv.input, argv).then(lintOutput => { - if (lintOutput) { - console.log(lintOutput); + documentation + .lint(argv.input, argv) + .then(lintOutput => { + if (lintOutput) { + console.log(lintOutput); + process.exit(1); + } else { + process.exit(0); + } + }) + .catch(err => { + /* eslint no-console: 0 */ + console.error(err); process.exit(1); - } else { - process.exit(0); - } - }).catch(err => { - /* eslint no-console: 0 */ - console.error(err); - process.exit(1); - }); + }); }; diff --git a/lib/commands/readme.js b/lib/commands/readme.js index b72c6b46f..9573c0e24 100644 --- a/lib/commands/readme.js +++ b/lib/commands/readme.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; - var fs = require('fs'); var remark = require('remark'); var path = require('path'); @@ -26,7 +25,7 @@ module.exports.builder = { describe: 'The markdown file into which to inject documentation', default: 'README.md' }, - 'section': { + section: { alias: 's', describe: 'The section heading after which to inject generated documentation', required: true @@ -37,7 +36,7 @@ module.exports.builder = { ' just check if its contents match, exiting nonzero if not.', default: false }, - 'quiet': { + quiet: { alias: 'q', describe: 'Quiet mode: do not print messages or README diff to stdout.', default: false @@ -52,52 +51,66 @@ function noop() {} * @param {Object} argv args from the CLI option parser * @return {undefined} has the side-effect of writing a file or printing to stdout */ -module.exports.handler = function readme(argv/*: Object*/) { +module.exports.handler = function readme(argv /*: Object*/) { argv._handled = true; if (!argv.input.length) { try { - argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + argv.input = [ + JSON.parse( + fs.readFileSync(path.resolve('package.json'), 'utf8') + ).main || 'index.js' + ]; } catch (e) { - throw new Error('documentation was given no files and was not run in a module directory'); + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); } } argv.format = 'remark'; /* eslint no-console: 0 */ - var log = argv.q ? noop : console.log.bind(console, '[documentation-readme] '); + var log = argv.q + ? noop + : console.log.bind(console, '[documentation-readme] '); var readmeContent = fs.readFileSync(argv.readmeFile, 'utf8'); - documentation.build(argv.input, argv) - .then(comments => - documentation.formats.remark(comments, argv)) - .then(docsAst => remark().use(plugin, { - section: argv.section, - toInject: JSON.parse(docsAst) - }).process(readmeContent)) - .then(file => { - var diffOutput = disparity.unified(readmeContent, file.contents, { - paths: [argv.readmeFile, argv.readmeFile] - }); - if (!diffOutput.length) { - log(`${argv.readmeFile} is up to date.`); - process.exit(0); - } + documentation + .build(argv.input, argv) + .then(comments => documentation.formats.remark(comments, argv)) + .then(docsAst => + remark() + .use(plugin, { + section: argv.section, + toInject: JSON.parse(docsAst) + }) + .process(readmeContent)) + .then(file => { + var diffOutput = disparity.unified(readmeContent, file.contents, { + paths: [argv.readmeFile, argv.readmeFile] + }); + if (!diffOutput.length) { + log(`${argv.readmeFile} is up to date.`); + process.exit(0); + } - if (argv.d) { - log(chalk.bold(`${argv.readmeFile} needs the following updates:`), `\n${diffOutput}`); - process.exit(1); - } else { - log(chalk.bold(`Updating ${argv.readmeFile}`), `\n${diffOutput}`); - } + if (argv.d) { + log( + chalk.bold(`${argv.readmeFile} needs the following updates:`), + `\n${diffOutput}` + ); + process.exit(1); + } else { + log(chalk.bold(`Updating ${argv.readmeFile}`), `\n${diffOutput}`); + } - fs.writeFileSync(argv.readmeFile, file.contents); - }) - .catch(err => { - console.error(err); - process.exit(1); - }); + fs.writeFileSync(argv.readmeFile, file.contents); + }) + .catch(err => { + console.error(err); + process.exit(1); + }); }; // wrap the inject utility as an remark plugin diff --git a/lib/commands/serve.js b/lib/commands/serve.js index c25349a07..dfa7e6f7c 100644 --- a/lib/commands/serve.js +++ b/lib/commands/serve.js @@ -29,7 +29,8 @@ module.exports.builder = extend( type: 'number', default: 4001 } - }); + } +); /** * Wrap the documentation build command along with a server, making it possible @@ -38,21 +39,27 @@ module.exports.builder = extend( * @param {Object} argv cli input * @returns {undefined} has side effects */ -module.exports.handler = function serve(argv/*: Object*/) { +module.exports.handler = function serve(argv /*: Object*/) { argv._handled = true; if (!argv.input.length) { try { - argv.input = [JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')).main || 'index.js']; + argv.input = [ + JSON.parse( + fs.readFileSync(path.resolve('package.json'), 'utf8') + ).main || 'index.js' + ]; } catch (e) { - throw new Error('documentation was given no files and was not run in a module directory'); + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); } } var server = new Server(argv.port); var watcher; - server.on('listening', function () { + server.on('listening', function() { process.stdout.write(`documentation.js serving on port ${argv.port}\n`); }); @@ -62,28 +69,32 @@ module.exports.handler = function serve(argv/*: Object*/) { watcher.on('all', debounce(updateServer, 300)); } - documentation.expandInputs(argv.input, argv) + documentation + .expandInputs(argv.input, argv) .then(files => { - watcher.add(files.map(data => - typeof data === 'string' ? data : data.file)); - }).catch(err => { + watcher.add( + files.map(data => typeof data === 'string' ? data : data.file) + ); + }) + .catch(err => { /* eslint no-console: 0 */ return server.setFiles([errorPage(err)]).start(); }); } function updateServer() { - documentation.build(argv.input, argv) - .then(comments => - documentation.formats.html(comments, argv)) - .then(files => { - if (argv.watch) { - updateWatcher(); - } - server.setFiles(files).start(); - }).catch(err => { - return server.setFiles([errorPage(err)]).start(); - }); + documentation + .build(argv.input, argv) + .then(comments => documentation.formats.html(comments, argv)) + .then(files => { + if (argv.watch) { + updateWatcher(); + } + server.setFiles(files).start(); + }) + .catch(err => { + return server.setFiles([errorPage(err)]).start(); + }); } updateServer(); diff --git a/lib/commands/shared_options.js b/lib/commands/shared_options.js index d50c45930..605a7452f 100644 --- a/lib/commands/shared_options.js +++ b/lib/commands/shared_options.js @@ -6,13 +6,13 @@ */ module.exports.sharedInputOptions = { strict: true, - 'shallow': { + shallow: { describe: 'shallow mode turns off dependency resolution, ' + - 'only processing the specified files (or the main script specified in package.json)', + 'only processing the specified files (or the main script specified in package.json)', default: false, type: 'boolean' }, - 'config': { + config: { describe: 'configuration file. an array defining explicit sort order', alias: 'c', type: 'string' @@ -23,36 +23,36 @@ module.exports.sharedInputOptions = { type: 'boolean', default: false }, - 'external': { + external: { describe: 'a string / glob match pattern that defines which external ' + 'modules will be whitelisted and included in the generated documentation.', default: null }, 'require-extension': { - describe: 'additional extensions to include in require() and import\'s search algorithm.' + + describe: "additional extensions to include in require() and import's search algorithm." + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array - coerce: (value/*: string | Array*/) => [].concat(value), + coerce: (value /*: string | Array*/) => [].concat(value), alias: 're' }, 'parse-extension': { describe: 'additional extensions to parse as source code.', // Ensure that the value is an array - coerce: (value/*: string | Array*/) => [].concat(value), + coerce: (value /*: string | Array*/) => [].concat(value), alias: 'pe' }, - 'polyglot': { + polyglot: { type: 'boolean', describe: 'polyglot mode turns off dependency resolution and ' + 'enables multi-language support. use this to document c++' }, - 'private': { + private: { describe: 'generate documentation tagged as private', type: 'boolean', default: false, alias: 'p' }, - 'access': { + access: { describe: 'Include only comments with a given access level, out of private, ' + 'protected, public, undefined. By default, public, protected, and undefined access ' + 'levels are included', @@ -60,7 +60,7 @@ module.exports.sharedInputOptions = { array: true, alias: 'a' }, - 'github': { + github: { type: 'boolean', describe: 'infer links to github in documentation', alias: 'g' diff --git a/lib/extractors/comments.js b/lib/extractors/comments.js index b0da981b3..f6e4abaf7 100644 --- a/lib/extractors/comments.js +++ b/lib/extractors/comments.js @@ -15,11 +15,13 @@ var traverse = require('babel-traverse').default, * @returns comments * @private */ -function walkComments(type/*: string*/, - includeContext/*: boolean*/, - ast/*: Object*/, - data/*: Object*/, - addComment/*: Function*/)/*: Array*/ { +function walkComments( + type /*: string*/, + includeContext /*: boolean*/, + ast /*: Object*/, + data /*: Object*/, + addComment /*: Function*/ +) /*: Array*/ { var newResults = []; traverse(ast, { @@ -37,12 +39,19 @@ function walkComments(type/*: string*/, * @return {undefined} this emits data */ function parseComment(comment) { - newResults.push(addComment(data, comment.value, comment.loc, path, path.node.loc, includeContext)); + newResults.push( + addComment( + data, + comment.value, + comment.loc, + path, + path.node.loc, + includeContext + ) + ); } - (path.node[type] || []) - .filter(isJSDocComment) - .forEach(parseComment); + (path.node[type] || []).filter(isJSDocComment).forEach(parseComment); } }); diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js index 9b80aa00a..b569a7441 100644 --- a/lib/extractors/exported.js +++ b/lib/extractors/exported.js @@ -19,9 +19,13 @@ var traverse = require('babel-traverse').default, * @returns {Array} comments * @private */ -function walkExported(ast/*: Object */, data/*: { +function walkExported( + ast /*: Object */, + data /*: { file: string -} */, addComment/*: Function */) { +} */, + addComment /*: Function */ +) { var newResults = []; var filename = data.file; var dataCache = Object.create(null); @@ -35,7 +39,10 @@ function walkExported(ast/*: Object */, data/*: { if (!comments.length) { // If this is the first declarator we check for comments on the VariableDeclaration. - if (t.isVariableDeclarator(path) && path.parentPath.get('declarations')[0] === path) { + if ( + t.isVariableDeclarator(path) && + path.parentPath.get('declarations')[0] === path + ) { return getComments(data, path.parentPath); } @@ -43,15 +50,24 @@ function walkExported(ast/*: Object */, data/*: { return added ? [added] : []; } - return comments.map(function (comment) { - return addComment(data, comment.value, comment.loc, path, path.node.loc, true); - }).filter(Boolean); + return comments + .map(function(comment) { + return addComment( + data, + comment.value, + comment.loc, + path, + path.node.loc, + true + ); + }) + .filter(Boolean); } function addComments(data, path, overrideName) { var comments = getComments(data, path); if (overrideName) { - comments.forEach(function (comment) { + comments.forEach(function(comment) { comment.name = overrideName; }); } @@ -88,15 +104,22 @@ function walkExported(ast/*: Object */, data/*: { var specData = data; var local, exported; if (t.isExportDefaultSpecifier(specifier)) { - local ='default'; - } else { // ExportSpecifier + local = 'default'; + } else { + // ExportSpecifier local = specifier.node.local.name; } exported = specifier.node.exported.name; var bindingPath; if (source) { - var tmp = findExportDeclaration(dataCache, local, exportKind, filename, source.value); + var tmp = findExportDeclaration( + dataCache, + local, + exportKind, + filename, + source.value + ); bindingPath = tmp.ast; specData = tmp.data; } else if (exportKind === 'value') { @@ -108,7 +131,9 @@ function walkExported(ast/*: Object */, data/*: { } if (bindingPath === undefined) { - throw new Error(`Unable to find the value ${exported} in ${specData.file}`); + throw new Error( + `Unable to find the value ${exported} in ${specData.file}` + ); } traverseExportedSubtree(bindingPath, specData, addComments, exported); }); @@ -170,7 +195,13 @@ function getCachedData(dataCache, filePath) { } // Loads a module and finds the exported declaration. -function findExportDeclaration(dataCache, name, exportKind, referrer, filename) { +function findExportDeclaration( + dataCache, + name, + exportKind, + referrer, + filename +) { var depPath = nodePath.resolve(nodePath.dirname(referrer), filename); var tmp = getCachedData(dataCache, depPath); var ast = tmp.ast; @@ -189,8 +220,11 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename) var declaration = path.get('declaration'); if (t.isDeclaration(declaration)) { var bindingName; - if (declaration.isFunctionDeclaration() || declaration.isClassDeclaration() || - declaration.isTypeAlias()) { + if ( + declaration.isFunctionDeclaration() || + declaration.isClassDeclaration() || + declaration.isTypeAlias() + ) { bindingName = declaration.node.id.name; } else if (declaration.isVariableDeclaration()) { // TODO: Multiple declarations. @@ -224,7 +258,13 @@ function findExportDeclaration(dataCache, name, exportKind, referrer, filename) if (exported === name) { if (source) { // export {local as exported} from './file.js'; - var tmp = findExportDeclaration(dataCache, local, exportKind, depPath, source.value); + var tmp = findExportDeclaration( + dataCache, + local, + exportKind, + depPath, + source.value + ); rv = tmp.ast; data = tmp.data; if (!rv) { diff --git a/lib/filter_access.js b/lib/filter_access.js index c5ce346a1..5cfe53650 100644 --- a/lib/filter_access.js +++ b/lib/filter_access.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -13,7 +12,10 @@ var walk = require('./walk'); * @param {Array} comments parsed comments (can be nested) * @return {Array} filtered comments */ -function filterAccess(levels/*: Array*/, comments/*: Array*/) { +function filterAccess( + levels /*: Array*/, + comments /*: Array*/ +) { levels = levels || ['public', 'undefined', 'protected']; function filter(comment) { diff --git a/lib/flow_doctrine.js b/lib/flow_doctrine.js index 3e7e079ae..b0b75f153 100644 --- a/lib/flow_doctrine.js +++ b/lib/flow_doctrine.js @@ -1,24 +1,23 @@ - 'use strict'; /* @flow */ var namedTypes = { - 'NumberTypeAnnotation': 'number', - 'BooleanTypeAnnotation': 'boolean', - 'StringTypeAnnotation': 'string' + NumberTypeAnnotation: 'number', + BooleanTypeAnnotation: 'boolean', + StringTypeAnnotation: 'string' }; var oneToOne = { - 'AnyTypeAnnotation': 'AllLiteral', - 'MixedTypeAnnotation': 'AllLiteral', - 'NullLiteralTypeAnnotation': 'NullLiteral', - 'VoidTypeAnnotation': 'VoidLiteral' + AnyTypeAnnotation: 'AllLiteral', + MixedTypeAnnotation: 'AllLiteral', + NullLiteralTypeAnnotation: 'NullLiteral', + VoidTypeAnnotation: 'VoidLiteral' }; var literalTypes = { - 'BooleanLiteralTypeAnnotation': 'BooleanLiteralType', - 'NumericLiteralTypeAnnotation': 'NumericLiteralType', - 'StringLiteralTypeAnnotation': 'StringLiteralType' + BooleanLiteralTypeAnnotation: 'BooleanLiteralType', + NumericLiteralTypeAnnotation: 'NumericLiteralType', + StringLiteralTypeAnnotation: 'StringLiteralType' }; function propertyToField(property) { @@ -49,7 +48,7 @@ function propertyToField(property) { * @param {Object} type babel-parsed flow type * @returns {Object} doctrine compatible type */ -function flowDoctrine(type/*: Object */)/*: DoctrineType*/ { +function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { if (type.type in namedTypes) { let doctrineType = { type: 'NameExpression', @@ -59,87 +58,87 @@ function flowDoctrine(type/*: Object */)/*: DoctrineType*/ { } if (type.type in oneToOne) { - return {type: oneToOne[type.type]}; + return { type: oneToOne[type.type] }; } switch (type.type) { - case 'NullableTypeAnnotation': - return { - type: 'NullableType', - expression: flowDoctrine(type.typeAnnotation) - }; - case 'UnionTypeAnnotation': - return { - type: 'UnionType', - elements: type.types.map(flowDoctrine) - }; - - // [number] - // [string, boolean, number] - case 'TupleTypeAnnotation': - return { - type: 'ArrayType', - elements: type.types.map(flowDoctrine) - }; - - // number[] - case 'ArrayTypeAnnotation': - return { - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [flowDoctrine(type.elementType)] - }; + case 'NullableTypeAnnotation': + return { + type: 'NullableType', + expression: flowDoctrine(type.typeAnnotation) + }; + case 'UnionTypeAnnotation': + return { + type: 'UnionType', + elements: type.types.map(flowDoctrine) + }; - // (y: number) => bool - case 'FunctionTypeAnnotation': - return { - type: 'FunctionType', - params: type.params.map(param => { - let name = ''; - if (param.name && param.name.name) { - name = param.name.name; - } - return { - type: 'ParameterType', - name, - expression: flowDoctrine(param.typeAnnotation) - }; - }), - result: flowDoctrine(type.returnType) - }; + // [number] + // [string, boolean, number] + case 'TupleTypeAnnotation': + return { + type: 'ArrayType', + elements: type.types.map(flowDoctrine) + }; - case 'GenericTypeAnnotation': - if (type.typeParameters) { + // number[] + case 'ArrayTypeAnnotation': return { type: 'TypeApplication', expression: { type: 'NameExpression', - name: type.id.name + name: 'Array' }, - applications: type.typeParameters.params.map(flowDoctrine) + applications: [flowDoctrine(type.elementType)] }; - } - return { - type: 'NameExpression', - name: type.id.name - }; + // (y: number) => bool + case 'FunctionTypeAnnotation': + return { + type: 'FunctionType', + params: type.params.map(param => { + let name = ''; + if (param.name && param.name.name) { + name = param.name.name; + } + return { + type: 'ParameterType', + name, + expression: flowDoctrine(param.typeAnnotation) + }; + }), + result: flowDoctrine(type.returnType) + }; + + case 'GenericTypeAnnotation': + if (type.typeParameters) { + return { + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: type.id.name + }, + applications: type.typeParameters.params.map(flowDoctrine) + }; + } - case 'ObjectTypeAnnotation': - if (type.properties) { return { - type: 'RecordType', - fields: type.properties.map(propertyToField) + type: 'NameExpression', + name: type.id.name }; - } - return { - type: 'NameExpression', - name: type.id.name - }; + case 'ObjectTypeAnnotation': + if (type.properties) { + return { + type: 'RecordType', + fields: type.properties.map(propertyToField) + }; + } + + return { + type: 'NameExpression', + name: type.id.name + }; } if (type.type in literalTypes) { diff --git a/lib/garbage_collect.js b/lib/garbage_collect.js index 94816c729..38569298a 100644 --- a/lib/garbage_collect.js +++ b/lib/garbage_collect.js @@ -1,6 +1,6 @@ /* @flow */ 'use strict'; -function garbageCollect(comment/*: Comment*/) { +function garbageCollect(comment /*: Comment*/) { delete comment.context.code; delete comment.context.ast; return comment; diff --git a/lib/git/find_git.js b/lib/git/find_git.js index beb029449..e3f342415 100644 --- a/lib/git/find_git.js +++ b/lib/git/find_git.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -11,7 +10,7 @@ var fs = require('fs'); * @param filename any file within a repository * @returns repository path */ -function findGit(filename/*: string*/) { +function findGit(filename /*: string*/) { var paths = filename.split(path.sep); for (var i = paths.length; i > 0; i--) { var p = path.resolve(paths.slice(0, i).join(path.sep) + path.sep + '.git'); diff --git a/lib/git/url_prefix.js b/lib/git/url_prefix.js index c35b6cb49..1e0972df6 100644 --- a/lib/git/url_prefix.js +++ b/lib/git/url_prefix.js @@ -17,12 +17,16 @@ var getRemoteOrigin = require('remote-origin-url'); * @returns {string} sha hash referring to current tree */ function parsePackedRefs(packedRefs, branchName) { - return packedRefs.split(/\n/) + return packedRefs + .split(/\n/) .filter(line => line[0] !== '#' && line[0] !== '^') - .reduce((memo, line) => { - memo[line.split(' ')[1]] = line.split(' ')[0]; - return memo; - }, {})[branchName]; + .reduce( + (memo, line) => { + memo[line.split(' ')[1]] = line.split(' ')[0]; + return memo; + }, + {} + )[branchName]; } /** @@ -33,7 +37,7 @@ function parsePackedRefs(packedRefs, branchName) { * @returns {string} base HTTPS url of the GitHub repository * @throws {Error} if the root is not a git repo */ -function getGithubURLPrefix(root/*: string*/) { +function getGithubURLPrefix(root /*: string*/) { var sha; try { var head = fs.readFileSync(path.join(root, '.git', 'HEAD'), 'utf8'); @@ -49,13 +53,19 @@ function getGithubURLPrefix(root/*: string*/) { // you have a folder filled with files that just contain sha // hashes. since this folder can be really big, packed refs // stores all the refs in one file instead. - sha = parsePackedRefs(fs.readFileSync(packedRefsName, 'utf8'), branchName); + sha = parsePackedRefs( + fs.readFileSync(packedRefsName, 'utf8'), + branchName + ); } } else { sha = head; } if (sha) { - return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + '/blob/' + sha.trim() + '/'; + return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + + '/blob/' + + sha.trim() + + '/'; } } catch (e) { return null; diff --git a/lib/github.js b/lib/github.js index 9c80a77e2..ac0462262 100644 --- a/lib/github.js +++ b/lib/github.js @@ -1,7 +1,6 @@ 'use strict'; /* @flow */ - var path = require('path'); var findGit = require('../lib/git/find_git'); var getGithubURLPrefix = require('../lib/git/url_prefix'); @@ -13,11 +12,12 @@ var getGithubURLPrefix = require('../lib/git/url_prefix'); * @param {Object} comment parsed comment * @return {Object} comment with github inferred */ -module.exports = function (comment/*: Comment*/) { +module.exports = function(comment /*: Comment*/) { var repoPath = findGit(comment.context.file); var root = repoPath ? path.dirname(repoPath) : '.'; var urlPrefix = getGithubURLPrefix(root); - var fileRelativePath = comment.context.file.replace(root + path.sep, '') + var fileRelativePath = comment.context.file + .replace(root + path.sep, '') .split(path.sep) .join('/'); @@ -25,8 +25,11 @@ module.exports = function (comment/*: Comment*/) { comment.context.github = { url: urlPrefix + fileRelativePath + - '#L' + comment.context.loc.start.line + '-' + - 'L' + comment.context.loc.end.line, + '#L' + + comment.context.loc.start.line + + '-' + + 'L' + + comment.context.loc.end.line, path: fileRelativePath }; } diff --git a/lib/hierarchy.js b/lib/hierarchy.js index 0c17fcffe..59776eb57 100644 --- a/lib/hierarchy.js +++ b/lib/hierarchy.js @@ -22,7 +22,6 @@ let getMembers = () => ({ static: Object.create(null) }); - /** * Pick only relevant properties from a comment to store them in * an inheritance chain @@ -30,12 +29,12 @@ let getMembers = () => ({ * @returns reduced comment * @private */ -function pick(comment/*: Comment */)/*: ?ReducedComment */ { +function pick(comment /*: Comment */) /*: ?ReducedComment */ { if (typeof comment.name !== 'string') { return undefined; } - var item/*: ReducedComment */ = { + var item /*: ReducedComment */ = { name: comment.name, kind: comment.kind }; @@ -52,21 +51,18 @@ function pick(comment/*: Comment */)/*: ?ReducedComment */ { * @returns {Array} nested comments, with only root comments * at the top level. */ -module.exports = function (comments/*: Array*/) { +module.exports = function(comments /*: Array*/) { var id = 0, root = { members: getMembers() }; - comments.forEach(comment => { var path = []; if (comment.memberof) { // TODO: full namepath parsing - path = comment.memberof - .split('.') - .map(segment => ['static', segment]); + path = comment.memberof.split('.').map(segment => ['static', segment]); } if (!comment.name) { @@ -75,17 +71,12 @@ module.exports = function (comments/*: Array*/) { }); } - path.push([ - comment.scope || 'static', - comment.name || ('unknown_' + id++) - ]); + path.push([comment.scope || 'static', comment.name || 'unknown_' + id++]); var node = root; while (path.length) { - var segment = path.shift(), - scope = segment[0], - name = segment[1]; + var segment = path.shift(), scope = segment[0], name = segment[1]; if (!hasOwnProperty.call(node.members[scope], name)) { node.members[scope][name] = { @@ -126,9 +117,12 @@ module.exports = function (comments/*: Array*/) { var node = nodes[name]; for (scope in node.members) { - node.members[scope] = toComments(node.members[scope], root || result, + node.members[scope] = toComments( + node.members[scope], + root || result, !node.comments.length, - node.comments.length ? path.concat(node.comments[0]) : []); + node.comments.length ? path.concat(node.comments[0]) : [] + ); } for (var i = 0; i < node.comments.length; i++) { @@ -172,9 +166,7 @@ module.exports = function (comments/*: Array*/) { comment.members.events = events; - comment.path = path.map(pick) - .concat(pick(comment)) - .filter(Boolean); + comment.path = path.map(pick).concat(pick(comment)).filter(Boolean); var scopeChars = { instance: '#', @@ -183,20 +175,26 @@ module.exports = function (comments/*: Array*/) { global: '' }; - comment.namespace = comment.path.reduce((memo, part) => { - if (part.kind === 'event') { - return memo + '.event:' + part.name; - } - let scopeChar = ''; - if (part.scope) { - scopeChar = scopeChars[part.scope]; - } - return memo + scopeChar + part.name; - }, ''); + comment.namespace = comment.path.reduce( + (memo, part) => { + if (part.kind === 'event') { + return memo + '.event:' + part.name; + } + let scopeChar = ''; + if (part.scope) { + scopeChar = scopeChars[part.scope]; + } + return memo + scopeChar + part.name; + }, + '' + ); if (hasUndefinedParent) { - var memberOfTag = comment.tags.filter(tag => tag.title === 'memberof')[0]; - var memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || 0; + var memberOfTag = comment.tags.filter( + tag => tag.title === 'memberof' + )[0]; + var memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || + 0; comment.errors.push({ message: `@memberof reference to ${comment.memberof} not found`, @@ -208,7 +206,6 @@ module.exports = function (comments/*: Array*/) { result.push(comment); } } - } return result; @@ -216,4 +213,3 @@ module.exports = function (comments/*: Array*/) { return toComments(root.members.static); }; - diff --git a/lib/infer/access.js b/lib/infer/access.js index 6a83f3377..1141fd501 100644 --- a/lib/infer/access.js +++ b/lib/infer/access.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -10,7 +9,7 @@ * @returns {Function} inference method * @private */ -function inferAccessWithPattern(pattern/*: ?string*/) { +function inferAccessWithPattern(pattern /*: ?string*/) { var re = pattern && new RegExp(pattern); /** @@ -20,10 +19,15 @@ function inferAccessWithPattern(pattern/*: ?string*/) { * @param {Object} comment parsed comment * @returns {Object} comment with access inferred */ - return function inferAccess(comment/*: Comment */) { + return function inferAccess(comment /*: Comment */) { // This needs to run after inferName beacuse we infer the access based on // the name. - if (re && comment.name && comment.access === undefined && re.test(comment.name)) { + if ( + re && + comment.name && + comment.access === undefined && + re.test(comment.name) + ) { comment.access = 'private'; } diff --git a/lib/infer/augments.js b/lib/infer/augments.js index 474ca1fb8..988df7dbe 100644 --- a/lib/infer/augments.js +++ b/lib/infer/augments.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -11,7 +10,7 @@ var generate = require('babel-generator').default, * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferAugments(comment/*: Comment */) { +function inferAugments(comment /*: Comment */) { if (comment.augments.length) { return comment; } diff --git a/lib/infer/finders.js b/lib/infer/finders.js index 6fd56fb5d..f3cd5d88d 100644 --- a/lib/infer/finders.js +++ b/lib/infer/finders.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -12,20 +11,21 @@ var t = require('babel-types'); * @returns {?Object} ast path, if one is found. * @private */ -function findTarget(path/*: Object */) { +function findTarget(path /*: Object */) { if (!path) { return path; } - if (t.isExportDefaultDeclaration(path) || - t.isExportNamedDeclaration(path) && path.has('declaration')) { + if ( + t.isExportDefaultDeclaration(path) || + (t.isExportNamedDeclaration(path) && path.has('declaration')) + ) { path = path.get('declaration'); } if (t.isVariableDeclaration(path)) { // var x = init; path = path.get('declarations')[0]; - } else if (t.isExpressionStatement(path)) { // foo.x = TARGET path = path.get('expression').get('right'); @@ -34,7 +34,6 @@ function findTarget(path/*: Object */) { path = path.get('value'); } - return path.node && path; } diff --git a/lib/infer/kind.js b/lib/infer/kind.js index 8bd45f876..a92ac5746 100644 --- a/lib/infer/kind.js +++ b/lib/infer/kind.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -10,7 +9,7 @@ var t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferKind(comment/*: Comment*/) { +function inferKind(comment /*: Comment*/) { if (comment.kind) { return comment; } diff --git a/lib/infer/membership.js b/lib/infer/membership.js index 062dad3c4..17cdeb7bf 100644 --- a/lib/infer/membership.js +++ b/lib/infer/membership.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -67,7 +66,10 @@ function extractThis(path, comment) { } if (n.isClassMethod(scope.block)) { - identifiers.push(scope.path.parentPath.parentPath.node.id.name, 'prototype'); + identifiers.push( + scope.path.parentPath.parentPath.node.id.name, + 'prototype' + ); } // function OldClass() { this.foo = 1 } @@ -79,16 +81,18 @@ function extractThis(path, comment) { } else if (n.isExportDefaultDeclaration(path.scope.parentBlock)) { identifiers.push(inferModuleName(comment)); } - // var Binding = function OldClass() { this.foo = 1 } - } else if (n.isFunctionExpression((scope.block))) { + // var Binding = function OldClass() { this.foo = 1 } + } else if (n.isFunctionExpression(scope.block)) { if (scope.path.parentPath.isVariableDeclarator()) { /** var Bar = function(foo) { this.foo = foo; }; */ identifiers = identifiers - .concat(scope.path.parentPath.get('id').node.name).concat('prototype'); + .concat(scope.path.parentPath.get('id').node.name) + .concat('prototype'); } else if (scope.path.parentPath.isAssignmentExpression()) { /** this.Bar = function(foo) { this.foo = foo; }; */ identifiers = identifiers - .concat(extractIdentifiers(scope.path.parentPath.get('left'))).concat('prototype'); + .concat(extractIdentifiers(scope.path.parentPath.get('left'))) + .concat('prototype'); } } } @@ -97,7 +101,6 @@ function extractThis(path, comment) { return identifiers; } - /** * Extract and return the chain of identifiers from the left hand side of expressions * of the forms `Foo = ...`, `Foo.bar = ...`, `Foo.bar.baz = ...`, etc. @@ -136,7 +139,11 @@ function countModuleIdentifiers(comment, identifiers) { return 1; } - if (identifiers.length >= 2 && identifiers[0] === 'module' && identifiers[1] === 'exports') { + if ( + identifiers.length >= 2 && + identifiers[0] === 'module' && + identifiers[1] === 'exports' + ) { return 2; } @@ -148,8 +155,7 @@ function countModuleIdentifiers(comment, identifiers) { * @param comment parsed comment * @returns the normalized comment */ -function normalizeMemberof(comment/*: Comment*/)/*: Comment */ { - +function normalizeMemberof(comment /*: Comment*/) /*: Comment */ { if (typeof comment.memberof != 'string') { return comment; } @@ -184,10 +190,9 @@ function normalizeMemberof(comment/*: Comment*/)/*: Comment */ { * @param {Object} comment parsed comment * @returns {Object} comment with membership inferred */ -module.exports = function () { +module.exports = function() { var currentModule; - /** * Set `memberof` and `instance`/`static` tags on `comment` based on the * array of `identifiers`. If the last element of the `identifiers` is @@ -203,7 +208,11 @@ module.exports = function () { * @private */ function inferMembershipFromIdentifiers(comment, identifiers, explicitScope) { - if (identifiers.length === 1 && identifiers[0] === 'module' && comment.name === 'exports') { + if ( + identifiers.length === 1 && + identifiers[0] === 'module' && + comment.name === 'exports' + ) { comment.name = inferModuleName(currentModule || comment); return comment; } @@ -232,7 +241,7 @@ module.exports = function () { return comment; } - function shouldSkipInference(comment/*: Comment */)/*: boolean */ { + function shouldSkipInference(comment /*: Comment */) /*: boolean */ { // If someone uses the @name tag, they explicitly ask for inference // to be skipped. if (comment.tags.some(tag => tag.title === 'name')) { @@ -254,8 +263,7 @@ module.exports = function () { return false; } - return function inferMembership(comment/*: Comment */) { - + return function inferMembership(comment /*: Comment */) { // First skip inference if the user indicates it or if it isn't possible. if (shouldSkipInference(comment)) { return comment; @@ -276,15 +284,16 @@ module.exports = function () { // INFERENCE =============================================================== // Deal with an oddity of espree: the jsdoc comment is attached to a different // node in the two expressions `a.b = c` vs `a.b = function () {}`. - if (path.isExpressionStatement() && + if ( + path.isExpressionStatement() && path.get('expression').isAssignmentExpression() && - path.get('expression').get('left').isMemberExpression()) { + path.get('expression').get('left').isMemberExpression() + ) { path = path.get('expression').get('left'); } // Same as above but for `b: c` vs `b: function () {}`. - if (path.isObjectProperty() && - path.get('key').isIdentifier()) { + if (path.isObjectProperty() && path.get('key').isIdentifier()) { path = path.get('key'); } @@ -301,7 +310,10 @@ module.exports = function () { extractIdentifiers(path) ); if (memberIdentifiers.length >= 2) { - return inferMembershipFromIdentifiers(comment, memberIdentifiers.slice(0, -1)); + return inferMembershipFromIdentifiers( + comment, + memberIdentifiers.slice(0, -1) + ); } return comment; } @@ -313,19 +325,22 @@ module.exports = function () { // var Foo = class { bar() { } } // class Foo { prop: T } // var Foo = class { prop: T } - if ((path.isClassMethod() || path.isClassProperty()) && - path.parentPath.isClassBody() && - path.parentPath.parentPath.isClass()) { - + if ( + (path.isClassMethod() || path.isClassProperty()) && + path.parentPath.isClassBody() && + path.parentPath.parentPath.isClass() + ) { var scope = 'instance'; if (path.node.static == true) { scope = 'static'; } if (path.parentPath.parentPath.isExpression()) { - return inferMembershipFromIdentifiers(comment, + return inferMembershipFromIdentifiers( + comment, extractIdentifiers(path.parentPath.parentPath.parentPath.get('left')), - scope); + scope + ); } var declarationNode = path.parentPath.parentPath.node; @@ -333,10 +348,18 @@ module.exports = function () { // export default function () {} // export default class {} // Use module name instead. - return inferMembershipFromIdentifiers(comment, [pathParse(comment.context.file).name], scope); + return inferMembershipFromIdentifiers( + comment, + [pathParse(comment.context.file).name], + scope + ); } - return inferMembershipFromIdentifiers(comment, [declarationNode.id.name], scope); + return inferMembershipFromIdentifiers( + comment, + [declarationNode.id.name], + scope + ); } // Whether something is an ObjectMethod (shorthand like foo() {} ) @@ -346,49 +369,44 @@ module.exports = function () { // and then have the logic for the numerous ways an object can be named. var objectParent; - if (path.isIdentifier() && + if ( + path.isIdentifier() && path.parentPath.isObjectProperty() && - path.parentPath.parentPath.isObjectExpression()) { + path.parentPath.parentPath.isObjectExpression() + ) { objectParent = path.parentPath.parentPath; - } else if (path.isObjectMethod() && - path.parentPath.isObjectExpression()) { + } else if (path.isObjectMethod() && path.parentPath.isObjectExpression()) { objectParent = path.parentPath; } // Confirm that the thing being documented is a property of an object. if (objectParent) { - // The @lends comment is sometimes attached to the first property rather than // the object expression itself. var lendsIdentifiers = findLendsIdentifiers(objectParent) || - findLendsIdentifiers(objectParent.get('properties')[0]); + findLendsIdentifiers(objectParent.get('properties')[0]); if (lendsIdentifiers) { - return inferMembershipFromIdentifiers(comment, lendsIdentifiers); - } else if (objectParent.parentPath.isAssignmentExpression()) { - // Foo = { ... }; // Foo.prototype = { ... }; // Foo.bar = { ... }; - return inferMembershipFromIdentifiers(comment, - extractIdentifiers(objectParent.parentPath.get('left'))); - + return inferMembershipFromIdentifiers( + comment, + extractIdentifiers(objectParent.parentPath.get('left')) + ); } else if (objectParent.parentPath.isVariableDeclarator()) { - // var Foo = { ... }; - return inferMembershipFromIdentifiers(comment, - [objectParent.parentPath.get('id').node.name]); - + return inferMembershipFromIdentifiers(comment, [ + objectParent.parentPath.get('id').node.name + ]); } else if (objectParent.parentPath.isExportDefaultDeclaration()) { - // export default { ... }; - return inferMembershipFromIdentifiers(comment, - [inferModuleName(currentModule || comment)]); - + return inferMembershipFromIdentifiers(comment, [ + inferModuleName(currentModule || comment) + ]); } - } // var function Foo() { diff --git a/lib/infer/name.js b/lib/infer/name.js index 701e291dd..17bba104d 100644 --- a/lib/infer/name.js +++ b/lib/infer/name.js @@ -1,9 +1,7 @@ - 'use strict'; /* @flow */ -var pathParse = require('parse-filepath'), - t = require('babel-types'); +var pathParse = require('parse-filepath'), t = require('babel-types'); /** * Infers a `name` tag from the context. @@ -12,7 +10,7 @@ var pathParse = require('parse-filepath'), * @param {Object} comment parsed comment * @returns {Object} comment with name inferred */ -function inferName(comment/*: Comment */) { +function inferName(comment /*: Comment */) { if (comment.name) { return comment; } @@ -76,7 +74,9 @@ function inferName(comment/*: Comment */) { * @private */ StringLiteral(path) { - if (path.parent.type === 'ObjectProperty' && path.node === path.parent.key) { + if ( + path.parent.type === 'ObjectProperty' && path.node === path.parent.key + ) { if (inferName(path, path.node)) { path.stop(); } diff --git a/lib/infer/params.js b/lib/infer/params.js index d5bcb0c55..c65d5709e 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -23,11 +22,17 @@ function addPrefix(doc, prefix) { * @param {Object} param ESTree node * @returns {Object} JSDoc param */ -function paramWithDefaultToDoc(param, comment, i)/*: CommentTag | Array */ { +function paramWithDefaultToDoc( + param, + comment, + i +) /*: CommentTag | Array */ { var newParam = paramToDoc(param.left, comment, i, ''); var defaultValue = comment.context.code.substring( - param.right.start, param.right.end); + param.right.start, + param.right.end + ); // this is a destructuring parameter with defaults if (Array.isArray(newParam)) { @@ -35,10 +40,10 @@ function paramWithDefaultToDoc(param, comment, i)/*: CommentTag | Array | CommentTag */ { - - function destructuringPropertyToDoc(property)/*: Array | CommentTag */ { +function paramToDoc( + param, + comment /*: Comment */, + i /*: number */, + prefix /*: string */ +) /*: Array | CommentTag */ { + function destructuringPropertyToDoc( + property + ) /*: Array | CommentTag */ { if (property.type === 'ObjectProperty') { - return paramToDoc(property.value, comment, i, prefix + '$' + String(i) + '.'); + return paramToDoc( + property.value, + comment, + i, + prefix + '$' + String(i) + '.' + ); } else if (property.type === 'Identifier') { // if the destructuring type is an array, the elements // in it are identifiers @@ -87,30 +100,34 @@ function paramToDoc(param, throw new Error(`Unknown property encountered: ${property.type}`); } - function destructuringObjectParamToDoc(param)/*: Array */ { - return [{ - title: 'param', - name: '$' + String(i), - type: flowDoctrine(param) || { - type: 'NameExpression', - name: 'Object' + function destructuringObjectParamToDoc(param) /*: Array */ { + return [ + { + title: 'param', + name: '$' + String(i), + type: flowDoctrine(param) || { + type: 'NameExpression', + name: 'Object' + } } - }].concat(param.properties.map(destructuringPropertyToDoc)); + ].concat(param.properties.map(destructuringPropertyToDoc)); } - function destructuringArrayParamToDoc(param)/*: Array */ { - return [{ - title: 'param', - name: '$' + String(i), - type: flowDoctrine(param) || { - type: 'NameExpression', - name: 'Array' + function destructuringArrayParamToDoc(param) /*: Array */ { + return [ + { + title: 'param', + name: '$' + String(i), + type: flowDoctrine(param) || { + type: 'NameExpression', + name: 'Array' + } } - }].concat(param.elements.map(destructuringPropertyToDoc)); + ].concat(param.elements.map(destructuringPropertyToDoc)); } - function restParamToDoc(param)/*: CommentTag */ { - let type/*: DoctrineType */ = { + function restParamToDoc(param) /*: CommentTag */ { + let type /*: DoctrineType */ = { type: 'RestType' }; if (param.typeAnnotation) { @@ -142,7 +159,7 @@ function paramToDoc(param, return addPrefix(restParamToDoc(param), prefix); } - var newParam/*: CommentTag */ = { + var newParam /*: CommentTag */ = { title: 'param', name: param.name, lineNumber: param.loc.start.line @@ -158,13 +175,18 @@ function paramToDoc(param, function insertBeforeDependents(comment, comments) { var dependentNamePrefix = comment.name + '.'; - for (var insertionIndex = 0; insertionIndex < comments.length; insertionIndex++) { + for ( + var insertionIndex = 0; + insertionIndex < comments.length; + insertionIndex++ + ) { let commentName = comments[insertionIndex].name; if (commentName && commentName.indexOf(dependentNamePrefix) === 0) { break; } } - return comments.slice(0, insertionIndex) + return comments + .slice(0, insertionIndex) .concat(comment) .concat(comments.slice(insertionIndex)); } @@ -175,7 +197,7 @@ function insertBeforeDependents(comment, comments) { * @param {Object} comment parsed comment * @returns {Object} comment with parameters */ -function inferParams(comment/*: Comment */) { +function inferParams(comment /*: Comment */) { var path = findTarget(comment.context.ast); // In case of `/** */ var x = function () {}` findTarget returns @@ -191,7 +213,7 @@ function inferParams(comment/*: Comment */) { // Ensure that explicitly specified parameters are not overridden // by inferred parameters var existingParams = {}; - comment.params.forEach(function (param) { + comment.params.forEach(function(param) { if (typeof param.name === 'string') { existingParams[param.name] = param; } @@ -201,10 +223,13 @@ function inferParams(comment/*: Comment */) { var i = 0; path.node.params - .reduce(function (params, param, i) { - return params.concat(paramToDoc(param, comment, i, '')); - }, []) - .forEach(function (doc) { + .reduce( + function(params, param, i) { + return params.concat(paramToDoc(param, comment, i, '')); + }, + [] + ) + .forEach(function(doc) { if (!existingParams.hasOwnProperty(doc.name)) { // This type is not explicitly documented comment.params = insertBeforeDependents(doc, comment.params); @@ -215,8 +240,9 @@ function inferParams(comment/*: Comment */) { if (doc.type) { existingParams[doc.name].type = doc.type; } - } else if (existingParams[doc.name].type.type !== 'OptionalType' && - doc.default) { + } else if ( + existingParams[doc.name].type.type !== 'OptionalType' && doc.default + ) { existingParams[doc.name].type = { type: 'OptionalType', expression: existingParams[doc.name].type, diff --git a/lib/infer/properties.js b/lib/infer/properties.js index baed1fac5..375c92c6a 100644 --- a/lib/infer/properties.js +++ b/lib/infer/properties.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -12,7 +11,7 @@ function prefixedName(name, prefix) { return name; } -function propertyToDoc(property, prefix)/*: CommentTag */ { +function propertyToDoc(property, prefix) /*: CommentTag */ { var type = flowDoctrine(property.value); if (property.optional) { type = { @@ -28,15 +27,13 @@ function propertyToDoc(property, prefix)/*: CommentTag */ { }; } - /** * Infers properties of TypeAlias objects (Flow or TypeScript type definitions) * * @param {Object} comment parsed comment * @returns {Object} comment with inferred properties */ -function inferProperties(comment/*: Comment */)/*: Comment */ { - +function inferProperties(comment /*: Comment */) /*: Comment */ { let explicitProperties = new Set(); // Ensure that explicitly specified properties are not overridden // by inferred properties @@ -44,9 +41,11 @@ function inferProperties(comment/*: Comment */)/*: Comment */ { function inferProperties(value, prefix) { if (value.type === 'ObjectTypeAnnotation') { - value.properties.forEach(function (property) { + value.properties.forEach(function(property) { if (!explicitProperties.has(prefixedName(property.key.name, prefix))) { - comment.properties = comment.properties.concat(propertyToDoc(property, prefix)); + comment.properties = comment.properties.concat( + propertyToDoc(property, prefix) + ); // Nested type parameters if (property.value.type === 'ObjectTypeAnnotation') { inferProperties(property.value, prefix.concat(property.key.name)); diff --git a/lib/infer/return.js b/lib/infer/return.js index 9711d0ad7..5e257f16d 100644 --- a/lib/infer/return.js +++ b/lib/infer/return.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -13,10 +12,12 @@ var findTarget = require('./finders').findTarget, * @param {Object} comment parsed comment * @returns {Object} comment with return tag inferred */ -function inferReturn(comment/*: Comment */) { - if (Array.isArray(comment.returns) && +function inferReturn(comment /*: Comment */) { + if ( + Array.isArray(comment.returns) && comment.returns.length && - comment.returns[0].type) { + comment.returns[0].type + ) { return comment; } var path = findTarget(comment.context.ast); @@ -28,17 +29,17 @@ function inferReturn(comment/*: Comment */) { fn = fn.init; } - if (t.isFunction(fn) && - fn.returnType && - fn.returnType.typeAnnotation) { + if (t.isFunction(fn) && fn.returnType && fn.returnType.typeAnnotation) { var returnType = flowDoctrine(fn.returnType.typeAnnotation); if (comment.returns && comment.returns.length > 0) { comment.returns[0].type = returnType; } else { - comment.returns = [{ - title: 'returns', - type: returnType - }]; + comment.returns = [ + { + title: 'returns', + type: returnType + } + ]; } } return comment; diff --git a/lib/infer/should_skip_inference.js b/lib/infer/should_skip_inference.js index 5cacc1686..2dc8485dc 100644 --- a/lib/infer/should_skip_inference.js +++ b/lib/infer/should_skip_inference.js @@ -5,7 +5,7 @@ * Decide whether a comment should go through the AST inference * stage based on whether it has an explicit `@name` tag. */ -function shouldSkipInference(comment/*: Comment */) /*: boolean */ { +function shouldSkipInference(comment /*: Comment */) /*: boolean */ { return comment.tags.some(tag => tag.title === 'name'); } diff --git a/lib/infer/type.js b/lib/infer/type.js index 3be875298..32af6c8e2 100644 --- a/lib/infer/type.js +++ b/lib/infer/type.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -7,9 +6,9 @@ var findTarget = require('./finders').findTarget, t = require('babel-types'); var constTypeMapping = { - 'BooleanLiteral': {type: 'BooleanTypeAnnotation'}, - 'NumericLiteral': {type: 'NumberTypeAnnotation'}, - 'StringLiteral': {type: 'StringTypeAnnotation'} + BooleanLiteral: { type: 'BooleanTypeAnnotation' }, + NumericLiteral: { type: 'NumberTypeAnnotation' }, + StringLiteral: { type: 'StringTypeAnnotation' } }; /** @@ -19,7 +18,7 @@ var constTypeMapping = { * @param {Object} comment parsed comment * @returns {Object} comment with type tag inferred */ -function inferType(comment/*: Comment */) { +function inferType(comment /*: Comment */) { if (comment.type) { return comment; } @@ -32,18 +31,18 @@ function inferType(comment/*: Comment */) { var n = path.node; var type; switch (n.type) { - case 'VariableDeclarator': - type = n.id.typeAnnotation; - if (!type && comment.kind === 'constant') { - type = constTypeMapping[n.init.type]; - } - break; - case 'ClassProperty': - type = n.typeAnnotation; - break; - case 'TypeAlias': - type = n.right; - break; + case 'VariableDeclarator': + type = n.id.typeAnnotation; + if (!type && comment.kind === 'constant') { + type = constTypeMapping[n.init.type]; + } + break; + case 'ClassProperty': + type = n.typeAnnotation; + break; + case 'TypeAlias': + type = n.right; + break; } if (type) { if (t.isTypeAnnotation(type)) { diff --git a/lib/inline_tokenizer.js b/lib/inline_tokenizer.js index 60b67c040..062ce30f9 100644 --- a/lib/inline_tokenizer.js +++ b/lib/inline_tokenizer.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; - /** * Create a tokenizer method for Remark, our Markdown processor, * that is able to parse JSDoc inline tokens @@ -13,7 +12,7 @@ * @returns {Function} tokenizer */ function makeTokenizer(type, regex) { - var tokenizer = function (eat, value) { + var tokenizer = function(eat, value) { var match = regex.exec(value); if (!match) { @@ -25,15 +24,17 @@ function makeTokenizer(type, regex) { url: match[1], title: null, jsdoc: true, - children: [{ - type: 'text', - value: match[2] || match[1] - }] + children: [ + { + type: 'text', + value: match[2] || match[1] + } + ] }); }; tokenizer.notInLink = true; - tokenizer.locator = function (value, fromIndex) { + tokenizer.locator = function(value, fromIndex) { return value.indexOf('{@' + type, fromIndex); }; @@ -41,7 +42,10 @@ function makeTokenizer(type, regex) { } var tokenizeLink = makeTokenizer('link', /^\{@link\s+(.+?)(?:[\s|](.*?))?\}/); -var tokenizeTutorial = makeTokenizer('tutorial', /^\{@tutorial\s+(.+?)(?:[\s|](.*?))?\}/); +var tokenizeTutorial = makeTokenizer( + 'tutorial', + /^\{@tutorial\s+(.+?)(?:[\s|](.*?))?\}/ +); /** * A remark plugin that installs @@ -55,11 +59,15 @@ var tokenizeTutorial = makeTokenizer('tutorial', /^\{@tutorial\s+(.+?)(?:[\s|](. * @param {Object} processor - remark instance * @returns {undefined} */ -module.exports = function (processor/*: Object*/) { +module.exports = function(processor /*: Object*/) { var proto = processor.Parser.prototype; proto.inlineTokenizers.tokenizeLink = tokenizeLink; proto.inlineTokenizers.tokenizeTutorial = tokenizeTutorial; var methods = proto.inlineMethods; - methods.splice(methods.indexOf('inlineText'), 0, - 'tokenizeLink', 'tokenizeTutorial'); + methods.splice( + methods.indexOf('inlineText'), + 0, + 'tokenizeLink', + 'tokenizeTutorial' + ); }; diff --git a/lib/input/dependency.js b/lib/input/dependency.js index 39e9f9a51..c1bb5f1e8 100644 --- a/lib/input/dependency.js +++ b/lib/input/dependency.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -20,8 +19,10 @@ var smartGlob = require('../smart_glob.js'); * @param config optional options passed * @returns results */ -function dependencyStream(indexes/*: Array*/, - config/*: DocumentationConfig */)/*: Promise>*/ { +function dependencyStream( + indexes /*: Array*/, + config /*: DocumentationConfig */ +) /*: Promise>*/ { var md = mdeps({ /** * Determine whether a module should be included in documentation @@ -29,24 +30,27 @@ function dependencyStream(indexes/*: Array*/, * @returns {boolean} true if the module should be included. */ filter: id => !!config.external || moduleFilters.internalOnly(id), - extensions: [].concat(config.requireExtension || []) + extensions: [] + .concat(config.requireExtension || []) .map(ext => '.' + ext.replace(/^\./, '')) .concat(['.js', '.json', '.es6', '.jsx']), - transform: [babelify.configure({ - sourceMap: false, - compact: false, - presets: [ - require('babel-preset-es2015'), - require('babel-preset-stage-0'), - require('babel-preset-react') - ], - plugins: [ - require('babel-plugin-transform-decorators-legacy').default, - // Required to support webpack's System.import - // https://github.com/documentationjs/documentation/issues/578 - require('babel-plugin-system-import-transformer').default - ] - })], + transform: [ + babelify.configure({ + sourceMap: false, + compact: false, + presets: [ + require('babel-preset-es2015'), + require('babel-preset-stage-0'), + require('babel-preset-react') + ], + plugins: [ + require('babel-plugin-transform-decorators-legacy').default, + // Required to support webpack's System.import + // https://github.com/documentationjs/documentation/issues/578 + require('babel-plugin-system-import-transformer').default + ] + }) + ], postFilter: moduleFilters.externals(indexes, config) }); smartGlob(indexes, config.parseExtension).forEach(index => { @@ -56,23 +60,29 @@ function dependencyStream(indexes/*: Array*/, return new Promise((resolve, reject) => { md.once('error', reject); - md.pipe(concat(function (inputs) { - resolve(inputs - .filter(input => - // At this point, we may have allowed a JSON file to be caught by - // module-deps, or anything else allowed by requireExtension. - // otherwise module-deps would complain about - // it not being found. But Babel can't parse JSON, so we filter non-JavaScript - // files away. - config.parseExtension.indexOf( - path.extname(input.file).replace(/^\./, '') - ) > -1) - .map(input => { - // remove source file, since it's transformed anyway - delete input.source; - return input; - })); - })); + md.pipe( + concat(function(inputs) { + resolve( + inputs + .filter( + input => + // At this point, we may have allowed a JSON file to be caught by + // module-deps, or anything else allowed by requireExtension. + // otherwise module-deps would complain about + // it not being found. But Babel can't parse JSON, so we filter non-JavaScript + // files away. + config.parseExtension.indexOf( + path.extname(input.file).replace(/^\./, '') + ) > -1 + ) + .map(input => { + // remove source file, since it's transformed anyway + delete input.source; + return input; + }) + ); + }) + ); }); } diff --git a/lib/input/shallow.js b/lib/input/shallow.js index 5727f0484..b459a0e84 100644 --- a/lib/input/shallow.js +++ b/lib/input/shallow.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -20,8 +19,10 @@ var smartGlob = require('../smart_glob.js'); * @param options parsing options * @return promise with parsed files */ -module.exports = function (indexes/*: Array*/, - config/*: DocumentationConfig */)/*: Promise>*/ { +module.exports = function( + indexes /*: Array*/, + config /*: DocumentationConfig */ +) /*: Promise>*/ { var objects = []; var strings = []; for (var index of indexes) { @@ -30,12 +31,16 @@ module.exports = function (indexes/*: Array*/, } else if (typeof index === 'object') { objects.push(index); } else { - return Promise.reject(new Error('Indexes should be either strings or objects')); + return Promise.reject( + new Error('Indexes should be either strings or objects') + ); } } - return Promise.resolve(objects - .concat(smartGlob(strings, config.parseExtension) - .map(file => ({ + return Promise.resolve( + objects.concat( + smartGlob(strings, config.parseExtension).map(file => ({ file - })))); + })) + ) + ); }; diff --git a/lib/is_jsdoc_comment.js b/lib/is_jsdoc_comment.js index 79835a428..f76d76b5c 100644 --- a/lib/is_jsdoc_comment.js +++ b/lib/is_jsdoc_comment.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -14,12 +13,15 @@ * @param {Object} comment an ast path of the comment * @return {boolean} whether it is valid */ -module.exports = function isJSDocComment(comment/*: { +module.exports = function isJSDocComment( + comment /*: { value: string, type: string -}*/) { +}*/ +) { var asterisks = comment.value.match(/^(\*+)/); return (comment.type === 'CommentBlock' || // estree - comment.type === 'Block') // get-comments / traditional - && asterisks && asterisks[ 1 ].length === 1; + comment.type === 'Block') && // get-comments / traditional + asterisks && + asterisks[1].length === 1; }; diff --git a/lib/lint.js b/lib/lint.js index 89575bc0f..b2fa03b0d 100644 --- a/lib/lint.js +++ b/lib/lint.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -8,13 +7,13 @@ var VFile = require('vfile'), reporter = require('vfile-reporter'); var CANONICAL = { - 'String': 'string', - 'Boolean': 'boolean', - 'Undefined': 'undefined', - 'Number': 'number', - 'array': 'Array', - 'date': 'Date', - 'object': 'Object' + String: 'string', + Boolean: 'boolean', + Undefined: 'undefined', + Number: 'number', + array: 'Array', + date: 'Date', + object: 'Object' }; /** @@ -24,12 +23,16 @@ var CANONICAL = { * @param {Object} comment parsed comment * @returns {Array} array of errors */ -function lintComments(comment/*: Comment*/) { - comment.tags.forEach(function (tag) { +function lintComments(comment /*: Comment*/) { + comment.tags.forEach(function(tag) { function nameInvariant(name) { if (name && typeof CANONICAL[name] === 'string') { comment.errors.push({ - message: 'type ' + name + ' found, ' + CANONICAL[name] + ' is standard', + message: 'type ' + + name + + ' found, ' + + CANONICAL[name] + + ' is standard', commentLineNumber: tag.lineNumber }); } @@ -67,14 +70,15 @@ function lintComments(comment/*: Comment*/) { * @param {Array} comments a list of comments * @return {string} user-readable output */ -function formatLint(comments/*: Array*/)/*: string */ { +function formatLint(comments /*: Array*/) /*: string */ { var vFiles = {}; - walk(comments, function (comment) { - comment.errors.forEach(function (error) { + walk(comments, function(comment) { + comment.errors.forEach(function(error) { var p = comment.context.file; - vFiles[p] = vFiles[p] || new VFile({ - path: p - }); + vFiles[p] = vFiles[p] || + new VFile({ + path: p + }); vFiles[p].warn(error.message, { line: comment.loc.start.line + (error.commentLineNumber || 0) }); diff --git a/lib/merge_config.js b/lib/merge_config.js index f0e765b19..ad2e9f2c3 100644 --- a/lib/merge_config.js +++ b/lib/merge_config.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -10,17 +9,17 @@ var yaml = require('js-yaml'), path = require('path'), stripComments = require('strip-json-comments'); -function processToc(config /*: DocumentationConfig */, absFilePath/*: string*/) { +function processToc( + config /*: DocumentationConfig */, + absFilePath /*: string*/ +) { if (!config || !config.toc) { return config; } config.toc = config.toc.map(entry => { if (entry && entry.file) { - entry.file = path.join( - path.dirname(absFilePath), - entry.file - ); + entry.file = path.join(path.dirname(absFilePath), entry.file); } return entry; @@ -37,16 +36,24 @@ function processToc(config /*: DocumentationConfig */, absFilePath/*: string*/) * @returns {Object} configuration with inferred parameters * @throws {Error} if the file cannot be read. */ -function mergePackage(config/*: Object */)/*: Promise */ { +function mergePackage(config /*: Object */) /*: Promise */ { if (config.noPackage) { return Promise.resolve(config); } - return readPkgUp() - .then(pkg => - _.defaults({}, _.mapKeys(_.pick(pkg.pkg, ['name', 'homepage', 'version']), - (val, key) => `project-${key}`), config)) - // Allow this to fail: this inference is not required. - .catch(() => config); + return ( + readPkgUp() + .then(pkg => + _.defaults( + {}, + _.mapKeys( + _.pick(pkg.pkg, ['name', 'homepage', 'version']), + (val, key) => `project-${key}` + ), + config + )) + // Allow this to fail: this inference is not required. + .catch(() => config) + ); } /** @@ -57,31 +64,35 @@ function mergePackage(config/*: Object */)/*: Promise */ { * @returns {Promise} configuration, if it can be parsed * @throws {Error} if the file cannot be read. */ -function mergeConfigFile(config)/*: Promise */ { - +function mergeConfigFile(config) /*: Promise */ { if (config && typeof config.config === 'string') { var filePath = config.config; var ext = path.extname(filePath); var absFilePath = path.resolve(process.cwd(), filePath); - return pify(fs).readFile(absFilePath, 'utf8') - .then(rawFile => { - if (ext === '.json') { - return Object.assign({}, config, processToc(JSON.parse(stripComments(rawFile)), absFilePath)); - } - return Object.assign({}, config, processToc(yaml.safeLoad(rawFile), absFilePath)); - }); + return pify(fs).readFile(absFilePath, 'utf8').then(rawFile => { + if (ext === '.json') { + return Object.assign( + {}, + config, + processToc(JSON.parse(stripComments(rawFile)), absFilePath) + ); + } + return Object.assign( + {}, + config, + processToc(yaml.safeLoad(rawFile), absFilePath) + ); + }); } return Promise.resolve(config || {}); } -function mergeConfig(config/*: Object */)/*: Promise */ { - +function mergeConfig(config /*: Object */) /*: Promise */ { config.parseExtension = (config.parseExtension || []) .concat(['js', 'jsx', 'es5', 'es6']); - return mergeConfigFile(config) - .then(mergePackage); + return mergeConfigFile(config).then(mergePackage); } module.exports = mergeConfig; diff --git a/lib/module_filters.js b/lib/module_filters.js index 501d7a7d9..9cb4de09c 100644 --- a/lib/module_filters.js +++ b/lib/module_filters.js @@ -5,10 +5,10 @@ var path = require('path'); var micromatch = require('micromatch'); // Skip external modules. Based on http://git.io/pzPO. -var internalModuleRegexp = process.platform === 'win32' ? - /* istanbul ignore next */ - /^(\.|\w:)/ : - /^[\/.]/; +var internalModuleRegexp = process.platform === 'win32' + ? /* istanbul ignore next */ + /^(\.|\w:)/ + : /^[\/.]/; /** * Module filters @@ -28,10 +28,13 @@ module.exports = { * @return {function} - A function for use as the module-deps `postFilter` * options. */ - externals: function externalModuleFilter(indexes/*: Array*/, options/*: Object*/) { + externals: function externalModuleFilter( + indexes /*: Array*/, + options /*: Object*/ + ) { var externalFilters = false; if (options.external) { - externalFilters = indexes.map((index) => { + externalFilters = indexes.map(index => { // grab the path of the top-level node_modules directory. var topNodeModules = path.join(path.dirname(index), 'node_modules'); return function matchGlob(file, pkg) { @@ -54,14 +57,10 @@ module.exports = { }); } - return function (id/*: string*/, - file/*: string*/, - pkg/*: Object*/) { + return function(id /*: string*/, file /*: string*/, pkg /*: Object*/) { var internal = internalModuleRegexp.test(id); - return internal || (externalFilters && - externalFilters - .some(f => f(file, pkg))); + return internal || + (externalFilters && externalFilters.some(f => f(file, pkg))); }; } }; - diff --git a/lib/nest.js b/lib/nest.js index af295d34d..753adf6e3 100644 --- a/lib/nest.js +++ b/lib/nest.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; - /** * Nest nestable tags, like param and property, into nested * arrays that are suitable for output. @@ -13,27 +12,34 @@ * @returns {Object} nested comment */ function nestTag( - comment/*: Comment */, - tagTitle/*: string */, - target/*: string */) { + comment /*: Comment */, + tagTitle /*: string */, + target /*: string */ +) { if (!comment[target]) { return comment; } - var result = [], - index = {}; + var result = [], index = {}; comment[target].forEach(tag => { var tagName = tag.name; if (tagName) { index[tagName] = tag; - var parts = tagName.split(/(\[\])?\./) + var parts = tagName + .split(/(\[\])?\./) .filter(part => part && part !== '[]'); if (parts.length > 1) { var parent = index[parts.slice(0, -1).join('.')]; if (parent === undefined) { comment.errors.push({ - message: '@' + tagTitle + ' ' + tag.name + '\'s parent ' + parts[0] + ' not found', + message: '@' + + tagTitle + + ' ' + + tag.name + + "'s parent " + + parts[0] + + ' not found', commentLineNumber: tag.lineNumber }); result.push(tag); @@ -64,9 +70,8 @@ function nestTag( * @param {Object} comment input comment * @return {Object} nested comment */ -function nest(comment/*: Comment*/) { - return nestTag(nestTag(comment, 'param', 'params'), - 'property', 'properties'); +function nest(comment /*: Comment*/) { + return nestTag(nestTag(comment, 'param', 'params'), 'property', 'properties'); } module.exports = nest; diff --git a/lib/output/highlighter.js b/lib/output/highlighter.js index 234c8b0f3..639043337 100644 --- a/lib/output/highlighter.js +++ b/lib/output/highlighter.js @@ -13,12 +13,13 @@ var hljs = require('highlight.js'); function visitor(node) { if (node.lang) { node.type = 'html'; - node.value = '
' +
-      hljs.highlightAuto(node.value, [node.lang]).value + '
'; + node.value = "
" +
+      hljs.highlightAuto(node.value, [node.lang]).value +
+      '
'; } } -module.exports = function (ast/*: Object*/) { +module.exports = function(ast /*: Object*/) { visit(ast, 'code', visitor); return ast; }; diff --git a/lib/output/html.js b/lib/output/html.js index 88445cac6..715200334 100644 --- a/lib/output/html.js +++ b/lib/output/html.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -25,8 +24,7 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments/*: Array*/, - config/*: DocumentationConfig*/) { +function html(comments /*: Array*/, config /*: DocumentationConfig*/) { return mergeConfig(config).then(config => { var themePath = '../../default_theme/'; if (config.theme) { diff --git a/lib/output/json.js b/lib/output/json.js index b56d4a82c..1e61b253b 100644 --- a/lib/output/json.js +++ b/lib/output/json.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -21,8 +20,7 @@ var walk = require('../walk'); * fs.writeFileSync('./output.json', output); * }); */ -function json(comments/*: Array*/)/*: Promise*/ { - +function json(comments /*: Array*/) /*: Promise*/ { walk(comments, comment => { delete comment.errors; if (comment.context) { diff --git a/lib/output/markdown.js b/lib/output/markdown.js index e7b2d36d9..33f8456ef 100644 --- a/lib/output/markdown.js +++ b/lib/output/markdown.js @@ -1,9 +1,7 @@ - 'use strict'; /* @flow */ -var remark = require('remark'), - markdownAST = require('./markdown_ast'); +var remark = require('remark'), markdownAST = require('./markdown_ast'); /** * Formats documentation as @@ -25,9 +23,11 @@ var remark = require('remark'), * fs.writeFileSync('./output.md', output); * }); */ -function markdown(comments/*: Array*/, args/*: Object*/)/*: Promise */ { - return markdownAST(comments, args) - .then(ast => remark().stringify(ast)); +function markdown( + comments /*: Array*/, + args /*: Object*/ +) /*: Promise */ { + return markdownAST(comments, args).then(ast => remark().stringify(ast)); } module.exports = markdown; diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index b93e6a776..29e0537a3 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; - var u = require('unist-builder'), remark = require('remark'), mergeConfig = require('../merge_config'), @@ -26,27 +25,32 @@ var DEFAULT_LANGUAGE = 'javascript'; * consult hljs.configure for the full list. * @returns {Promise} returns an eventual Markdown value */ -function markdownAST(comments/*: Array */, args/*: Object */) { - return mergeConfig(args) - .then(config => buildMarkdownAST(comments, config)); +function markdownAST(comments /*: Array */, args /*: Object */) { + return mergeConfig(args).then(config => buildMarkdownAST(comments, config)); } -function buildMarkdownAST(comments/*: Array */, config/*: DocumentationConfig*/) { - +function buildMarkdownAST( + comments /*: Array */, + config /*: DocumentationConfig*/ +) { // Configure code highlighting var hljsOptions = config.hljs || {}; hljs.configure(hljsOptions); - var linkerStack = new LinkerStack(config) - .namespaceResolver(comments, namespace => { - var slugger = new GithubSlugger(); - return '#' + slugger.slug(namespace); - }); + var linkerStack = new LinkerStack( + config + ).namespaceResolver(comments, namespace => { + var slugger = new GithubSlugger(); + return '#' + slugger.slug(namespace); + }); var formatType = _formatType.bind(undefined, linkerStack.link); var generatorComment = [ - u('html', '') + u( + 'html', + '' + ) ]; var tableOfContentsHeading = [ @@ -61,188 +65,284 @@ function buildMarkdownAST(comments/*: Array */, config/*: Documentation * @param {Object} comment a single comment * @returns {Object} remark-compatible AST */ - function generate(depth/*: number */, comment/*: Comment */) { - - function typeSection(comment/*: Comment */) { - return comment.type && u('paragraph', [ - u('text', 'Type: ') - ].concat( - formatType(comment.type) - )); + function generate(depth /*: number */, comment /*: Comment */) { + function typeSection(comment /*: Comment */) { + return comment.type && + u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type))); } - function paramList(params/*: Array */) { - return u('list', { ordered: false }, params.map(param => - u('listItem', [ - u('paragraph', [ - u('inlineCode', param.name), - u('text', ' '), - !!param.type && u('strong', formatType(param.type)), - u('text', ' ') - ].concat(param.description ? param.description.children : []) - .concat([ - !!param.default && u('paragraph', [ - u('text', ' (optional, default '), - u('inlineCode', param.default), - u('text', ')') - ]) - ]).filter(Boolean)) - ].concat(param.properties && paramList(param.properties)) - .filter(Boolean)))); + function paramList(params /*: Array */) { + return u( + 'list', + { ordered: false }, + params.map(param => + u( + 'listItem', + [ + u( + 'paragraph', + [ + u('inlineCode', param.name), + u('text', ' '), + !!param.type && u('strong', formatType(param.type)), + u('text', ' ') + ] + .concat(param.description ? param.description.children : []) + .concat([ + !!param.default && + u('paragraph', [ + u('text', ' (optional, default '), + u('inlineCode', param.default), + u('text', ')') + ]) + ]) + .filter(Boolean) + ) + ] + .concat(param.properties && paramList(param.properties)) + .filter(Boolean) + )) + ); } - function paramSection(comment/*: Comment */) { + function paramSection(comment /*: Comment */) { return comment.params.length > 0 && [ u('strong', [u('text', 'Parameters')]), paramList(comment.params) ]; } - function propertySection(comment/*: Comment */) { + function propertySection(comment /*: Comment */) { return comment.properties.length > 0 && [ u('strong', [u('text', 'Properties')]), propertyList(comment.properties) ]; } - function propertyList(properties/*: Array */) { - return u('list', { ordered: false }, + function propertyList(properties /*: Array */) { + return u( + 'list', + { ordered: false }, properties.map(property => - u('listItem', [ - u('paragraph', [ - u('inlineCode', property.name), - u('text', ' '), - u('strong', formatType(property.type)), - u('text', ' ') - ] - .concat(property.description ? property.description.children: []) - .filter(Boolean)), - property.properties && propertyList(property.properties) - ].filter(Boolean)))); - } - - function examplesSection(comment/*: Comment */) { - return comment.examples.length > 0 && [u('strong', [u('text', 'Examples')])] - .concat(comment.examples.reduce(function (memo, example) { - var language = hljsOptions.highlightAuto ? - hljs.highlightAuto(example.description).language : DEFAULT_LANGUAGE; - return memo.concat(example.caption ? - [u('paragraph', [u('emphasis', example.caption)])] : - []).concat([u('code', { lang: language }, example.description)]); - }, [])); + u( + 'listItem', + [ + u( + 'paragraph', + [ + u('inlineCode', property.name), + u('text', ' '), + u('strong', formatType(property.type)), + u('text', ' ') + ] + .concat( + property.description ? property.description.children : [] + ) + .filter(Boolean) + ), + property.properties && propertyList(property.properties) + ].filter(Boolean) + )) + ); } - function returnsSection(comment/*: Comment */) { - return comment.returns.length > 0 && comment.returns.map(returns => - u('paragraph', [ - u('text', 'Returns '), - u('strong', formatType(returns.type)), - u('text', ' ') - ].concat(returns.description ? returns.description.children : []))); + function examplesSection(comment /*: Comment */) { + return comment.examples.length > 0 && + [u('strong', [u('text', 'Examples')])].concat( + comment.examples.reduce( + function(memo, example) { + var language = hljsOptions.highlightAuto + ? hljs.highlightAuto(example.description).language + : DEFAULT_LANGUAGE; + return memo + .concat( + example.caption + ? [u('paragraph', [u('emphasis', example.caption)])] + : [] + ) + .concat([u('code', { lang: language }, example.description)]); + }, + [] + ) + ); } - function throwsSection(comment/*: Comment */) { - return comment.throws.length > 0 && - u('list', { ordered: false }, - comment.throws.map(returns => u('listItem', [ - u('paragraph', [ - u('text', 'Throws '), + function returnsSection(comment /*: Comment */) { + return comment.returns.length > 0 && + comment.returns.map(returns => + u( + 'paragraph', + [ + u('text', 'Returns '), u('strong', formatType(returns.type)), u('text', ' ') - ].concat(returns.description ? returns.description.children : [])) - ]))); + ].concat(returns.description ? returns.description.children : []) + )); } - function augmentsLink(comment/*: Comment */) { - return comment.augments.length > 0 && u('paragraph', [ - u('strong', [ - u('text', 'Extends '), - u('text', comment.augments.map(tag => tag.name).join(', ')) - ]) - ]); + function throwsSection(comment /*: Comment */) { + return comment.throws.length > 0 && + u( + 'list', + { ordered: false }, + comment.throws.map(returns => + u('listItem', [ + u( + 'paragraph', + [ + u('text', 'Throws '), + u('strong', formatType(returns.type)), + u('text', ' ') + ].concat( + returns.description ? returns.description.children : [] + ) + ) + ])) + ); } - function seeLink(comment/*: Comment */) { - return comment.sees.length > 0 && u('list', { ordered: false }, comment.sees.map(see => - u('listItem', [ + function augmentsLink(comment /*: Comment */) { + return comment.augments.length > 0 && + u('paragraph', [ u('strong', [ - u('text', 'See: ') - ].concat(see.children)) - ]) - )); + u('text', 'Extends '), + u('text', comment.augments.map(tag => tag.name).join(', ')) + ]) + ]); } - function githubLink(comment/*: Comment */) { - return comment.context && comment.context.github && u('paragraph', [ - u('link', { - title: 'Source code on GitHub', - url: comment.context.github.url - }, [u('text', comment.context.github.path + ':' + - comment.context.loc.start.line + '-' + - comment.context.loc.end.line)]) - ]); + function seeLink(comment /*: Comment */) { + return comment.sees.length > 0 && + u( + 'list', + { ordered: false }, + comment.sees.map(see => + u('listItem', [ + u('strong', [u('text', 'See: ')].concat(see.children)) + ])) + ); + } + + function githubLink(comment /*: Comment */) { + return comment.context && + comment.context.github && + u('paragraph', [ + u( + 'link', + { + title: 'Source code on GitHub', + url: comment.context.github.url + }, + [ + u( + 'text', + comment.context.github.path + + ':' + + comment.context.loc.start.line + + '-' + + comment.context.loc.end.line + ) + ] + ) + ]); } - function metaSection(comment/*: Comment */) { - let meta = ['version', 'since', 'copyright', 'author', 'license', 'deprecated'] - .filter(tag => comment[tag]); - return !!meta.length && [u('strong', [u('text', 'Meta')])].concat( - u('list', { ordered: false }, - meta - .map(tag => { - let metaContent; - if (tag === 'copyright' || tag === 'deprecated') { - metaContent = comment[tag]; - } else { - metaContent = u('text', comment[tag]); - } - return u('listItem', [ - u('paragraph', [ - u('strong', [u('text', tag)]), - u('text', ': '), - metaContent - ]) - ]); - }))); + function metaSection(comment /*: Comment */) { + let meta = [ + 'version', + 'since', + 'copyright', + 'author', + 'license', + 'deprecated' + ].filter(tag => comment[tag]); + return !!meta.length && + [u('strong', [u('text', 'Meta')])].concat( + u( + 'list', + { ordered: false }, + meta.map(tag => { + let metaContent; + if (tag === 'copyright' || tag === 'deprecated') { + metaContent = comment[tag]; + } else { + metaContent = u('text', comment[tag]); + } + return u('listItem', [ + u('paragraph', [ + u('strong', [u('text', tag)]), + u('text', ': '), + metaContent + ]) + ]); + }) + ) + ); } if (comment.kind === 'note') { - return [u('heading', { depth }, [u('text', comment.name || '')])] - .concat(comment.description); + return [u('heading', { depth }, [u('text', comment.name || '')])].concat( + comment.description + ); } return [u('heading', { depth }, [u('text', comment.name || '')])] - .concat(githubLink(comment)) - .concat(augmentsLink(comment)) - .concat(seeLink(comment)) - .concat(comment.description ? comment.description.children : []) - .concat(typeSection(comment)) - .concat(paramSection(comment)) - .concat(propertySection(comment)) - .concat(examplesSection(comment)) - .concat(throwsSection(comment)) - .concat(returnsSection(comment)) - .concat(metaSection(comment)) - .concat(!!comment.members.global.length && - comment.members.global.reduce((memo, child) => - memo.concat(generate(depth + 1, child)), [])) - .concat(!!comment.members.instance.length && - comment.members.instance.reduce((memo, child) => - memo.concat(generate(depth + 1, child)), [])) - .concat(!!comment.members.static.length && - comment.members.static.reduce((memo, child) => - memo.concat(generate(depth + 1, child)), [])) - .concat(!!comment.members.inner.length && - comment.members.inner.reduce((memo, child) => - memo.concat(generate(depth + 1, child)), [])) - .filter(Boolean); + .concat(githubLink(comment)) + .concat(augmentsLink(comment)) + .concat(seeLink(comment)) + .concat(comment.description ? comment.description.children : []) + .concat(typeSection(comment)) + .concat(paramSection(comment)) + .concat(propertySection(comment)) + .concat(examplesSection(comment)) + .concat(throwsSection(comment)) + .concat(returnsSection(comment)) + .concat(metaSection(comment)) + .concat( + !!comment.members.global.length && + comment.members.global.reduce( + (memo, child) => memo.concat(generate(depth + 1, child)), + [] + ) + ) + .concat( + !!comment.members.instance.length && + comment.members.instance.reduce( + (memo, child) => memo.concat(generate(depth + 1, child)), + [] + ) + ) + .concat( + !!comment.members.static.length && + comment.members.static.reduce( + (memo, child) => memo.concat(generate(depth + 1, child)), + [] + ) + ) + .concat( + !!comment.members.inner.length && + comment.members.inner.reduce( + (memo, child) => memo.concat(generate(depth + 1, child)), + [] + ) + ) + .filter(Boolean); } - var root = rerouteLinks(linkerStack.link, - u('root', generatorComment - .concat(config.markdownToc ? tableOfContentsHeading : []) - .concat(comments.reduce((memo, comment) => - memo.concat(generate(2, comment)), [])))); + var root = rerouteLinks( + linkerStack.link, + u( + 'root', + generatorComment + .concat(config.markdownToc ? tableOfContentsHeading : []) + .concat( + comments.reduce( + (memo, comment) => memo.concat(generate(2, comment)), + [] + ) + ) + ) + ); if (config.markdownToc) { root = remark().use(toc, { tight: true }).run(root); diff --git a/lib/output/util/format_type.js b/lib/output/util/format_type.js index c1fcee638..072542866 100644 --- a/lib/output/util/format_type.js +++ b/lib/output/util/format_type.js @@ -1,7 +1,6 @@ /* @flow */ 'use strict'; -var Syntax = require('doctrine').Syntax, - u = require('unist-builder'); +var Syntax = require('doctrine').Syntax, u = require('unist-builder'); /** * Shortcut to create a new text node @@ -32,10 +31,14 @@ function link(text, getHref, description) { // TODO: this is a temporary fix until we drop remark 3.x support, // and then we should remove the 'href' property and only // have the url property of links - return u('link', { - href, - url: href - }, [t(description || text)]); + return u( + 'link', + { + href, + url: href + }, + [t(description || text)] + ); } return t(text); } @@ -97,7 +100,7 @@ function decorate(formatted, str, prefix) { * formatType({ type: 'NameExpression', name: 'String' })[0].url * // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' */ -function formatType(getHref/*: Function*/, node/*: ?Object */) { +function formatType(getHref /*: Function*/, node /*: ?Object */) { var result = []; if (!node) { @@ -105,86 +108,90 @@ function formatType(getHref/*: Function*/, node/*: ?Object */) { } switch (node.type) { - case Syntax.NullableLiteral: - return [t('?')]; - case Syntax.AllLiteral: - return [t('any')]; - case Syntax.NullLiteral: - return [t('null')]; - case Syntax.VoidLiteral: - return [t('void')]; - case Syntax.UndefinedLiteral: - return [link('undefined', getHref)]; - case Syntax.NameExpression: - return [link(node.name, getHref)]; - case Syntax.ParameterType: - if (node.name) { - result.push(t(node.name + ': ')); - } - return result.concat(formatType(getHref, node.expression)); - - case Syntax.TypeApplication: - return formatType(getHref, node.expression) - .concat(commaList(getHref, node.applications, '<', '>')); - case Syntax.UnionType: - return commaList(getHref, node.elements, '(', ')', ' | '); - case Syntax.ArrayType: - return commaList(getHref, node.elements, '[', ']'); - case Syntax.RecordType: - return commaList(getHref, node.fields, '{', '}'); - - case Syntax.FieldType: - if (node.value) { - return [t(node.key + ': ')].concat(formatType(getHref, node.value)); - } - return [t(node.key)]; + case Syntax.NullableLiteral: + return [t('?')]; + case Syntax.AllLiteral: + return [t('any')]; + case Syntax.NullLiteral: + return [t('null')]; + case Syntax.VoidLiteral: + return [t('void')]; + case Syntax.UndefinedLiteral: + return [link('undefined', getHref)]; + case Syntax.NameExpression: + return [link(node.name, getHref)]; + case Syntax.ParameterType: + if (node.name) { + result.push(t(node.name + ': ')); + } + return result.concat(formatType(getHref, node.expression)); + + case Syntax.TypeApplication: + return formatType(getHref, node.expression).concat( + commaList(getHref, node.applications, '<', '>') + ); + case Syntax.UnionType: + return commaList(getHref, node.elements, '(', ')', ' | '); + case Syntax.ArrayType: + return commaList(getHref, node.elements, '[', ']'); + case Syntax.RecordType: + return commaList(getHref, node.fields, '{', '}'); + + case Syntax.FieldType: + if (node.value) { + return [t(node.key + ': ')].concat(formatType(getHref, node.value)); + } + return [t(node.key)]; - case Syntax.FunctionType: - result = [t('function (')]; + case Syntax.FunctionType: + result = [t('function (')]; - if (node['this']) { - if (node['new']) { - result.push(t('new: ')); - } else { - result.push(t('this: ')); - } + if (node['this']) { + if (node['new']) { + result.push(t('new: ')); + } else { + result.push(t('this: ')); + } - result = result.concat(formatType(getHref, node['this'])); + result = result.concat(formatType(getHref, node['this'])); - if (node.params.length !== 0) { - result.push(t(', ')); + if (node.params.length !== 0) { + result.push(t(', ')); + } } - } - result = result.concat(commaList(getHref, node.params, '', ')')); + result = result.concat(commaList(getHref, node.params, '', ')')); - if (node.result) { - result = result.concat([t(': ')].concat(formatType(getHref, node.result))); - } - return result; - - case Syntax.RestType: - // note that here we diverge from doctrine itself, which - // lets the expression be omitted. - return decorate(formatType(getHref, node.expression), '...', true); - case Syntax.OptionalType: - if (node.default) { - return decorate(formatType(getHref, node.expression), '?') - .concat(t('= ' + node.default)); - } - return decorate(formatType(getHref, node.expression), '?'); - case Syntax.NonNullableType: - return decorate(formatType(getHref, node.expression), '!', node.prefix); - case Syntax.NullableType: - return decorate(formatType(getHref, node.expression), '?'); - case Syntax.StringLiteralType: - return [u('inlineCode', JSON.stringify(node.value))]; - case Syntax.NumericLiteralType: - case Syntax.BooleanLiteralType: - return [u('inlineCode', String(node.value))]; - - default: - throw new Error('Unknown type ' + node.type); + if (node.result) { + result = result.concat( + [t(': ')].concat(formatType(getHref, node.result)) + ); + } + return result; + + case Syntax.RestType: + // note that here we diverge from doctrine itself, which + // lets the expression be omitted. + return decorate(formatType(getHref, node.expression), '...', true); + case Syntax.OptionalType: + if (node.default) { + return decorate(formatType(getHref, node.expression), '?').concat( + t('= ' + node.default) + ); + } + return decorate(formatType(getHref, node.expression), '?'); + case Syntax.NonNullableType: + return decorate(formatType(getHref, node.expression), '!', node.prefix); + case Syntax.NullableType: + return decorate(formatType(getHref, node.expression), '?'); + case Syntax.StringLiteralType: + return [u('inlineCode', JSON.stringify(node.value))]; + case Syntax.NumericLiteralType: + case Syntax.BooleanLiteralType: + return [u('inlineCode', String(node.value))]; + + default: + throw new Error('Unknown type ' + node.type); } } diff --git a/lib/output/util/formatters.js b/lib/output/util/formatters.js index 7d02c5b5a..c368c3eb2 100644 --- a/lib/output/util/formatters.js +++ b/lib/output/util/formatters.js @@ -15,7 +15,7 @@ var remark = require('remark'), * @param getHref linker method * @returns {formatters} formatter object */ -module.exports = function (getHref/*: Function*/) { +module.exports = function(getHref /*: Function*/) { var rerouteLinks = _rerouteLinks.bind(undefined, getHref); var formatters = {}; @@ -29,7 +29,10 @@ module.exports = function (getHref/*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameter representation. */ - formatters.parameter = function (param/*: Object*/, short/*: boolean */)/*: string */ { + formatters.parameter = function( + param /*: Object*/, + short /*: boolean */ + ) /*: string */ { if (short) { if (param.type && param.type.type == Syntax.OptionalType) { if (param.default) { @@ -47,11 +50,9 @@ module.exports = function (getHref/*: Function*/) { * @param {Object} ast remark-compatible AST * @returns {string} HTML */ - formatters.markdown = function (ast) { + formatters.markdown = function(ast) { if (ast) { - return remark() - .use(html) - .stringify(highlighter(rerouteLinks(ast))); + return remark().use(html).stringify(highlighter(rerouteLinks(ast))); } return ''; }; @@ -62,8 +63,10 @@ module.exports = function (getHref/*: Function*/) { * @param {Object} type doctrine-format type * @returns {string} HTML */ - formatters.type = function (type/*: Object*/) { - return formatters.markdown(u('root', formatType(getHref, type))).replace(/\n/g, ''); + formatters.type = function(type /*: Object*/) { + return formatters + .markdown(u('root', formatType(getHref, type))) + .replace(/\n/g, ''); }; /** @@ -72,16 +75,24 @@ module.exports = function (getHref/*: Function*/) { * @param {string} description link text override * @returns {string} potentially linked HTML */ - formatters.autolink = function (text/*: string*/) { + formatters.autolink = function(text /*: string*/) { var href = getHref(text); if (href) { // TODO: this is a temporary fix until we drop remark 3.x support, // and then we should remove the 'href' property and only // have the url property of links - return formatters.markdown(u('link', { - href, - url: href - }, [u('text', text)])).replace(/\n/g, ''); + return formatters + .markdown( + u( + 'link', + { + href, + url: href + }, + [u('text', text)] + ) + ) + .replace(/\n/g, ''); } return formatters.markdown(u('text', text)).replace(/\n/g, ''); }; @@ -95,11 +106,18 @@ module.exports = function (getHref/*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameters */ - formatters.parameters = function (section/*: Comment*/, short/*: boolean */) { + formatters.parameters = function( + section /*: Comment*/, + short /*: boolean */ + ) { if (section.params) { - return '(' + section.params.map(function (param) { - return formatters.parameter(param, short); - }).join(', ') + ')'; + return '(' + + section.params + .map(function(param) { + return formatters.parameter(param, short); + }) + .join(', ') + + ')'; } return '()'; }; diff --git a/lib/output/util/linker_stack.js b/lib/output/util/linker_stack.js index 0888ecebf..1d9dd6b7e 100644 --- a/lib/output/util/linker_stack.js +++ b/lib/output/util/linker_stack.js @@ -9,8 +9,8 @@ var walk = require('../../walk'); * @param {Object} paths an object specified in documentation.yml of hard paths * @returns {Function} linker */ -function pathsLinker(paths/* Object */) { - return function (namespace) { +function pathsLinker(paths /* Object */) { + return function(namespace) { if (paths[namespace]) { return paths[namespace]; } @@ -25,7 +25,7 @@ function pathsLinker(paths/* Object */) { * @param {*} input any input * @returns {*} any output */ -function firstPass(fns/*: Array */, input) { +function firstPass(fns /*: Array */, input) { for (var i = 0; i < fns.length; i++) { var output = fns[i](input); if (output) { @@ -42,11 +42,10 @@ function firstPass(fns/*: Array */, input) { * @returns {Function} linker method */ class LinkerStack { - /* :: stack: Array */ /* :: link: Function */ - constructor(config/*: DocumentationConfig */) { + constructor(config /*: DocumentationConfig */) { this.stack = []; if (config.defaultGlobals !== false) { @@ -86,7 +85,7 @@ class LinkerStack { * return '#' + slugger.slug(namespace); * }); */ - namespaceResolver(comments /*: Array */, resolver/*: Function */) { + namespaceResolver(comments /*: Array */, resolver /*: Function */) { var namespaces = {}; walk(comments, comment => { namespaces[comment.namespace] = true; @@ -108,7 +107,7 @@ class LinkerStack { * @returns {string?} URL target or maybe undefined * @private */ - _link(namepath/*: string */) { + _link(namepath /*: string */) { return firstPass(this.stack, namepath); } } diff --git a/lib/output/util/reroute_links.js b/lib/output/util/reroute_links.js index ebc2a5209..d8e902a3a 100644 --- a/lib/output/util/reroute_links.js +++ b/lib/output/util/reroute_links.js @@ -9,9 +9,14 @@ var visit = require('unist-util-visit'); * @returns {Object} that ast with rerouted links * @private */ -module.exports = function rerouteLinks(getHref/*: Function */, ast/*: Object*/) { - visit(ast, 'link', function (node) { - if (node.jsdoc && !node.url.match(/^(http|https|\.)/) && getHref(node.url)) { +module.exports = function rerouteLinks( + getHref /*: Function */, + ast /*: Object*/ +) { + visit(ast, 'link', function(node) { + if ( + node.jsdoc && !node.url.match(/^(http|https|\.)/) && getHref(node.url) + ) { node.url = getHref(node.url); } }); diff --git a/lib/parse.js b/lib/parse.js index 1b859a56b..eccd60573 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -12,7 +11,7 @@ var parseMarkdown = require('./parse_markdown'); * @private */ var flatteners = { - 'abstract': flattenBoolean, + abstract: flattenBoolean, /** * Parse tag * @private @@ -20,13 +19,13 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'access': function (result, tag) { + access: function(result, tag) { // doctrine ensures that tag.access is valid result.access = tag.access; }, - 'alias': flattenName, - 'arg': synonym('param'), - 'argument': synonym('param'), + alias: flattenName, + arg: synonym('param'), + argument: synonym('param'), /** * Parse tag * @private @@ -34,7 +33,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'augments': function (result, tag) { + augments: function(result, tag) { // Google variation of augments/extends tag: // uses type with brackets instead of name. // https://github.com/google/closure-library/issues/746 @@ -42,13 +41,13 @@ var flatteners = { tag.name = tag.type.name; } if (!tag.name) { - console.error('@extends from complex types is not supported yet'); // eslint-disable-line no-console + console.error('@extends from complex types is not supported yet'); // eslint-disable-line no-console return; } result.augments.push(tag); }, - 'author': flattenDescription, - 'borrows': todo, + author: flattenDescription, + borrows: todo, /** * Parse tag * @private @@ -56,7 +55,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'callback': function (result, tag) { + callback: function(result, tag) { result.kind = 'typedef'; if (tag.description) { @@ -68,24 +67,24 @@ var flatteners = { name: 'Function' }; }, - 'class': flattenKindShorthand, - 'classdesc': flattenMarkdownDescription, - 'const': synonym('constant'), - 'constant': flattenKindShorthand, - 'constructor': synonym('class'), - 'constructs': todo, - 'copyright': flattenMarkdownDescription, - 'default': todo, - 'defaultvalue': synonym('default'), + class: flattenKindShorthand, + classdesc: flattenMarkdownDescription, + const: synonym('constant'), + constant: flattenKindShorthand, + constructor: synonym('class'), + constructs: todo, + copyright: flattenMarkdownDescription, + default: todo, + defaultvalue: synonym('default'), deprecated(result, tag) { let description = tag.description || 'This is deprecated.'; result.deprecated = parseMarkdown(description); }, flattenMarkdownDescription, - 'desc': synonym('description'), - 'description': flattenMarkdownDescription, - 'emits': synonym('fires'), - 'enum': todo, + desc: synonym('description'), + description: flattenMarkdownDescription, + emits: synonym('fires'), + enum: todo, /** * Parse tag * @private @@ -93,7 +92,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'event': function (result, tag) { + event: function(result, tag) { result.kind = 'event'; if (tag.description) { @@ -107,7 +106,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'example': function (result, tag) { + example: function(result, tag) { if (!tag.description) { result.errors.push({ message: '@example without code', @@ -116,7 +115,7 @@ var flatteners = { return; } - var example/*: CommentExample */ = { + var example /*: CommentExample */ = { description: tag.description }; @@ -126,9 +125,9 @@ var flatteners = { result.examples.push(example); }, - 'exception': synonym('throws'), - 'exports': todo, - 'extends': synonym('augments'), + exception: synonym('throws'), + exports: todo, + extends: synonym('augments'), /** * Parse tag * @private @@ -136,7 +135,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'external': function (result, tag) { + external: function(result, tag) { result.kind = 'external'; if (tag.description) { @@ -150,37 +149,37 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'file': function (result, tag) { + file: function(result, tag) { result.kind = 'file'; if (tag.description) { result.description = parseMarkdown(tag.description); } }, - 'fileoverview': synonym('file'), - 'fires': todo, - 'func': synonym('function'), - 'function': flattenKindShorthand, + fileoverview: synonym('file'), + fires: todo, + func: synonym('function'), + function: flattenKindShorthand, /** * Parse tag * @private * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'global': function (result) { + global: function(result) { result.scope = 'global'; }, - 'host': synonym('external'), - 'ignore': flattenBoolean, - 'implements': todo, - 'inheritdoc': todo, + host: synonym('external'), + ignore: flattenBoolean, + implements: todo, + inheritdoc: todo, /** * Parse tag * @private * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'inner': function (result) { + inner: function(result) { result.scope = 'inner'; }, /** @@ -189,7 +188,7 @@ var flatteners = { * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'instance': function (result) { + instance: function(result) { result.scope = 'instance'; }, /** @@ -199,7 +198,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'interface': function (result, tag) { + interface: function(result, tag) { result.interface = true; if (tag.description) { result.name = tag.description; @@ -212,23 +211,23 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'kind': function (result, tag) { + kind: function(result, tag) { // doctrine ensures that tag.kind is valid result.kind = tag.kind; }, - 'lends': flattenDescription, - 'license': flattenDescription, - 'listens': todo, - 'member': flattenKindShorthand, - 'memberof': flattenDescription, - 'method': synonym('function'), - 'mixes': todo, - 'mixin': flattenKindShorthand, - 'module': flattenKindShorthand, - 'name': flattenName, - 'namespace': flattenKindShorthand, - 'override': flattenBoolean, - 'overview': synonym('file'), + lends: flattenDescription, + license: flattenDescription, + listens: todo, + member: flattenKindShorthand, + memberof: flattenDescription, + method: synonym('function'), + mixes: todo, + mixin: flattenKindShorthand, + module: flattenKindShorthand, + name: flattenName, + namespace: flattenKindShorthand, + override: flattenBoolean, + overview: synonym('file'), /** * Parse tag * @private @@ -236,8 +235,8 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'param': function (result, tag) { - var param/*: CommentTag */ = { + param: function(result, tag) { + var param /*: CommentTag */ = { title: 'param', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -263,10 +262,10 @@ var flatteners = { * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'private': function (result) { + private: function(result) { result.access = 'private'; }, - 'prop': synonym('property'), + prop: synonym('property'), /** * Parse tag * @private @@ -274,8 +273,8 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'property': function (result, tag) { - var property/*: CommentTag */ = { + property: function(result, tag) { + var property /*: CommentTag */ = { title: 'property', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -297,7 +296,7 @@ var flatteners = { * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'protected': function (result) { + protected: function(result) { result.access = 'protected'; }, /** @@ -306,12 +305,12 @@ var flatteners = { * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'public': function (result) { + public: function(result) { result.access = 'public'; }, - 'readonly': flattenBoolean, - 'requires': todo, - 'return': synonym('returns'), + readonly: flattenBoolean, + requires: todo, + return: synonym('returns'), /** * Parse tag * @private @@ -319,8 +318,8 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'returns': function (result, tag) { - var returns/*: CommentTag */ = { + returns: function(result, tag) { + var returns /*: CommentTag */ = { description: parseMarkdown(tag.description), title: 'returns' }; @@ -338,21 +337,21 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'see': function (result, tag) { + see: function(result, tag) { result.sees.push(parseMarkdown(tag.description)); }, - 'since': flattenDescription, + since: flattenDescription, /** * Parse tag * @private * @param {Object} result target comment * @returns {undefined} has side-effects */ - 'static': function (result) { + static: function(result) { result.scope = 'static'; }, - 'summary': flattenMarkdownDescription, - 'this': todo, + summary: flattenMarkdownDescription, + this: todo, /** * Parse tag * @private @@ -360,7 +359,7 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'throws': function (result, tag) { + throws: function(result, tag) { var throws = {}; if (tag.description) { @@ -380,13 +379,13 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'todo': function (result, tag) { + todo: function(result, tag) { result.todos.push(parseMarkdown(tag.description)); }, - 'tutorial': todo, - 'type': todo, - 'typedef': flattenKindShorthand, - 'var': synonym('member'), + tutorial: todo, + type: todo, + typedef: flattenKindShorthand, + var: synonym('member'), /** * Parse tag * @private @@ -394,11 +393,11 @@ var flatteners = { * @param {Object} tag the tag * @returns {undefined} has side-effects */ - 'variation': function (result, tag) { + variation: function(result, tag) { result.variation = tag.variation; }, - 'version': flattenDescription, - 'virtual': synonym('abstract') + version: flattenDescription, + virtual: synonym('abstract') }; /** @@ -414,7 +413,7 @@ function todo() {} * @returns {Function} a flattener that remembers that key */ function synonym(key) { - return function (result, tag) { + return function(result, tag) { return flatteners[key](result, tag, key); }; } @@ -443,7 +442,6 @@ function flattenName(result, tag, key) { result[key] = tag.name; } - /** * Flatten a usable-once description tag into a key * @private @@ -566,9 +564,11 @@ function flattenKindShorthand(result, tag, key) { * @return {Comment} an object conforming to the * [documentation schema](https://github.com/documentationjs/api-json) */ -function parseJSDoc(comment/*: string*/, - loc/*: ?Object*/, - context/*: ?Object*/)/*: Comment */ { +function parseJSDoc( + comment /*: string*/, + loc /*: ?Object*/, + context /*: ?Object*/ +) /*: Comment */ { var result = doctrine.parse(comment, { // have doctrine itself remove the comment asterisks from content unwrap: true, @@ -597,10 +597,10 @@ function parseJSDoc(comment/*: string*/, result.description = parseMarkdown(result.description); } - result.tags.forEach(function (tag) { + result.tags.forEach(function(tag) { if (tag.errors) { for (var j = 0; j < tag.errors.length; j++) { - result.errors.push({message: tag.errors[j]}); + result.errors.push({ message: tag.errors[j] }); } } else if (flatteners[tag.title]) { flatteners[tag.title](result, tag, tag.title); diff --git a/lib/parse_markdown.js b/lib/parse_markdown.js index 4b12060d9..ae7dc5e6a 100644 --- a/lib/parse_markdown.js +++ b/lib/parse_markdown.js @@ -11,7 +11,7 @@ var inlineTokenizer = require('./inline_tokenizer'); * @returns {Object} abstract syntax tree * @private */ -function parseMarkdown(string/*: string */) { +function parseMarkdown(string /*: string */) { return remark().use(inlineTokenizer).parse(string); } diff --git a/lib/parsers/javascript.js b/lib/parsers/javascript.js index 3a8db26e6..17d4f8121 100644 --- a/lib/parsers/javascript.js +++ b/lib/parsers/javascript.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -32,31 +31,44 @@ function leftPad(str, width) { * @param {Object} config config * @return {Array} an array of parsed comments */ -function parseJavaScript(data/*: Object*/, - config/*: DocumentationConfig */) { +function parseJavaScript(data /*: Object*/, config /*: DocumentationConfig */) { var visited = new Set(); var ast = parseToAst(data.source, data.file); var addComment = _addComment.bind(null, visited); - return _.flatMap(config.documentExported ? [ - walkExported - ] : [ - walkComments.bind(null, 'leadingComments', true), - walkComments.bind(null, 'innerComments', false), - walkComments.bind(null, 'trailingComments', false) - ], fn => fn(ast, data, addComment)) - .filter(comment => comment && !comment.lends); + return _.flatMap( + config.documentExported + ? [walkExported] + : [ + walkComments.bind(null, 'leadingComments', true), + walkComments.bind(null, 'innerComments', false), + walkComments.bind(null, 'trailingComments', false) + ], + fn => fn(ast, data, addComment) + ).filter(comment => comment && !comment.lends); } -function _addComment(visited, data, commentValue, commentLoc, path, nodeLoc, includeContext) { +function _addComment( + visited, + data, + commentValue, + commentLoc, + path, + nodeLoc, + includeContext +) { // Avoid visiting the same comment twice as a leading // and trailing node - var key = data.file + ':' + commentLoc.start.line + ':' + commentLoc.start.column; + var key = data.file + + ':' + + commentLoc.start.line + + ':' + + commentLoc.start.column; if (!visited.has(key)) { visited.add(key); - var context/* : { + var context /* : { loc: Object, file: string, sortKey: string, diff --git a/lib/parsers/parse_to_ast.js b/lib/parsers/parse_to_ast.js index 4b539d214..eaa15821f 100644 --- a/lib/parsers/parse_to_ast.js +++ b/lib/parsers/parse_to_ast.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -25,7 +24,7 @@ var opts = { ] }; -function parseToAst(source/*: string*/) { +function parseToAst(source /*: string*/) { return babylon.parse(source, opts); } diff --git a/lib/parsers/polyglot.js b/lib/parsers/polyglot.js index d521c3082..3fcd70cbc 100644 --- a/lib/parsers/polyglot.js +++ b/lib/parsers/polyglot.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -14,7 +13,7 @@ var getComments = require('get-comments'), * @param {Object} data a chunk of data provided by module-deps * @return {Array} adds to memo */ -function parsePolyglot(sourceFile/*: SourceFile*/) { +function parsePolyglot(sourceFile /*: SourceFile*/) { return getComments(sourceFile.source, true) .filter(isJSDocComment) .map(comment => { diff --git a/lib/serve/error_page.js b/lib/serve/error_page.js index ec2fcafd9..1b71b0299 100644 --- a/lib/serve/error_page.js +++ b/lib/serve/error_page.js @@ -26,7 +26,7 @@ ansiHTML.setColors({ * @param error parse or generation error * @returns {Object} vinyl file object */ -function errorPage(error/*: Error*/) { +function errorPage(error /*: Error*/) { var errorText = error.toString(); console.error(error); if (error.codeFrame) { diff --git a/lib/serve/server.js b/lib/serve/server.js index 921b26387..93915d8af 100644 --- a/lib/serve/server.js +++ b/lib/serve/server.js @@ -1,4 +1,7 @@ /* @flow */ + +// This file triggers https://github.com/prettier/prettier/issues/1151 + 'use strict'; var http = require('http'), mime = require('mime'), @@ -24,13 +27,12 @@ declare type ServerFile = { * @param port server port to serve on. */ class Server extends EventEmitter { - /* :: _lr: Object; */ /* :: _port: number; */ /* :: _files: Array; */ /* :: _http: http.Server; */ - constructor(port/*: number*/) { + constructor(port /*: number*/) { super(); if (typeof port !== 'number') { throw new Error('port argument required to initialize a server'); @@ -46,7 +48,7 @@ class Server extends EventEmitter { * @param files new content. replaces any previously-set content. * @returns {Server} self */ - setFiles(files/*: Array */) { + setFiles(files /*: Array */) { this._files = files; if (this._lr) { this._lr.changed({ body: { files: '*' } }); @@ -64,7 +66,10 @@ class Server extends EventEmitter { * @returns {undefined} nothing * @private */ - handler(request/*: http.IncomingMessage */, response/*: http.ServerResponse */) { + handler( + request /*: http.IncomingMessage */, + response /*: http.ServerResponse */ + ) { var path = request.url.substring(1); if (path === '') { path = 'index.html'; @@ -83,13 +88,14 @@ class Server extends EventEmitter { response.end('Not found'); } - /** - * Boot up the server's HTTP & LiveReload endpoints. This method - * can be called multiple times. - * - * @returns {Promise} resolved when server starts - */ + // prettier-ignore start()/*: Promise */ { + /* + * Boot up the server's HTTP & LiveReload endpoints. This method + * can be called multiple times. + * + * @returns {Promise} resolved when server starts + */ return new Promise(resolve => { // idempotent if (this._lr) { @@ -109,12 +115,12 @@ class Server extends EventEmitter { }); } - /** - * Shut down the server's HTTP & LiveReload endpoints. This method - * can be called multiple times. - */ + // prettier-ignore stop()/*: Promise */ { - + /* + * Shut down the server's HTTP & LiveReload endpoints. This method + * can be called multiple times. + */ return new Promise(resolve => { // idempotent if (!this._lr) { diff --git a/lib/smart_glob.js b/lib/smart_glob.js index c149f11ed..2eab29320 100644 --- a/lib/smart_glob.js +++ b/lib/smart_glob.js @@ -37,7 +37,7 @@ function processPath(extensions) { var cwd = process.cwd(); extensions = extensions || ['.js']; - extensions = extensions.map(function (ext) { + extensions = extensions.map(function(ext) { return ext.replace(/^\./, ''); }); @@ -56,7 +56,7 @@ function processPath(extensions) { * @returns {string} The glob path or the file path itself * @private */ - return function (pathname) { + return function(pathname) { var newPath = pathname; var resolvedPath = path.resolve(cwd, pathname); @@ -86,9 +86,10 @@ function resolveFileGlobPatterns(patterns, extensions) { * @param globPatterns Glob patterns. * @returns Resolved absolute filenames. */ -function listFilesToProcess(globPatterns/*: Array*/)/*: Array */ { - var files = [], - added = new Set(); +function listFilesToProcess( + globPatterns /*: Array*/ +) /*: Array */ { + var files = [], added = new Set(); var cwd = process.cwd(); @@ -106,7 +107,7 @@ function listFilesToProcess(globPatterns/*: Array*/)/*: Array */ added.add(filename); } - globPatterns.forEach(function (pattern) { + globPatterns.forEach(function(pattern) { var file = path.resolve(cwd, pattern); if (shell.test('-f', file)) { addFile(fs.realpathSync(file), !shell.test('-d', file)); @@ -114,10 +115,10 @@ function listFilesToProcess(globPatterns/*: Array*/)/*: Array */ var globOptions = { nodir: true, dot: true, - cwd, + cwd }; - glob.sync(pattern, globOptions).forEach(function (globMatch) { + glob.sync(pattern, globOptions).forEach(function(globMatch) { addFile(path.resolve(cwd, globMatch), false); }); } @@ -126,11 +127,11 @@ function listFilesToProcess(globPatterns/*: Array*/)/*: Array */ return files; } -function smartGlob(indexes/*: Array*/, - extensions/*: Array*/) { - return listFilesToProcess( - resolveFileGlobPatterns(indexes, extensions) - ); +function smartGlob( + indexes /*: Array*/, + extensions /*: Array*/ +) { + return listFilesToProcess(resolveFileGlobPatterns(indexes, extensions)); } module.exports = smartGlob; diff --git a/lib/sort.js b/lib/sort.js index 32d536b68..f6c85ae2a 100644 --- a/lib/sort.js +++ b/lib/sort.js @@ -1,4 +1,3 @@ - 'use strict'; /* @flow */ @@ -16,30 +15,39 @@ var fs = require('fs'); * @return {number} sorting value * @private */ -module.exports = function sortDocs(comments/*: Array*/, options/*: Object*/) { +module.exports = function sortDocs( + comments /*: Array*/, + options /*: Object*/ +) { if (!options || !options.toc) { return sortComments(comments, options && options.sortOrder); } - var indexes = options.toc.reduce(function (memo, val, i) { - if (typeof val === 'object' && val.name) { - val.kind = 'note'; - memo[val.name] = i; - } else { - memo[val] = i; - } - return memo; - }, Object.create(null)); - var toBeSorted = options.toc.reduce(function (memo, val) { - if (typeof val === 'string') { - memo[val] = false; - } - return memo; - }, Object.create(null)); + var indexes = options.toc.reduce( + function(memo, val, i) { + if (typeof val === 'object' && val.name) { + val.kind = 'note'; + memo[val.name] = i; + } else { + memo[val] = i; + } + return memo; + }, + Object.create(null) + ); + var toBeSorted = options.toc.reduce( + function(memo, val) { + if (typeof val === 'string') { + memo[val] = false; + } + return memo; + }, + Object.create(null) + ); // Table of contents 'theme' entries: defined as objects // in the YAML list var fixed = options.toc .filter(val => typeof val === 'object' && val.name) - .map(function (val) { + .map(function(val) { if (typeof val.file === 'string') { var filename = val.file; if (!path.isAbsolute(val.file)) { @@ -59,8 +67,7 @@ module.exports = function sortDocs(comments/*: Array*/, options/*: Obje return val; }); var unfixed = []; - comments - .forEach(function (comment) { + comments.forEach(function(comment) { // If comment is of kind 'note', this means that we must be _re_ sorting // the list, and the TOC note entries were already added to the list. Bail // out here so that we don't add duplicates. @@ -86,14 +93,19 @@ module.exports = function sortDocs(comments/*: Array*/, options/*: Obje Object.keys(toBeSorted) .filter(key => toBeSorted[key] === false) .forEach(key => { - process.stderr.write(chalk.red('Table of contents defined sorting of ' + key + - ' but no documentation with that namepath was found\n')); + process.stderr.write( + chalk.red( + 'Table of contents defined sorting of ' + + key + + ' but no documentation with that namepath was found\n' + ) + ); }); return fixed.concat(unfixed); }; -function compare(a/*: string */, b/*: string */) { - return a.localeCompare(b, undefined, {caseFirst: 'upper'}); +function compare(a /*: string */, b /*: string */) { + return a.localeCompare(b, undefined, { caseFirst: 'upper' }); } function compareCommentsByName(a, b) { @@ -111,6 +123,9 @@ function compareCommentsBySourceLocation(a, b) { } function sortComments(comments, sortOrder) { - return comments.sort(sortOrder === 'alpha' ? - compareCommentsByName : compareCommentsBySourceLocation); + return comments.sort( + sortOrder === 'alpha' + ? compareCommentsByName + : compareCommentsBySourceLocation + ); } diff --git a/lib/walk.js b/lib/walk.js index 119ac84d8..c80bc2c10 100644 --- a/lib/walk.js +++ b/lib/walk.js @@ -10,7 +10,11 @@ * @param {Object} [options] options passed through to walker function * @returns {Array} comments */ -function walk(comments/*: Array*/, fn/*: Function*/, options/*: ?Object*/) { +function walk( + comments /*: Array*/, + fn /*: Function*/, + options /*: ?Object*/ +) { comments.forEach(comment => { fn(comment, options); for (var scope in comment.members) { diff --git a/package.json b/package.json index 2caf3781c..c20fc3320 100644 --- a/package.json +++ b/package.json @@ -61,16 +61,16 @@ }, "devDependencies": { "are-we-flow-yet": "^1.0.0", - "babel-eslint": "^7.1.1", "chdir": "0.0.0", "cz-conventional-changelog": "1.2.0", "documentation-schema": "0.0.1", - "eslint": "^3.12.2", - "eslint-plugin-flowtype": "^2.29.2", "flow-bin": "^0.37.4", "fs-extra": "^1.0.0", + "husky": "^0.13.3", "json-schema": "0.2.3", + "lint-staged": "^3.4.0", "mock-fs": "^3.5.0", + "prettier": "^0.22.0", "standard-changelog": "0.0.1", "tap": "^8.0.0", "tmp": "^0.0.29" @@ -90,11 +90,12 @@ "url": "git@github.com:documentationjs/documentation.git" }, "scripts": { - "lint": "eslint bin lib index.js test", + "precommit": "lint-staged --verbose", + "format": "prettier --write '{lib,test}/**/*.js' --single-quote", "doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint", - "test": "are-we-flow-yet lib && flow check && npm run lint && npm run self-lint && npm run test-tap", + "test": "are-we-flow-yet lib && flow check && npm run self-lint && npm run test-tap", "test-tap": "tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams" }, "config": { @@ -104,5 +105,10 @@ }, "engines": { "node": ">=4" + }, + "lint-staged": { + "*.js": [ + "prettier --write --single-quote" + ] } } diff --git a/test/bin-readme.js b/test/bin-readme.js index 103ea5d29..8b082d9da 100644 --- a/test/bin-readme.js +++ b/test/bin-readme.js @@ -25,102 +25,142 @@ function documentation(args, options, callback, parseJSON) { var UPDATE = !!process.env.UPDATE; -test('readme command', function (group) { +test('readme command', function(group) { var fixtures = path.join(__dirname, 'fixture/readme'); var sourceFile = path.join(fixtures, 'index.js'); - tmp.dir({unsafeCleanup: true}, function (err, d) { + tmp.dir({ unsafeCleanup: true }, function(err, d) { group.error(err); - fs.copySync(path.join(fixtures, 'README.input.md'), path.join(d, 'README.md')); + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'README.md') + ); fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js')); // run tests after setting up temp dir - group.test('--diff-only: changes needed', function (t) { + group.test('--diff-only: changes needed', function(t) { t.error(err); var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - documentation(['readme index.js --diff-only -s API'], {cwd: d}, function (err, stdout, stderr) { - var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - t.ok(err); - t.notEqual(err.code, 0, 'exit nonzero'); - t.same(after, before, 'readme unchanged'); - t.end(); - }); + documentation( + ['readme index.js --diff-only -s API'], + { cwd: d }, + function(err, stdout, stderr) { + var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); + t.ok(err); + t.notEqual(err.code, 0, 'exit nonzero'); + t.same(after, before, 'readme unchanged'); + t.end(); + } + ); }); var expectedFile = path.join(fixtures, 'README.output.md'); var expectedPath = path.join(fixtures, 'README.output.md'); var expected = fs.readFileSync(expectedFile, 'utf-8'); - group.test('updates README.md', function (t) { - documentation(['readme index.js -s API'], {cwd: d}, function (err, stdout) { - var outputPath = path.join(d, 'README.md'); - t.error(err); + group.test('updates README.md', function(t) { + documentation( + ['readme index.js -s API'], + { cwd: d }, + function(err, stdout) { + var outputPath = path.join(d, 'README.md'); + t.error(err); - if (UPDATE) { - fs.writeFileSync(expectedPath, fs.readFileSync(outputPath, 'utf-8')); - } + if (UPDATE) { + fs.writeFileSync( + expectedPath, + fs.readFileSync(outputPath, 'utf-8') + ); + } - var actual = fs.readFileSync(outputPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - }); + var actual = fs.readFileSync(outputPath, 'utf-8'); + t.same(actual, expected, 'generated readme output'); + t.end(); + } + ); }); - group.test('--readme-file', function (t) { - fs.copySync(path.join(fixtures, 'README.input.md'), path.join(d, 'other.md')); - documentation(['readme index.js -s API --readme-file other.md'], {cwd: d}, function (err, stdout) { - t.error(err); - var actualPath = path.join(d, 'other.md'); - if (UPDATE) { - fs.writeFileSync(actualPath, expected); + group.test('--readme-file', function(t) { + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'other.md') + ); + documentation( + ['readme index.js -s API --readme-file other.md'], + { cwd: d }, + function(err, stdout) { + t.error(err); + var actualPath = path.join(d, 'other.md'); + if (UPDATE) { + fs.writeFileSync(actualPath, expected); + } + var actual = fs.readFileSync(actualPath, 'utf-8'); + t.same(actual, expected, 'generated readme output'); + t.end(); } - var actual = fs.readFileSync(actualPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - }); + ); }); - group.test('--diff-only: changes NOT needed', function (t) { + group.test('--diff-only: changes NOT needed', function(t) { t.error(err); - fs.copySync(path.join(fixtures, 'README.output.md'), path.join(d, 'uptodate.md')); - documentation(['readme index.js --diff-only -s API --readme-file uptodate.md'], - {cwd: d}, function (err, stdout, stderr) { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + documentation( + ['readme index.js --diff-only -s API --readme-file uptodate.md'], + { cwd: d }, + function(err, stdout, stderr) { t.error(err); t.match(stdout, 'is up to date.'); t.end(); - }); + } + ); }); - group.test('-s: not found', function (t) { + group.test('-s: not found', function(t) { t.error(err); - fs.copySync(path.join(fixtures, 'README.output.md'), path.join(d, 'uptodate.md')); - documentation(['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], - {cwd: d}, function (err, stdout, stderr) { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + documentation( + ['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], + { cwd: d }, + function(err, stdout, stderr) { t.ok(err); t.end(); - }); + } + ); }); - group.test('requires -s option', function (t) { - documentation(['readme index.js'], {cwd: d}, function (err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.match(stderr, 'Missing required argument: s'); - t.end(); - }); + group.test('requires -s option', function(t) { + documentation( + ['readme index.js'], + { cwd: d }, + function(err, stdout, stderr) { + t.ok(err); + t.ok(err.code !== 0, 'exit nonzero'); + t.match(stderr, 'Missing required argument: s'); + t.end(); + } + ); }); - var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input.js'); - group.test('errors on invalid syntax', function (t) { - documentation(['readme ' + badFixturePath + ' -s API'], {cwd: d}, function (err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.end(); - }); + var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input'); + group.test('errors on invalid syntax', function(t) { + documentation( + ['readme ' + badFixturePath + ' -s API --parseExtension input'], + { cwd: d }, + function(err, stdout, stderr) { + t.ok(err); + t.ok(err.code !== 0, 'exit nonzero'); + t.end(); + } + ); }); group.end(); }); }); - diff --git a/test/bin-watch-serve.js b/test/bin-watch-serve.js index f7d601171..93036251f 100644 --- a/test/bin-watch-serve.js +++ b/test/bin-watch-serve.js @@ -20,14 +20,11 @@ function documentation(args, options, callback, parseJSON) { options.maxBuffer = 1024 * 1024; args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); - return spawn( - 'node', - args, - options); + return spawn('node', args, options); } function normalize(result) { - result.forEach(function (item) { + result.forEach(function(item) { item.context.file = '[path]'; }); return result; @@ -35,18 +32,22 @@ function normalize(result) { var options = { timeout: 1000 * 120 }; -test('harness', options, function (t) { +test('harness', options, function(t) { var docProcess = documentation(['fixture/simple.input.js', '--serve']); t.ok(docProcess, 'creates a subprocess object'); docProcess.kill(); t.end(); }); -test('provides index.html', options, function (t) { +test('provides index.html', options, function(t) { var docProcess = documentation(['serve', 'fixture/simple.input.js']); - docProcess.stdout.on('data', function (data) { - t.equal(data.toString().trim(), 'documentation.js serving on port 4001', 'shows listening message'); - get('http://localhost:4001/', function (text) { + docProcess.stdout.on('data', function(data) { + t.equal( + data.toString().trim(), + 'documentation.js serving on port 4001', + 'shows listening message' + ); + get('http://localhost:4001/', function(text) { t.ok(text.match(//), 'sends an html index file'); docProcess.kill(); t.end(); @@ -54,11 +55,19 @@ test('provides index.html', options, function (t) { }); }); -test('accepts port argument', options, function (t) { - var docProcess = documentation(['serve', 'fixture/simple.input.js', '--port=4004']); - docProcess.stdout.on('data', function (data) { - t.equal(data.toString().trim(), 'documentation.js serving on port 4004', 'shows listening message'); - get('http://localhost:4004/', function (text) { +test('accepts port argument', options, function(t) { + var docProcess = documentation([ + 'serve', + 'fixture/simple.input.js', + '--port=4004' + ]); + docProcess.stdout.on('data', function(data) { + t.equal( + data.toString().trim(), + 'documentation.js serving on port 4004', + 'shows listening message' + ); + get('http://localhost:4004/', function(text) { t.ok(text.match(//), 'sends an html index file'); docProcess.kill(); t.end(); @@ -66,16 +75,16 @@ test('accepts port argument', options, function (t) { }); }); -test('--watch', options, function (t) { +test('--watch', options, function(t) { var tmpFile = path.join(os.tmpdir(), '/simple.js'); fs.writeFileSync(tmpFile, '/** a function */function apples() {}'); var docProcess = documentation(['serve', tmpFile, '--watch']); - docProcess.stdout.on('data', function (data) { - get('http://localhost:4001/', function (text) { + docProcess.stdout.on('data', function(data) { + get('http://localhost:4001/', function(text) { t.ok(text.match(/apples/), 'sends an html index file'); fs.writeFileSync(tmpFile, '/** a function */function bananas() {}'); function doGet() { - get('http://localhost:4001/', function (text) { + get('http://localhost:4001/', function(text) { if (text.match(/bananas/)) { docProcess.kill(); t.end(); @@ -89,19 +98,19 @@ test('--watch', options, function (t) { }); }); -test('--watch', options, function (t) { +test('--watch', options, function(t) { var tmpDir = os.tmpdir(); var a = path.join(tmpDir, '/simple.js'); var b = path.join(tmpDir, '/required.js'); fs.writeFileSync(a, 'require("./required")'); fs.writeFileSync(b, '/** soup */function soup() {}'); var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function (data) { - get('http://localhost:4001/', function (text) { + docProcess.stdout.on('data', function(data) { + get('http://localhost:4001/', function(text) { t.ok(text.match(/soup/), 'sends an html index file'); fs.writeFileSync(b, '/** nuts */function nuts() {}'); function doGet() { - get('http://localhost:4001/', function (text) { + get('http://localhost:4001/', function(text) { if (text.match(/nuts/)) { docProcess.kill(); t.end(); @@ -115,13 +124,13 @@ test('--watch', options, function (t) { }); }); -test('error page', options, function (t) { +test('error page', options, function(t) { var tmpDir = os.tmpdir(); var a = path.join(tmpDir, '/simple.js'); fs.writeFileSync(a, '**'); var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function (data) { - get('http://localhost:4001/', function (text) { + docProcess.stdout.on('data', function(data) { + get('http://localhost:4001/', function(text) { t.ok(text.match(/Unexpected token/), 'emits an error page'); docProcess.kill(); t.end(); diff --git a/test/bin.js b/test/bin.js index 293e57069..9b412b493 100644 --- a/test/bin.js +++ b/test/bin.js @@ -20,9 +20,9 @@ function documentation(args, options, callback, parseJSON) { options.maxBuffer = 1024 * 1024; - args.unshift('node '+ path.join(__dirname, '..', 'bin', 'documentation.js')); + args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); - exec(args.join(' '), options, function (err, stdout, stderr) { + exec(args.join(' '), options, function(err, stdout, stderr) { if (err) { return callback(err, stdout, stderr); } @@ -35,7 +35,7 @@ function documentation(args, options, callback, parseJSON) { } function normalize(result) { - result.forEach(function (item) { + result.forEach(function(item) { item.context.file = '[path]'; }); return result; @@ -43,204 +43,267 @@ function normalize(result) { var options = { timeout: 1000 * 120 }; -test('documentation binary', options, function (t) { - documentation(['build fixture/simple.input.js'], function (err, data) { +test('documentation binary', options, function(t) { + documentation(['build fixture/simple.input.js'], function(err, data) { t.error(err); t.equal(data.length, 1, 'simple has no dependencies'); t.end(); }); }); -test('defaults to parsing package.json main', options, function (t) { - documentation(['build'], { cwd: path.join(__dirname, '..') }, function (err, data) { - t.error(err); - t.ok(data.length, 'we document ourself'); - t.end(); - }); +test('defaults to parsing package.json main', options, function(t) { + documentation( + ['build'], + { cwd: path.join(__dirname, '..') }, + function(err, data) { + t.error(err); + t.ok(data.length, 'we document ourself'); + t.end(); + } + ); }); -test('polyglot mode', options, function (t) { - documentation(['build fixture/polyglot/blend.cpp --polyglot'], - function (err, data) { +test('polyglot mode', options, function(t) { + documentation( + ['build fixture/polyglot/blend.cpp --polyglot'], + function(err, data) { t.ifError(err); if (process.env.UPDATE) { fs.writeFileSync( - path.resolve(__dirname, - 'fixture', - 'polyglot/blend.json'), JSON.stringify(normalize(data), null, 2), 'utf8'); + path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), + JSON.stringify(normalize(data), null, 2), + 'utf8' + ); } var expected = fs.readFileSync( - path.resolve(__dirname, - 'fixture', - 'polyglot/blend.json'), 'utf8'); - t.deepEqual( - normalize(data), - JSON.parse(expected), - 'parsed C++ file'); + path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), + 'utf8' + ); + t.deepEqual(normalize(data), JSON.parse(expected), 'parsed C++ file'); t.end(); - }); + } + ); }); -test('accepts config file', options, function (t) { - documentation(['build fixture/sorting/input.js -c fixture/config.json'], - function (err, data) { +test('accepts config file', options, function(t) { + documentation( + ['build fixture/sorting/input.js -c fixture/config.json'], + function(err, data) { t.error(err); if (process.env.UPDATE) { fs.writeFileSync( - path.resolve(__dirname, - 'fixture', - 'sorting/output.json'), JSON.stringify(normalize(data), null, 2), 'utf8'); + path.resolve(__dirname, 'fixture', 'sorting/output.json'), + JSON.stringify(normalize(data), null, 2), + 'utf8' + ); } var expected = fs.readFileSync( - path.resolve(__dirname, - 'fixture', - 'sorting/output.json'), 'utf8'); + path.resolve(__dirname, 'fixture', 'sorting/output.json'), + 'utf8' + ); t.deepEqual( normalize(data), JSON.parse(expected), - 'respected sort order from config file'); + 'respected sort order from config file' + ); t.end(); - }); + } + ); }); -test('accepts config file - reports failures', options, function (t) { - documentation(['build fixture/sorting/input.js -c fixture/config-bad.yml'], {}, - function (err, data, stderr) { +test('accepts config file - reports failures', options, function(t) { + documentation( + ['build fixture/sorting/input.js -c fixture/config-bad.yml'], + {}, + function(err, data, stderr) { t.error(err); if (process.env.UPDATE) { fs.writeFileSync( - path.resolve(__dirname, - 'fixture', - 'sorting/output-bad.txt'), stderr, 'utf8'); + path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), + stderr, + 'utf8' + ); } var expected = fs.readFileSync( - path.resolve(__dirname, - 'fixture', - 'sorting/output-bad.txt'), 'utf8'); + path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), + 'utf8' + ); t.equal(stderr, expected, 'reported a missing toc entry'); t.end(); - }, false); + }, + false + ); }); -test('accepts config file - reports parse failures', options, function (t) { - documentation(['build fixture/sorting/input.js -c fixture/config-malformed.json'], {}, - function (err, data, stderr) { +test('accepts config file - reports parse failures', options, function(t) { + documentation( + ['build fixture/sorting/input.js -c fixture/config-malformed.json'], + {}, + function(err, data, stderr) { t.match(stderr, /SyntaxError/g, 'Reports a SyntaxError with bad config'); t.end(); - }, false); + }, + false + ); }); -test('--shallow option', function (t) { - documentation(['build --shallow fixture/internal.input.js'], function (err, data) { - t.error(err); - t.equal(data.length, 0, 'should not check dependencies'); - t.end(); - }); +test('--shallow option', function(t) { + documentation( + ['build --shallow fixture/internal.input.js'], + function(err, data) { + t.error(err); + t.equal(data.length, 0, 'should not check dependencies'); + t.end(); + } + ); }); -test('external modules option', function (t) { - documentation(['build fixture/external.input.js ' + - '--external=external --external=external/node_modules'], function (err, data) { - t.ifError(err); - t.equal(data.length, 2, 'Includes external file'); - t.end(); - }); +test('external modules option', function(t) { + documentation( + [ + 'build fixture/external.input.js ' + + '--external=external --external=external/node_modules' + ], + function(err, data) { + t.ifError(err); + t.equal(data.length, 2, 'Includes external file'); + t.end(); + } + ); }); -test('when a file is specified both in a glob and explicitly, it is only documented once', function (t) { - documentation(['build fixture/simple.input.js fixture/simple.input.*'], function (err, data) { - t.ifError(err); - t.equal(data.length, 1, 'File is documented only once'); - t.end(); - }); +test('when a file is specified both in a glob and explicitly, it is only documented once', function(t) { + documentation( + ['build fixture/simple.input.js fixture/simple.input.*'], + function(err, data) { + t.ifError(err); + t.equal(data.length, 1, 'File is documented only once'); + t.end(); + } + ); }); -test('extension option', function (t) { - documentation(['build fixture/extension/index.otherextension ' + - '--requireExtension=otherextension --parseExtension=otherextension'], function (err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - }); +test('extension option', function(t) { + documentation( + [ + 'build fixture/extension/index.otherextension ' + + '--requireExtension=otherextension --parseExtension=otherextension' + ], + function(err, data) { + t.ifError(err); + t.equal(data.length, 1, 'includes a file with an arbitrary extension'); + t.end(); + } + ); }); /* * This tests that parseExtension adds extensions to smartGlob's * look through directories. */ -test('polyglot + parseExtension + smartGlob', function (t) { - documentation(['build fixture/polyglot ' + - '--polyglot --parseExtension=cpp'], function (err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - }); +test('polyglot + parseExtension + smartGlob', function(t) { + documentation( + ['build fixture/polyglot ' + '--polyglot --parseExtension=cpp'], + function(err, data) { + t.ifError(err); + t.equal(data.length, 1, 'includes a file with an arbitrary extension'); + t.end(); + } + ); }); -test('extension option', function (t) { - documentation(['build fixture/extension.jsx'], function (err, data) { +test('extension option', function(t) { + documentation(['build fixture/extension.jsx'], function(err, data) { t.ifError(err); t.end(); }); }); -test('invalid arguments', function (group) { - group.test('bad -f option', options, function (t) { - documentation(['build -f DOES-NOT-EXIST fixture/internal.input.js'], {}, function (err) { - t.ok(err, 'returns error'); - t.end(); - }, false); +test('invalid arguments', function(group) { + group.test('bad -f option', options, function(t) { + documentation( + ['build -f DOES-NOT-EXIST fixture/internal.input.js'], + {}, + function(err) { + t.ok(err, 'returns error'); + t.end(); + }, + false + ); }); - group.test('html with no destination', options, function (t) { - documentation(['build -f html fixture/internal.input.js'], function (err) { - t.ok(err.toString() - .match(/The HTML output mode requires a destination directory set with -o/), - 'needs dest for html'); + group.test('html with no destination', options, function(t) { + documentation(['build -f html fixture/internal.input.js'], function(err) { + t.ok( + err + .toString() + .match( + /The HTML output mode requires a destination directory set with -o/ + ), + 'needs dest for html' + ); t.end(); }); }); - group.test('bad command', function (t) { - documentation(['-f html fixture/internal.input.js'], {}, function (err, stdout, stderr) { - t.ok(err.code, 'exits nonzero'); - t.end(); - }, false); + group.test('bad command', function(t) { + documentation( + ['-f html fixture/internal.input.js'], + {}, + function(err, stdout, stderr) { + t.ok(err.code, 'exits nonzero'); + t.end(); + }, + false + ); }); group.end(); }); -test('--config', options, function (t) { +test('--config', options, function(t) { var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); fs.mkdirSync(dst); var outputIndex = path.join(dst, 'index.html'); - var expectedOutputPath = path.join(__dirname, 'fixture/html/nested.config-output.html'); - documentation(['build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + - dst], function (err) { - t.notOk(err); - var output = fs.readFileSync(outputIndex, 'utf8'); - if (process.env.UPDATE) { - fs.writeFileSync(expectedOutputPath, output); - } - var expectedOutput = fs.readFileSync(expectedOutputPath, 'utf8'); - t.equal(expectedOutput, output, 'generates correct output'); - t.end(); - }, false); + var expectedOutputPath = path.join( + __dirname, + 'fixture/html/nested.config-output.html' + ); + documentation( + [ + 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + + dst + ], + function(err) { + t.notOk(err); + var output = fs.readFileSync(outputIndex, 'utf8'); + if (process.env.UPDATE) { + fs.writeFileSync(expectedOutputPath, output); + } + var expectedOutput = fs.readFileSync(expectedOutputPath, 'utf8'); + t.equal(expectedOutput, output, 'generates correct output'); + t.end(); + }, + false + ); }); -test('--version', options, function (t) { - documentation(['--version'], {}, function (err, output) { - t.ok(output, 'outputs version'); - t.end(); - }, false); +test('--version', options, function(t) { + documentation( + ['--version'], + {}, + function(err, output) { + t.ok(output, 'outputs version'); + t.end(); + }, + false + ); }); -test('lint command', function (group) { - - group.test('generates lint output', options, function (t) { - documentation(['lint fixture/lint/lint.input.js'], function (err, data) { - var output = path.join(__dirname, 'fixture', 'lint', 'lint.output.js'); +test('lint command', function(group) { + group.test('generates lint output', options, function(t) { + documentation(['lint fixture/lint/lint.input.js'], function(err, data) { + var output = path.join(__dirname, 'fixture', 'lint', 'lint.output'); data = data.toString().split('\n').slice(2).join('\n'); if (process.env.UPDATE) { fs.writeFileSync(output, data); @@ -254,182 +317,277 @@ test('lint command', function (group) { }); }); - group.test('generates no output on a good file', options, function (t) { - documentation(['lint fixture/simple.input.js'], {}, function (err, data) { - t.equal(err, null); - t.equal(data, '', 'no output'); - t.end(); - }, false); + group.test('generates no output on a good file', options, function(t) { + documentation( + ['lint fixture/simple.input.js'], + {}, + function(err, data) { + t.equal(err, null); + t.equal(data, '', 'no output'); + t.end(); + }, + false + ); }); - group.test('exposes syntax error on a bad file', options, function (t) { - documentation(['lint fixture/bad/syntax.input.js'], {}, function (err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, false); + group.test('exposes syntax error on a bad file', options, function(t) { + documentation( + ['lint fixture/bad/syntax.input', '--parseExtension input'], + {}, + function(err, data) { + t.ok(err.code > 0, 'exits with a > 0 exit code'); + t.end(); + }, + false + ); }); - group.test('lint with no inputs', options, function (t) { - documentation(['lint'], { - cwd: path.join(__dirname, 'fixture/bad') - }, function (err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, false); + group.test('lint with no inputs', options, function(t) { + documentation( + ['lint'], + { + cwd: path.join(__dirname, 'fixture/bad') + }, + function(err, data) { + t.ok(err.code > 0, 'exits with a > 0 exit code'); + t.end(); + }, + false + ); }); group.end(); }); -test('given no files', options, function (t) { - documentation(['build'], function (err) { - t.ok(err.toString() - .match(/documentation was given no files and was not run in a module directory/), - 'no files given'); +test('given no files', options, function(t) { + documentation(['build'], function(err) { + t.ok( + err + .toString() + .match( + /documentation was given no files and was not run in a module directory/ + ), + 'no files given' + ); t.end(); }); }); -test('with an invalid command', options, function (t) { - documentation(['invalid'], {}, function (err) { - t.ok(err, 'returns error'); - t.end(); - }, false); +test('with an invalid command', options, function(t) { + documentation( + ['invalid'], + {}, + function(err) { + t.ok(err, 'returns error'); + t.end(); + }, + false + ); }); -test('--access flag', function (t) { - documentation(['build --shallow fixture/internal.input.js -a public'], {}, function (err, data) { - t.error(err); - t.equal(data, '[]'); - t.end(); - }, false); +test('--access flag', function(t) { + documentation( + ['build --shallow fixture/internal.input.js -a public'], + {}, + function(err, data) { + t.error(err); + t.equal(data, '[]'); + t.end(); + }, + false + ); }); -test('--private flag', function (t) { - documentation(['build fixture/internal.input.js --private'], {}, function (err, data) { - t.error(err); - t.ok(data.length > 2, 'outputs docs'); - t.end(); - }, false); +test('--private flag', function(t) { + documentation( + ['build fixture/internal.input.js --private'], + {}, + function(err, data) { + t.error(err); + t.ok(data.length > 2, 'outputs docs'); + t.end(); + }, + false + ); }); -test('--infer-private flag', function (t) { - documentation(['build fixture/infer-private.input.js --infer-private ^_'], {}, function (err, data) { - t.error(err); +test('--infer-private flag', function(t) { + documentation( + ['build fixture/infer-private.input.js --infer-private ^_'], + {}, + function(err, data) { + t.error(err); - // This uses JSON.parse with a reviver used as a visitor. - JSON.parse(data, function (n, v) { - // Make sure we do not see any names that match `^_`. - if (n === 'name') { - t.equal(typeof v, 'string'); - t.ok(!/_$/.test(v)); - } - return v; - }); - t.end(); - }, false); + // This uses JSON.parse with a reviver used as a visitor. + JSON.parse(data, function(n, v) { + // Make sure we do not see any names that match `^_`. + if (n === 'name') { + t.equal(typeof v, 'string'); + t.ok(!/_$/.test(v)); + } + return v; + }); + t.end(); + }, + false + ); }); -test('write to file', options, function (t) { - +test('write to file', options, function(t) { var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - documentation(['build --shallow fixture/internal.input.js -o ' + dst], {}, function (err, data) { - t.error(err); - t.equal(data, ''); - t.ok(fs.existsSync(dst), 'created file'); - t.end(); - }, false); + documentation( + ['build --shallow fixture/internal.input.js -o ' + dst], + {}, + function(err, data) { + t.error(err); + t.equal(data, ''); + t.ok(fs.existsSync(dst), 'created file'); + t.end(); + }, + false + ); }); -test('write to html', options, function (t) { - +test('write to html', options, function(t) { var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); fs.mkdirSync(dstDir); - documentation(['build --shallow fixture/internal.input.js -f html -o ' + dstDir], {}, - function (err, data) { + documentation( + ['build --shallow fixture/internal.input.js -f html -o ' + dstDir], + {}, + function(err, data) { t.error(err); t.equal(data, ''); - t.ok(fs.existsSync(path.join(dstDir, 'index.html')), 'created index.html'); + t.ok( + fs.existsSync(path.join(dstDir, 'index.html')), + 'created index.html' + ); t.end(); - }, false); + }, + false + ); }); -test('write to html with custom theme', options, function (t) { - +test('write to html with custom theme', options, function(t) { var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); fs.mkdirSync(dstDir); - documentation(['build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + dstDir], {}, - function (err, data) { + documentation( + [ + 'build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + + dstDir + ], + {}, + function(err, data) { t.error(err); t.equal(data, ''); - t.ok(fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'), 'Hello world'); + t.ok( + fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'), + 'Hello world' + ); t.end(); - }, false); + }, + false + ); }); -test('write to html, highlightAuto', options, function (t) { - +test('write to html, highlightAuto', options, function(t) { var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js', config = 'fixture/auto_lang_hljs/config.yml', dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); fs.mkdirSync(dstDir); - documentation(['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], {}, - function (err) { + documentation( + ['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], + {}, + function(err) { t.ifErr(err); var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'); - t.ok(result.indexOf('42') > 0, - 'javascript is recognized by highlightjs'); - t.ok(result.indexOf('[data-foo]') > 0, - 'css is recognized by highlightjs'); - t.ok(result.indexOf('data-foo') > 0, - 'html is recognized by highlightjs'); + t.ok( + result.indexOf('42') > 0, + 'javascript is recognized by highlightjs' + ); + t.ok( + result.indexOf('[data-foo]') > + 0, + 'css is recognized by highlightjs' + ); + t.ok( + result.indexOf('data-foo') > 0, + 'html is recognized by highlightjs' + ); t.end(); - }, false); + }, + false + ); }); -test('fatal error', options, function (t) { - - documentation(['build --shallow fixture/bad/syntax.input.js'], {}, - function (err) { +test('fatal error', options, function(t) { + documentation( + ['build --shallow fixture/bad/syntax.input --parseExtension input'], + {}, + function(err) { t.ok(err.toString().match(/Unexpected token/), 'reports syntax error'); t.end(); - }, false); + }, + false + ); }); -test('build --document-exported', function (t) { - - documentation(['build fixture/document-exported.input.js --document-exported -f md'], {}, function (err, data) { - t.error(err); - - var outputfile = path.join(__dirname, 'fixture', 'document-exported.output.md'); - if (process.env.UPDATE) { - fs.writeFileSync(outputfile, data, 'utf8'); +test( + 'build --document-exported', + function(t) { + documentation( + ['build fixture/document-exported.input.js --document-exported -f md'], + {}, + function(err, data) { + t.error(err); + + var outputfile = path.join( + __dirname, + 'fixture', + 'document-exported.output.md' + ); + if (process.env.UPDATE) { + fs.writeFileSync(outputfile, data, 'utf8'); + } + + var expect = fs.readFileSync(outputfile, 'utf-8'); + t.equal(data, expect); + t.end(); + }, + false + ); + }, + options +); + +test( + 'build large file without error (no deoptimized styling error)', + function(t) { + var dstFile = path.join( + os.tmpdir(), + (Date.now() + Math.random()).toString() + ) + '.js'; + var contents = ''; + for (var i = 0; i < 4e4; i++) { + contents += '/* - */\n'; } - - var expect = fs.readFileSync(outputfile, 'utf-8'); - t.equal(data, expect); - t.end(); - }, false); -}, options); - -test('build large file without error (no deoptimized styling error)', function (t) { - - var dstFile = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()) + '.js'; - var contents = ''; - for (var i = 0; i < 4e4; i++) { - contents += '/* - */\n'; - } - fs.writeFileSync(dstFile, contents, 'utf8'); - - documentation(['build ' + dstFile], {}, function (err, data, stderr) { - t.error(err); - t.equal(stderr, ''); - fs.unlinkSync(dstFile); - t.end(); - }, false); -}, options); + fs.writeFileSync(dstFile, contents, 'utf8'); + + documentation( + ['build ' + dstFile], + {}, + function(err, data, stderr) { + t.error(err); + t.equal(stderr, ''); + fs.unlinkSync(dstFile); + t.end(); + }, + false + ); + }, + options +); diff --git a/test/fixture/auto_lang_hljs/multilanguage.input.js b/test/fixture/auto_lang_hljs/multilanguage.input.js index 8b8eb0687..5d16141fd 100644 --- a/test/fixture/auto_lang_hljs/multilanguage.input.js +++ b/test/fixture/auto_lang_hljs/multilanguage.input.js @@ -15,7 +15,7 @@ * @augments Foo * @augments Bar */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/bad/syntax.input.js b/test/fixture/bad/syntax.input similarity index 100% rename from test/fixture/bad/syntax.input.js rename to test/fixture/bad/syntax.input diff --git a/test/fixture/bad/syntax.output.json b/test/fixture/bad/syntax.output.json index ba4eca87f..2572df4da 100644 --- a/test/fixture/bad/syntax.output.json +++ b/test/fixture/bad/syntax.output.json @@ -1,7 +1,7 @@ { - "pos": 0, + "pos": 19, "loc": { - "line": 1, + "line": 2, "column": 0 }, "_babel": true diff --git a/test/fixture/class.input.js b/test/fixture/class.input.js index aa3db4283..df1268ee7 100644 --- a/test/fixture/class.input.js +++ b/test/fixture/class.input.js @@ -12,7 +12,7 @@ function MyClass() { * @param {boolean} getIt whether to get the number * @returns {number} forty-two */ -MyClass.prototype.getFoo = function (getIt) { +MyClass.prototype.getFoo = function(getIt) { return getIt ? 42 : 0; }; @@ -20,4 +20,4 @@ MyClass.prototype.getFoo = function (getIt) { * Get undefined * @returns {undefined} does not return anything. */ -MyClass.prototype.getUndefined = function () { }; +MyClass.prototype.getUndefined = function() {}; diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json index fd28ff3fc..37f1d9b70 100644 --- a/test/fixture/class.output.json +++ b/test/fixture/class.output.json @@ -502,7 +502,7 @@ }, "end": { "line": 23, - "column": 49 + "column": 47 } } }, diff --git a/test/fixture/custom_theme/index.js b/test/fixture/custom_theme/index.js index 7f1730a5a..e1f1f1ed0 100644 --- a/test/fixture/custom_theme/index.js +++ b/test/fixture/custom_theme/index.js @@ -5,9 +5,11 @@ var File = require('vinyl'); * support. */ module.exports = function(comments, options, callback) { - return Promise.resolve([new File({ - base: '/', - path: '/index.html', - contents: new Buffer('Hello world') - })]); + return Promise.resolve([ + new File({ + base: '/', + path: '/index.html', + contents: new Buffer('Hello world') + }) + ]); }; diff --git a/test/fixture/default-export-function.input.js b/test/fixture/default-export-function.input.js index 10741869d..17dd436c2 100644 --- a/test/fixture/default-export-function.input.js +++ b/test/fixture/default-export-function.input.js @@ -1,5 +1,5 @@ /** i am foo */ export default function() { /** i am foo's son */ - this.bar = () => { } -}; + this.bar = () => {}; +} diff --git a/test/fixture/document-exported-bad/x.js b/test/fixture/document-exported-bad/x.js index 80bf1c6fb..10ed3fe3d 100644 --- a/test/fixture/document-exported-bad/x.js +++ b/test/fixture/document-exported-bad/x.js @@ -1 +1 @@ -export {y as x} from './exports-z.js'; +export { y as x } from './exports-z.js'; diff --git a/test/fixture/document-exported-export-default-object.input.js b/test/fixture/document-exported-export-default-object.input.js index 01d62a0ee..00210d2c4 100644 --- a/test/fixture/document-exported-export-default-object.input.js +++ b/test/fixture/document-exported-export-default-object.input.js @@ -1,5 +1,5 @@ // Options: {"documentExported": true} export default { - x: 42, + x: 42 }; diff --git a/test/fixture/document-exported.input.js b/test/fixture/document-exported.input.js index 0f4cffa5d..4d4ab6ea0 100644 --- a/test/fixture/document-exported.input.js +++ b/test/fixture/document-exported.input.js @@ -9,12 +9,12 @@ export class Class { static set staticSetter(v) {} } -export var object = { +export var object = { method() {}, get getter() {}, set setter(v) {}, prop: 42, - func: function() {}, + func: function() {} }; /** Should not document this */ @@ -34,7 +34,7 @@ class NotExportedClass { } /** Should not document this */ -var notExportedObject = { +var notExportedObject = { /** Should not document this */ method() {}, /** Should not document this */ @@ -44,38 +44,37 @@ var notExportedObject = { /** Should not document this */ prop: 42, /** Should not document this */ - func: function() {}, + func: function() {} }; -export {x, y3 as y4} from './document-exported/x'; -export z from './document-exported/z.js'; -export y2Default from './document-exported/y.js'; +export { x, y3 as y4 } from './document-exported/x'; +export z from './document-exported/z.js'; +export y2Default from './document-exported/y.js'; function f1() {} function f2() {} -export {f1, f2 as f3}; +export { f1, f2 as f3 }; export type T = number; type T2 = string; type T3 = string; -export type {T2, T3 as T4}; +export type { T2, T3 as T4 }; -export type {T5} from './document-exported/x.js'; +export type { T5 } from './document-exported/x.js'; -export var f4 = function(x: X) {} +export var f4 = function(x: X) {}; - -export {f5}; +export { f5 }; export var o1 = { om1() {} -} +}; /** f5 comment */ var f5 = function(y: Y) {}, o2 = { om2() {} }; -export {o2}; +export { o2 }; diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json index f44342daf..bbe960428 100644 --- a/test/fixture/document-exported.output.json +++ b/test/fixture/document-exported.output.json @@ -1418,7 +1418,7 @@ }, "end": { "line": 67, - "column": 33 + "column": 34 } }, "context": { @@ -1429,7 +1429,7 @@ }, "end": { "line": 67, - "column": 33 + "column": 34 } } }, @@ -1474,23 +1474,23 @@ "tags": [], "loc": { "start": { - "line": 72, + "line": 71, "column": 0 }, "end": { - "line": 74, - "column": 1 + "line": 73, + "column": 2 } }, "context": { "loc": { "start": { - "line": 72, + "line": 71, "column": 0 }, "end": { - "line": 74, - "column": 1 + "line": 73, + "column": 2 } } }, @@ -1515,22 +1515,22 @@ "tags": [], "loc": { "start": { - "line": 73, + "line": 72, "column": 2 }, "end": { - "line": 73, + "line": 72, "column": 10 } }, "context": { "loc": { "start": { - "line": 73, + "line": 72, "column": 2 }, "end": { - "line": 73, + "line": 72, "column": 10 } } @@ -1632,22 +1632,22 @@ "tags": [], "loc": { "start": { - "line": 76, + "line": 75, "column": 0 }, "end": { - "line": 76, + "line": 75, "column": 17 } }, "context": { "loc": { "start": { - "line": 77, + "line": 76, "column": 0 }, "end": { - "line": 80, + "line": 79, "column": 4 } } @@ -1659,7 +1659,7 @@ { "title": "param", "name": "y", - "lineNumber": 77, + "lineNumber": 76, "type": { "type": "NameExpression", "name": "Y" @@ -1693,22 +1693,22 @@ "tags": [], "loc": { "start": { - "line": 78, + "line": 77, "column": 2 }, "end": { - "line": 80, + "line": 79, "column": 3 } }, "context": { "loc": { "start": { - "line": 78, + "line": 77, "column": 2 }, "end": { - "line": 80, + "line": 79, "column": 3 } } @@ -1734,22 +1734,22 @@ "tags": [], "loc": { "start": { - "line": 79, + "line": 78, "column": 4 }, "end": { - "line": 79, + "line": 78, "column": 12 } }, "context": { "loc": { "start": { - "line": 79, + "line": 78, "column": 4 }, "end": { - "line": 79, + "line": 78, "column": 12 } } diff --git a/test/fixture/document-exported/x.js b/test/fixture/document-exported/x.js index 1757ae6d0..7a1b56a7c 100644 --- a/test/fixture/document-exported/x.js +++ b/test/fixture/document-exported/x.js @@ -1,3 +1,3 @@ -export {y as x, y3} from './y.js'; +export { y as x, y3 } from './y.js'; export type T5 = boolean; diff --git a/test/fixture/document-exported/y.js b/test/fixture/document-exported/y.js index 822b2fab0..0209640ad 100644 --- a/test/fixture/document-exported/y.js +++ b/test/fixture/document-exported/y.js @@ -7,4 +7,4 @@ export default y2; /** Description of y3 */ function y3(p: number): void {} -export {y3}; +export { y3 }; diff --git a/test/fixture/es6-class.input.js b/test/fixture/es6-class.input.js index 256d954db..10cf6c7c8 100644 --- a/test/fixture/es6-class.input.js +++ b/test/fixture/es6-class.input.js @@ -7,16 +7,15 @@ class Foo extends React.Component {} * Does nothing. This is from issue #556 */ export default class Bar { - - /** + /** * Creates a new instance * @param {string} str */ - constructor(str) { - /** + constructor(str) { + /** * A useless property * @type {string} */ - this.bar = ""; - } + this.bar = ''; + } } diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json index 2c76b4bf4..78ce308f3 100644 --- a/test/fixture/es6-class.output.json +++ b/test/fixture/es6-class.output.json @@ -177,7 +177,7 @@ "column": 0 }, "end": { - "line": 22, + "line": 21, "column": 1 } } @@ -264,23 +264,23 @@ ], "loc": { "start": { - "line": 11, - "column": 4 + "line": 10, + "column": 2 }, "end": { - "line": 14, + "line": 13, "column": 7 } }, "context": { "loc": { "start": { - "line": 15, - "column": 4 + "line": 14, + "column": 2 }, "end": { - "line": 21, - "column": 5 + "line": 20, + "column": 3 } } }, @@ -393,23 +393,23 @@ ], "loc": { "start": { - "line": 16, - "column": 8 + "line": 15, + "column": 4 }, "end": { - "line": 19, + "line": 18, "column": 11 } }, "context": { "loc": { "start": { - "line": 20, - "column": 8 + "line": 19, + "column": 4 }, "end": { - "line": 20, - "column": 22 + "line": 19, + "column": 18 } } }, diff --git a/test/fixture/es6-default2.input.js b/test/fixture/es6-default2.input.js index 7bb836e7b..50050cdf2 100644 --- a/test/fixture/es6-default2.input.js +++ b/test/fixture/es6-default2.input.js @@ -1,4 +1,4 @@ /** * @public */ -export default (thisIsTheArgument) => {}; +export default thisIsTheArgument => {}; diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json index 5388784fe..148b861ea 100644 --- a/test/fixture/es6-default2.output.json +++ b/test/fixture/es6-default2.output.json @@ -26,7 +26,7 @@ }, "end": { "line": 4, - "column": 41 + "column": 39 } } }, diff --git a/test/fixture/es6-import.input.js b/test/fixture/es6-import.input.js index 19d21072c..51fe5fca6 100644 --- a/test/fixture/es6-import.input.js +++ b/test/fixture/es6-import.input.js @@ -1,11 +1,11 @@ import hasEx6 from './es6-ext'; -import multiply from "./simple.input.js"; -import * as foo from "some-other-module"; +import multiply from './simple.input.js'; +import * as foo from 'some-other-module'; /** * This function returns the number one. * @returns {Number} numberone */ -var multiplyTwice = (a) => a * multiply(a); +var multiplyTwice = a => a * multiply(a); export default multiplyTwice; diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json index 97eac7c72..30eeb9928 100644 --- a/test/fixture/es6-import.output.json +++ b/test/fixture/es6-import.output.json @@ -81,7 +81,7 @@ }, "end": { "line": 9, - "column": 43 + "column": 41 } } }, diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index f89783c1d..8ee1ff346 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -2,16 +2,16 @@ * This function destructures with defaults. It should not * have any parameter descriptions. */ -function destructure({phoneNumbers = [], emailAddresses = [], ...params} = {}) { -} +function destructure( + { phoneNumbers = [], emailAddresses = [], ...params } = {} +) {} /** * Similar, but with an array * @example * destructure([1, 2, 3]) */ -function destructure([a, b, c]) { -} +function destructure([a, b, c]) {} /** * This function returns the number one. @@ -66,8 +66,7 @@ class Sink { * * @returns {Basket} a basket */ -function makeABasket() { -} +function makeABasket() {} /** * This method returns a {@link Sink sink}. The type should be linked. @@ -75,20 +74,17 @@ function makeABasket() { * * @returns {Sink} a sink */ -function makeASink() { -} +function makeASink() {} /** * This function takes rest params */ -function functionWithRest(...someParams) { -} +function functionWithRest(...someParams) {} /** * So does this one, with types */ function functionWithRestAndType(...someParams: number) { - /** * This is an inner member. We are still trying to figure out * what these are for. @@ -102,7 +98,7 @@ function functionWithRestAndType(...someParams: number) { /** * This is an async method */ -async function foo() { } +async function foo() {} export default multiply; @@ -110,13 +106,13 @@ export default multiply; * This function returns the number one. * @returns {Number} numberone */ -module.exports = () => (

hello

); +module.exports = () =>

hello

; /** * This tests our support of optional parameters in ES6 */ function veryImportantTransform(foo = 'bar') { - return "42"; + return '42'; } // ACCESS LEVELS @@ -125,25 +121,25 @@ function veryImportantTransform(foo = 'bar') { * A private function * @private */ -function iAmPrivate() { } +function iAmPrivate() {} /** * A protected function * @protected */ -function iAmProtected() { } +function iAmProtected() {} /** * A public function * @public */ -function iAmPublic() { } +function iAmPublic() {} /** * A private function using the access tag * @access private */ -function iAmAccessPrivate() { } +function iAmAccessPrivate() {} /** * This is re-exported @@ -158,4 +154,3 @@ export function isArrayEqualWith( ): boolean { return true; } - diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 95be6730b..7ada1a342 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -74,8 +74,8 @@ "column": 0 }, "end": { - "line": 6, - "column": 1 + "line": 7, + "column": 4 } } }, @@ -104,7 +104,7 @@ { "title": "param", "name": "$0.params", - "lineNumber": 5, + "lineNumber": 6, "type": { "type": "RestType" } @@ -196,23 +196,23 @@ ], "loc": { "start": { - "line": 8, + "line": 9, "column": 0 }, "end": { - "line": 12, + "line": 13, "column": 3 } }, "context": { "loc": { "start": { - "line": 13, + "line": 14, "column": 0 }, "end": { "line": 14, - "column": 1 + "column": 34 } } }, @@ -234,17 +234,17 @@ { "title": "param", "name": "$0.a", - "lineNumber": 13 + "lineNumber": 14 }, { "title": "param", "name": "$0.b", - "lineNumber": 13 + "lineNumber": 14 }, { "title": "param", "name": "$0.c", - "lineNumber": 13 + "lineNumber": 14 } ] } @@ -1365,8 +1365,8 @@ "column": 0 }, "end": { - "line": 70, - "column": 1 + "line": 69, + "column": 25 } } }, @@ -1610,23 +1610,23 @@ ], "loc": { "start": { - "line": 72, + "line": 71, "column": 0 }, "end": { - "line": 77, + "line": 76, "column": 3 } }, "context": { "loc": { "start": { - "line": 78, + "line": 77, "column": 0 }, "end": { - "line": 79, - "column": 1 + "line": 77, + "column": 23 } } }, @@ -1772,23 +1772,23 @@ "tags": [], "loc": { "start": { - "line": 81, + "line": 79, "column": 0 }, "end": { - "line": 83, + "line": 81, "column": 3 } }, "context": { "loc": { "start": { - "line": 84, + "line": 82, "column": 0 }, "end": { - "line": 85, - "column": 1 + "line": 82, + "column": 43 } } }, @@ -1799,7 +1799,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 84, + "lineNumber": 82, "type": { "type": "RestType" } @@ -1883,22 +1883,22 @@ "tags": [], "loc": { "start": { - "line": 87, + "line": 84, "column": 0 }, "end": { - "line": 89, + "line": 86, "column": 3 } }, "context": { "loc": { "start": { - "line": 90, + "line": 87, "column": 0 }, "end": { - "line": 98, + "line": 94, "column": 1 } } @@ -1910,7 +1910,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 90, + "lineNumber": 87, "type": { "type": "RestType", "expression": { @@ -1998,23 +1998,23 @@ "tags": [], "loc": { "start": { - "line": 102, + "line": 98, "column": 0 }, "end": { - "line": 104, + "line": 100, "column": 3 } }, "context": { "loc": { "start": { - "line": 105, + "line": 101, "column": 0 }, "end": { - "line": 105, - "column": 24 + "line": 101, + "column": 23 } } }, @@ -2110,23 +2110,23 @@ ], "loc": { "start": { - "line": 109, + "line": 105, "column": 0 }, "end": { - "line": 112, + "line": 108, "column": 3 } }, "context": { "loc": { "start": { - "line": 113, + "line": 109, "column": 0 }, "end": { - "line": 113, - "column": 38 + "line": 109, + "column": 36 } } }, @@ -2272,22 +2272,22 @@ "tags": [], "loc": { "start": { - "line": 115, + "line": 111, "column": 0 }, "end": { - "line": 117, + "line": 113, "column": 3 } }, "context": { "loc": { "start": { - "line": 118, + "line": 114, "column": 0 }, "end": { - "line": 120, + "line": 116, "column": 1 } } @@ -2386,23 +2386,23 @@ ], "loc": { "start": { - "line": 130, + "line": 126, "column": 0 }, "end": { - "line": 133, + "line": 129, "column": 3 } }, "context": { "loc": { "start": { - "line": 134, + "line": 130, "column": 0 }, "end": { - "line": 134, - "column": 27 + "line": 130, + "column": 26 } } }, @@ -2495,23 +2495,23 @@ ], "loc": { "start": { - "line": 136, + "line": 132, "column": 0 }, "end": { - "line": 139, + "line": 135, "column": 3 } }, "context": { "loc": { "start": { - "line": 140, + "line": 136, "column": 0 }, "end": { - "line": 140, - "column": 24 + "line": 136, + "column": 23 } } }, @@ -2598,22 +2598,22 @@ "tags": [], "loc": { "start": { - "line": 148, + "line": 144, "column": 0 }, "end": { - "line": 150, + "line": 146, "column": 3 } }, "context": { "loc": { "start": { - "line": 151, + "line": 147, "column": 0 }, "end": { - "line": 151, + "line": 147, "column": 42 } } @@ -2698,22 +2698,22 @@ "tags": [], "loc": { "start": { - "line": 153, + "line": 149, "column": 0 }, "end": { - "line": 153, + "line": 149, "column": 32 } }, "context": { "loc": { "start": { - "line": 154, + "line": 150, "column": 0 }, "end": { - "line": 160, + "line": 156, "column": 1 } } @@ -2725,7 +2725,7 @@ { "title": "param", "name": "array1", - "lineNumber": 155, + "lineNumber": 151, "type": { "type": "TypeApplication", "expression": { @@ -2743,7 +2743,7 @@ { "title": "param", "name": "array2", - "lineNumber": 156, + "lineNumber": 152, "type": { "type": "TypeApplication", "expression": { diff --git a/test/fixture/factory.input.js b/test/fixture/factory.input.js index d133d75cf..70d2207dd 100644 --- a/test/fixture/factory.input.js +++ b/test/fixture/factory.input.js @@ -3,19 +3,16 @@ * @returns {area} chart */ var area = function() { - /** * @class area */ - var chart = function(selection) { - }; + var chart = function(selection) {}; /** * Sets the chart data. * @function */ - chart.data = function(_) { - }; + chart.data = function(_) {}; return chart; }; diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json index 8173663b3..9930019b0 100644 --- a/test/fixture/factory.output.json +++ b/test/fixture/factory.output.json @@ -80,7 +80,7 @@ "column": 0 }, "end": { - "line": 21, + "line": 18, "column": 2 } } @@ -184,23 +184,23 @@ ], "loc": { "start": { - "line": 7, + "line": 6, "column": 2 }, "end": { - "line": 9, + "line": 8, "column": 5 } }, "context": { "loc": { "start": { - "line": 10, + "line": 9, "column": 2 }, "end": { - "line": 11, - "column": 4 + "line": 9, + "column": 37 } } }, @@ -211,7 +211,7 @@ { "title": "param", "name": "selection", - "lineNumber": 10 + "lineNumber": 9 } ], "properties": [], @@ -299,23 +299,23 @@ ], "loc": { "start": { - "line": 13, + "line": 11, "column": 2 }, "end": { - "line": 16, + "line": 14, "column": 5 } }, "context": { "loc": { "start": { - "line": 17, + "line": 15, "column": 2 }, "end": { - "line": 18, - "column": 4 + "line": 15, + "column": 30 } } }, @@ -331,7 +331,7 @@ { "title": "param", "name": "_", - "lineNumber": 17 + "lineNumber": 15 } ], "properties": [], diff --git a/test/fixture/flow-unnamed-params.input.js b/test/fixture/flow-unnamed-params.input.js index 08b022071..62bdbbca2 100644 --- a/test/fixture/flow-unnamed-params.input.js +++ b/test/fixture/flow-unnamed-params.input.js @@ -3,13 +3,13 @@ 'use strict'; /** x */ -let x: T => string; +let x: (T) => string; /** x2 */ let x2: (a: T) => string; /** T */ -type T = string[] => {num: number}; +type T = (string[]) => { num: number }; /** T2 */ -type T2 = (a: string[]) => {num: number}; +type T2 = (a: string[]) => { num: number }; diff --git a/test/fixture/flow-unnamed-params.output.json b/test/fixture/flow-unnamed-params.output.json index e2f410f8b..bf5cf80cd 100644 --- a/test/fixture/flow-unnamed-params.output.json +++ b/test/fixture/flow-unnamed-params.output.json @@ -71,7 +71,7 @@ }, "end": { "line": 6, - "column": 19 + "column": 21 } } }, @@ -305,7 +305,7 @@ }, "end": { "line": 12, - "column": 35 + "column": 39 } } }, @@ -442,7 +442,7 @@ }, "end": { "line": 15, - "column": 41 + "column": 43 } } }, diff --git a/test/fixture/html/nested.input.js b/test/fixture/html/nested.input.js index dbb8b8c5e..1b2a61da8 100644 --- a/test/fixture/html/nested.input.js +++ b/test/fixture/html/nested.input.js @@ -15,7 +15,7 @@ function Klass(foo) { * @example this shows you how to getFoo * var x = foo.getFoo(); */ -Klass.prototype.getFoo = function () { +Klass.prototype.getFoo = function() { return this.foo; }; @@ -26,8 +26,7 @@ Klass.prototype.getFoo = function () { * @param {number} options.bar * @param {?number} otherOptions */ -Klass.prototype.withOptions = function (options, otherOptions) { -}; +Klass.prototype.withOptions = function(options, otherOptions) {}; /** * @typedef CustomError @@ -47,7 +46,7 @@ Klass.prototype.withOptions = function (options, otherOptions) { * @param {*} also * @returns {boolean} whether the other thing is a Klass */ -Klass.isClass = function (other, also) { +Klass.isClass = function(other, also) { return other instanceof Klass; }; @@ -58,7 +57,7 @@ Klass.isClass = function (other, also) { * @param {Weird} other * @returns {boolean} whether the other thing is a Klass */ -Klass.isWeird = function (other) { +Klass.isWeird = function(other) { return other instanceof Weird; }; @@ -69,7 +68,7 @@ Klass.isWeird = function (other) { * @param {number} [size=0] size * @returns {boolean} whether the other thing is a Klass */ -Klass.isBuffer = function (buf, size) { +Klass.isBuffer = function(buf, size) { return other instanceof Buffer; }; @@ -82,7 +81,7 @@ Klass.isBuffer = function (buf, size) { * var k = new Klass(); * k.isArrayOfBuffers(); */ -Klass.isArrayOfBuffers = function (buffers) { +Klass.isArrayOfBuffers = function(buffers) { return buffers.length; }; @@ -136,19 +135,19 @@ class Foo { /** * This is bar */ - get bar() { } + get bar() {} } /** * I am the container of stream types */ -var customStreams = { }; +var customStreams = {}; /** * I am a passthrough stream that belongs to customStreams * * @kind class */ -customStreams.passthrough = function () { +customStreams.passthrough = function() { this.custom = true; }; diff --git a/test/fixture/inheritance.input.js b/test/fixture/inheritance.input.js index cab8c59c4..b5c53c8d4 100644 --- a/test/fixture/inheritance.input.js +++ b/test/fixture/inheritance.input.js @@ -2,9 +2,8 @@ * With ES6, built-in types are extensible! */ class SpecialArray extends Array { - additionalMethod() { - } + additionalMethod() {} } /** @class Foo */ -module.exports = class Foo extends Bar { }; +module.exports = class Foo extends Bar {}; diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json index e0c55a4c5..cce7001ba 100644 --- a/test/fixture/inheritance.output.json +++ b/test/fixture/inheritance.output.json @@ -70,7 +70,7 @@ "column": 0 }, "end": { - "line": 7, + "line": 6, "column": 1 } } @@ -119,23 +119,23 @@ ], "loc": { "start": { - "line": 9, + "line": 8, "column": 0 }, "end": { - "line": 9, + "line": 8, "column": 17 } }, "context": { "loc": { "start": { - "line": 10, + "line": 9, "column": 0 }, "end": { - "line": 10, - "column": 43 + "line": 9, + "column": 42 } } }, diff --git a/test/fixture/inline-link.input.js b/test/fixture/inline-link.input.js index ced66a0cb..49def0b1c 100644 --- a/test/fixture/inline-link.input.js +++ b/test/fixture/inline-link.input.js @@ -18,6 +18,6 @@ function addOne(a) { * @param {number} a the input * @returns {number} numberone */ -module.exports = function (a) { +module.exports = function(a) { return addOne(a); }; diff --git a/test/fixture/interface.input.js b/test/fixture/interface.input.js index 5389c6b24..9bc49bbba 100644 --- a/test/fixture/interface.input.js +++ b/test/fixture/interface.input.js @@ -2,6 +2,6 @@ * This is my interface. */ interface Foo extends Bar, Baz { - prop1: number; - prop2: string; + prop1: number, + prop2: string } diff --git a/test/fixture/lends.input.js b/test/fixture/lends.input.js index 4aa9a25b7..3e4f6b7f9 100644 --- a/test/fixture/lends.input.js +++ b/test/fixture/lends.input.js @@ -23,4 +23,4 @@ export default TheClass( return word + 1; } } -) +); diff --git a/test/fixture/lends.output.json b/test/fixture/lends.output.json index 351407dda..4a231651f 100644 --- a/test/fixture/lends.output.json +++ b/test/fixture/lends.output.json @@ -86,7 +86,7 @@ }, "end": { "line": 26, - "column": 1 + "column": 2 } } }, diff --git a/test/fixture/lint/lint.output.js b/test/fixture/lint/lint.output similarity index 100% rename from test/fixture/lint/lint.output.js rename to test/fixture/lint/lint.output diff --git a/test/fixture/literal_types.input.js b/test/fixture/literal_types.input.js index 9ed0eebe9..14d074514 100644 --- a/test/fixture/literal_types.input.js +++ b/test/fixture/literal_types.input.js @@ -4,4 +4,4 @@ function f(x) {} /** */ -function g(x: 'a' | "b" | '' | 0 | -42 | 3.14) {} +function g(x: 'a' | 'b' | '' | 0 | -42 | 3.14) {} diff --git a/test/fixture/memberedclass.input.js b/test/fixture/memberedclass.input.js index def3545d8..d70cc4931 100644 --- a/test/fixture/memberedclass.input.js +++ b/test/fixture/memberedclass.input.js @@ -5,25 +5,24 @@ * @memberof com.Test */ com.Test.MyClass = class { + constructor() { + this.howMany = 2; + } - constructor() { - this.howMany = 2; - } - - /** + /** * Get the number 42 * * @param {boolean} getIt whether to get the number * @returns {number} forty-two */ - getFoo(getIt) { - return getIt ? 42 : 0; - } + getFoo(getIt) { + return getIt ? 42 : 0; + } - /** + /** * Get undefined * * @returns {undefined} does not return anything. */ - static getUndefined() {} + static getUndefined() {} }; diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json index 23a82c5cf..a817352c9 100644 --- a/test/fixture/memberedclass.output.json +++ b/test/fixture/memberedclass.output.json @@ -83,7 +83,7 @@ "column": 0 }, "end": { - "line": 29, + "line": 28, "column": 2 } } @@ -185,23 +185,23 @@ ], "loc": { "start": { - "line": 13, - "column": 4 + "line": 12, + "column": 2 }, "end": { - "line": 18, + "line": 17, "column": 7 } }, "context": { "loc": { "start": { - "line": 19, - "column": 4 + "line": 18, + "column": 2 }, "end": { - "line": 21, - "column": 5 + "line": 20, + "column": 3 } } }, @@ -428,23 +428,23 @@ ], "loc": { "start": { - "line": 23, - "column": 4 + "line": 22, + "column": 2 }, "end": { - "line": 27, + "line": 26, "column": 7 } }, "context": { "loc": { "start": { - "line": 28, - "column": 4 + "line": 27, + "column": 2 }, "end": { - "line": 28, - "column": 28 + "line": 27, + "column": 26 } } }, diff --git a/test/fixture/meta.input.js b/test/fixture/meta.input.js index 890aa7615..3ae757562 100644 --- a/test/fixture/meta.input.js +++ b/test/fixture/meta.input.js @@ -9,7 +9,7 @@ * @copyright Tom MacWright * @license BSD */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/nearby_params.input.js b/test/fixture/nearby_params.input.js index 573c6e595..66b686ddd 100644 --- a/test/fixture/nearby_params.input.js +++ b/test/fixture/nearby_params.input.js @@ -8,7 +8,6 @@ * @returns {Promise} promise, to be resolved on success or rejected on failure */ sessions.addMethod('create', 'POST / form', { - // normalize request body params - before({ body }) { - } + // normalize request body params + before({ body }) {} }); diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json index a8f367ebd..cbb783fe5 100644 --- a/test/fixture/nearby_params.output.json +++ b/test/fixture/nearby_params.output.json @@ -135,7 +135,7 @@ "column": 0 }, "end": { - "line": 14, + "line": 13, "column": 3 } } diff --git a/test/fixture/nest_params.input.js b/test/fixture/nest_params.input.js index b7531688e..7eeb16aa0 100644 --- a/test/fixture/nest_params.input.js +++ b/test/fixture/nest_params.input.js @@ -4,8 +4,7 @@ * @param {string} employees[].department - The employee's department. * @param {string} [type=minion] - The employee's type. */ -function foo(employees, type) { -} +function foo(employees, type) {} /** * @name foo diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json index 265b19938..70a9cf890 100644 --- a/test/fixture/nest_params.output.json +++ b/test/fixture/nest_params.output.json @@ -73,8 +73,8 @@ "column": 0 }, "end": { - "line": 8, - "column": 1 + "line": 7, + "column": 32 } } }, @@ -455,11 +455,11 @@ ], "loc": { "start": { - "line": 10, + "line": 9, "column": 0 }, "end": { - "line": 20, + "line": 19, "column": 3 } }, @@ -470,8 +470,8 @@ "column": 0 }, "end": { - "line": 8, - "column": 1 + "line": 7, + "column": 32 } } }, diff --git a/test/fixture/node_modules/external/index.js b/test/fixture/node_modules/external/index.js index f8bc109bd..f053ebf79 100644 --- a/test/fixture/node_modules/external/index.js +++ b/test/fixture/node_modules/external/index.js @@ -1,2 +1 @@ - module.exports = {}; diff --git a/test/fixture/node_modules/external/lib/main.js b/test/fixture/node_modules/external/lib/main.js index ccac66c5a..1f609e296 100644 --- a/test/fixture/node_modules/external/lib/main.js +++ b/test/fixture/node_modules/external/lib/main.js @@ -6,7 +6,7 @@ var otherDep = require('external2'); * This function returns the number one. * @returns {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return otherDep() - 1; }; diff --git a/test/fixture/node_modules/external/node_modules/external2/index.js b/test/fixture/node_modules/external/node_modules/external2/index.js index 6f53a38fd..675be873c 100644 --- a/test/fixture/node_modules/external/node_modules/external2/index.js +++ b/test/fixture/node_modules/external/node_modules/external2/index.js @@ -2,7 +2,7 @@ * This function returns the number one. * @return {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/node_modules/external2/index.js b/test/fixture/node_modules/external2/index.js index 140136fb2..db4a05174 100644 --- a/test/fixture/node_modules/external2/index.js +++ b/test/fixture/node_modules/external2/index.js @@ -2,7 +2,7 @@ * This function returns the number one. * @returns {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/optional-record-field-type.input.js b/test/fixture/optional-record-field-type.input.js index cc1893e21..2f4e3950e 100644 --- a/test/fixture/optional-record-field-type.input.js +++ b/test/fixture/optional-record-field-type.input.js @@ -1,5 +1,5 @@ /** */ type Record = { opt?: number, - req: string, + req: string }; diff --git a/test/fixture/params.input.js b/test/fixture/params.input.js index 4b5d53bc8..b57e213f2 100644 --- a/test/fixture/params.input.js +++ b/test/fixture/params.input.js @@ -30,8 +30,7 @@ class Foo { * The method * @param {number} x Param to method */ - method(x) { - } + method(x) {} } /** @@ -41,7 +40,7 @@ var TraditionalObject = { /** * This method should acquire the param x */ - traditionalMethod: function (x) { + traditionalMethod: function(x) { return x; } }; diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index 1f02a2ee2..a8aa42440 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -595,7 +595,7 @@ "column": 0 }, "end": { - "line": 35, + "line": 34, "column": 1 } } @@ -697,8 +697,8 @@ "column": 2 }, "end": { - "line": 34, - "column": 3 + "line": 33, + "column": 14 } } }, @@ -865,22 +865,22 @@ "tags": [], "loc": { "start": { - "line": 37, + "line": 36, "column": 0 }, "end": { - "line": 39, + "line": 38, "column": 3 } }, "context": { "loc": { "start": { - "line": 40, + "line": 39, "column": 0 }, "end": { - "line": 47, + "line": 46, "column": 2 } } @@ -957,22 +957,22 @@ "tags": [], "loc": { "start": { - "line": 41, + "line": 40, "column": 2 }, "end": { - "line": 43, + "line": 42, "column": 5 } }, "context": { "loc": { "start": { - "line": 44, + "line": 43, "column": 2 }, "end": { - "line": 46, + "line": 45, "column": 3 } } @@ -984,7 +984,7 @@ { "title": "param", "name": "x", - "lineNumber": 44 + "lineNumber": 43 } ], "properties": [], @@ -1180,22 +1180,22 @@ ], "loc": { "start": { - "line": 49, + "line": 48, "column": 0 }, "end": { - "line": 60, + "line": 59, "column": 3 } }, "context": { "loc": { "start": { - "line": 61, + "line": 60, "column": 0 }, "end": { - "line": 61, + "line": 60, "column": 22 } } @@ -1658,22 +1658,22 @@ ], "loc": { "start": { - "line": 63, + "line": 62, "column": 0 }, "end": { - "line": 74, + "line": 73, "column": 3 } }, "context": { "loc": { "start": { - "line": 75, + "line": 74, "column": 0 }, "end": { - "line": 77, + "line": 76, "column": 1 } } @@ -2118,22 +2118,22 @@ ], "loc": { "start": { - "line": 79, + "line": 78, "column": 0 }, "end": { - "line": 86, + "line": 85, "column": 3 } }, "context": { "loc": { "start": { - "line": 87, + "line": 86, "column": 0 }, "end": { - "line": 87, + "line": 86, "column": 37 } } @@ -2358,22 +2358,22 @@ ], "loc": { "start": { - "line": 89, + "line": 88, "column": 0 }, "end": { - "line": 94, + "line": 93, "column": 3 } }, "context": { "loc": { "start": { - "line": 95, + "line": 94, "column": 0 }, "end": { - "line": 97, + "line": 96, "column": 1 } } diff --git a/test/fixture/readme/index.js b/test/fixture/readme/index.js index 9b193faee..e4b0ea4bf 100644 --- a/test/fixture/readme/index.js +++ b/test/fixture/readme/index.js @@ -1,16 +1,11 @@ - /** * A function with documentation. * @param a {string} blah * @return {number} answer */ -function foo(a) { - -} +function foo(a) {} /** * A second function with docs */ -function bar(b) { - -} +function bar(b) {} diff --git a/test/fixture/simple-hashbang.input.js b/test/fixture/simple-hashbang.input.js index 71e454488..3dc52b89c 100644 --- a/test/fixture/simple-hashbang.input.js +++ b/test/fixture/simple-hashbang.input.js @@ -4,7 +4,7 @@ * This function returns the number one. * @returns {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/simple-singlestar.input.js b/test/fixture/simple-singlestar.input.js index 925e9c191..63ffc52e3 100644 --- a/test/fixture/simple-singlestar.input.js +++ b/test/fixture/simple-singlestar.input.js @@ -2,7 +2,7 @@ * This function returns the number one. * @returns {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/simple-triplestar.input.js b/test/fixture/simple-triplestar.input.js index e4c8f024b..be3220165 100644 --- a/test/fixture/simple-triplestar.input.js +++ b/test/fixture/simple-triplestar.input.js @@ -2,7 +2,7 @@ * This function returns the number one. * @returns {Number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/simple.input.js b/test/fixture/simple.input.js index de31b74d9..794813f04 100644 --- a/test/fixture/simple.input.js +++ b/test/fixture/simple.input.js @@ -2,7 +2,7 @@ * This function returns the number one. * @returns {number} numberone */ -module.exports = function () { +module.exports = function() { // this returns 1 return 1; }; diff --git a/test/fixture/string-literal-key.input.js b/test/fixture/string-literal-key.input.js index bc02e016a..e3d18d32b 100644 --- a/test/fixture/string-literal-key.input.js +++ b/test/fixture/string-literal-key.input.js @@ -5,7 +5,7 @@ const obj = { /** * The foo property */ - 'foo': { + foo: { bar: 0 } -} +}; diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json index a92400ba9..e8faeec6f 100644 --- a/test/fixture/string-literal-key.output.json +++ b/test/fixture/string-literal-key.output.json @@ -27,7 +27,7 @@ }, "end": { "line": 11, - "column": 1 + "column": 2 } } }, @@ -135,7 +135,12 @@ } }, "augments": [], - "errors": [], + "errors": [ + { + "message": "@memberof reference to obj not found", + "commentLineNumber": 0 + } + ], "examples": [], "params": [], "properties": [], @@ -144,6 +149,8 @@ "throws": [], "todos": [], "name": "foo", + "memberof": "obj", + "scope": "static", "members": { "global": [], "inner": [], @@ -153,9 +160,10 @@ }, "path": [ { - "name": "foo" + "name": "foo", + "scope": "static" } ], - "namespace": "foo" + "namespace": ".foo" } ] \ No newline at end of file diff --git a/test/fixture/system-import.input.js b/test/fixture/system-import.input.js index 95fd643be..9e6b90834 100644 --- a/test/fixture/system-import.input.js +++ b/test/fixture/system-import.input.js @@ -2,4 +2,4 @@ * System.import is a webpack convention * https://github.com/documentationjs/documentation/issues/578 */ -System.import("./simple.input.js").then(() => {}); +System.import('./simple.input.js').then(() => {}); diff --git a/test/fixture/this-class.input.js b/test/fixture/this-class.input.js index b55ddb699..338ef6c0c 100644 --- a/test/fixture/this-class.input.js +++ b/test/fixture/this-class.input.js @@ -2,12 +2,12 @@ /** @class */ var Book = function(title) { - /** The title of the book. */ - this.title = title; -} + /** The title of the book. */ + this.title = title; +}; /** @class */ this.BookShelf = function(title) { - /** The title of the bookshelf. */ - this.title = title; -} + /** The title of the bookshelf. */ + this.title = title; +}; diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json index b62cb5464..8e6091b02 100644 --- a/test/fixture/this-class.output.json +++ b/test/fixture/this-class.output.json @@ -28,7 +28,7 @@ }, "end": { "line": 7, - "column": 1 + "column": 2 } } }, @@ -92,7 +92,7 @@ }, "end": { "line": 7, - "column": 1 + "column": 2 } } }, @@ -174,22 +174,22 @@ "loc": { "start": { "line": 5, - "column": 4 + "column": 2 }, "end": { "line": 5, - "column": 33 + "column": 31 } }, "context": { "loc": { "start": { "line": 6, - "column": 3 + "column": 2 }, "end": { "line": 6, - "column": 22 + "column": 21 } } }, @@ -264,7 +264,7 @@ }, "end": { "line": 13, - "column": 1 + "column": 2 } } }, @@ -346,22 +346,22 @@ "loc": { "start": { "line": 11, - "column": 4 + "column": 2 }, "end": { "line": 11, - "column": 38 + "column": 36 } }, "context": { "loc": { "start": { "line": 12, - "column": 3 + "column": 2 }, "end": { "line": 12, - "column": 22 + "column": 21 } } }, diff --git a/test/fixture/var-function-param-return.input.js b/test/fixture/var-function-param-return.input.js index bc3fcce7d..89f94b06a 100644 --- a/test/fixture/var-function-param-return.input.js +++ b/test/fixture/var-function-param-return.input.js @@ -1,2 +1,2 @@ /** */ -var f = function(x: number): boolean {} +var f = function(x: number): boolean {}; diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json index be9937633..3cd6a3c86 100644 --- a/test/fixture/var-function-param-return.output.json +++ b/test/fixture/var-function-param-return.output.json @@ -20,7 +20,7 @@ }, "end": { "line": 2, - "column": 39 + "column": 40 } } }, diff --git a/test/format_type.js b/test/format_type.js index 589b68cc9..274e1df08 100644 --- a/test/format_type.js +++ b/test/format_type.js @@ -14,7 +14,7 @@ function stringify(children) { }); } -test('formatType', function (t) { +test('formatType', function(t) { var linkerStack = new LinkerStack({}); var formatType = _formatType.bind(undefined, linkerStack.link); [ @@ -22,44 +22,102 @@ test('formatType', function (t) { ['null', 'null'], ['null', 'null'], ['*', 'any'], - ['Array|undefined', '([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\| [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))'], - ['Array', '[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>'], - ['number!', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)!'], - ['function(string, boolean)', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))'], - ['function(string, boolean): number', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)): [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], + [ + 'Array|undefined', + '([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\| [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))' + ], + [ + 'Array', + '[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>' + ], + [ + 'number!', + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)!' + ], + [ + 'function(string, boolean)', + 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))' + ], + [ + 'function(string, boolean): number', + 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)): [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)' + ], ['function()', 'function ()'], - ['function(this:something, string)', 'function (this: something, [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))'], + [ + 'function(this:something, string)', + 'function (this: something, [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))' + ], ['function(new:something)', 'function (new: something)'], - ['{myNum: number, myObject}', '{myNum: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), myObject}'], - ['[string,]', '\\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]'], - ['number?', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?'], - ['number', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], + [ + '{myNum: number, myObject}', + '{myNum: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), myObject}' + ], + [ + '[string,]', + '\\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]' + ], + [ + 'number?', + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?' + ], + [ + 'number', + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)' + ], ['?', '?'], ['void', 'void'], ['function(a:b)', 'function (a: b)'], ['function(a):void', 'function (a): void'], - ['number=', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?'], - ['...number', '...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)'], - ['undefined', '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)'] - ].forEach(function (example) { - t.deepEqual(stringify(formatType( - parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type) - ), example[1], example[0]); + [ + 'number=', + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?' + ], + [ + '...number', + '...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)' + ], + [ + 'undefined', + '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)' + ] + ].forEach(function(example) { + t.deepEqual( + stringify( + formatType( + parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type + ) + ), + example[1], + example[0] + ); }); - t.deepEqual(stringify(formatType( - parse('@param {number} [a=1]', { sloppy: true }).tags[0].type) - ), '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?', 'default'); + t.deepEqual( + stringify( + formatType(parse('@param {number} [a=1]', { sloppy: true }).tags[0].type) + ), + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?', + 'default' + ); - t.deepEqual(stringify(_formatType(function (str) { - return str.toUpperCase(); - }, parse('@param {Foo} a', { - sloppy: true - }).tags[0].type)), '[Foo](FOO)', 'with custom linker'); + t.deepEqual( + stringify( + _formatType( + function(str) { + return str.toUpperCase(); + }, + parse('@param {Foo} a', { + sloppy: true + }).tags[0].type + ) + ), + '[Foo](FOO)', + 'with custom linker' + ); t.deepEqual(stringify(formatType()), 'any', 'empty case'); - t.throws(function () { + t.throws(function() { formatType({}); }); diff --git a/test/lib/filter_access.js b/test/lib/filter_access.js index 55a8f500d..ccab5b99e 100644 --- a/test/lib/filter_access.js +++ b/test/lib/filter_access.js @@ -3,80 +3,140 @@ var test = require('tap').test, filterAccess = require('../../lib/filter_access'); -test('filterAccess ignore', function (t) { - t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{ - access: 'public', - ignore: true - }]), []); +test('filterAccess ignore', function(t) { + t.deepEqual( + filterAccess( + ['public', 'protected', 'undefined'], + [ + { + access: 'public', + ignore: true + } + ] + ), + [] + ); t.end(); }); -test('filterAccess public, protected, undefined, no private', function (t) { - t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{ - access: 'public' - }, { - access: 'protected' - }, { - foo: 2 - }, { - access: 'private' - }]), [{ - access: 'public' - }, { - access: 'protected' - }, { - foo: 2 - }]); +test('filterAccess public, protected, undefined, no private', function(t) { + t.deepEqual( + filterAccess( + ['public', 'protected', 'undefined'], + [ + { + access: 'public' + }, + { + access: 'protected' + }, + { + foo: 2 + }, + { + access: 'private' + } + ] + ), + [ + { + access: 'public' + }, + { + access: 'protected' + }, + { + foo: 2 + } + ] + ); t.end(); }); -test('filterAccess explicit public', function (t) { - t.deepEqual(filterAccess(['public'], [ - { access: 'public' }, - { access: 'protected' }, - { foo: 2 }, - { access: 'private' }]), - [{ - access: 'public' - }]); +test('filterAccess explicit public', function(t) { + t.deepEqual( + filterAccess( + ['public'], + [ + { access: 'public' }, + { access: 'protected' }, + { foo: 2 }, + { access: 'private' } + ] + ), + [ + { + access: 'public' + } + ] + ); t.end(); }); -test('filterAccess override', function (t) { - t.deepEqual(filterAccess(['private'], [{ - access: 'private' - }]), [{ - access: 'private' - }]); +test('filterAccess override', function(t) { + t.deepEqual( + filterAccess( + ['private'], + [ + { + access: 'private' + } + ] + ), + [ + { + access: 'private' + } + ] + ); t.end(); }); -test('filterAccess nesting', function (t) { - t.deepEqual(filterAccess(['public', 'protected', 'undefined'], [{ - access: 'public', - members: { - static: [{ - access: 'public' - }, { - access: 'private' - }] - } - }, { - access: 'private', - members: { - static: [{ - access: 'public' - }, { - access: 'private' - }] - } - }]), [{ - access: 'public', - members: { - static: [{ - access: 'public' - }] - } - }]); +test('filterAccess nesting', function(t) { + t.deepEqual( + filterAccess( + ['public', 'protected', 'undefined'], + [ + { + access: 'public', + members: { + static: [ + { + access: 'public' + }, + { + access: 'private' + } + ] + } + }, + { + access: 'private', + members: { + static: [ + { + access: 'public' + }, + { + access: 'private' + } + ] + } + } + ] + ), + [ + { + access: 'public', + members: { + static: [ + { + access: 'public' + } + ] + } + } + ] + ); t.end(); }); diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js index df0505fd2..5b36b7fc1 100644 --- a/test/lib/flow_doctrine.js +++ b/test/lib/flow_doctrine.js @@ -6,16 +6,17 @@ var flowDoctrine = require('../../lib/flow_doctrine.js'), test = require('tap').test; function toComment(fn, filename) { - return parse({ - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {})[0]; + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; } - -test('flowDoctrine', function (t) { - - var types = FLOW_TYPES.filter(function (type) { +test('flowDoctrine', function(t) { + var types = FLOW_TYPES.filter(function(type) { return type.match(/\wTypeAnnotation$/); }); @@ -29,50 +30,68 @@ test('flowDoctrine', function (t) { return flowDoctrine(annotation); } - t.deepEqual(toDoctrineType('number'), + t.deepEqual( + toDoctrineType('number'), { type: 'NameExpression', name: 'number' - }, 'number'); + }, + 'number' + ); - t.deepEqual(toDoctrineType('string'), + t.deepEqual( + toDoctrineType('string'), { type: 'NameExpression', name: 'string' - }, 'string'); + }, + 'string' + ); - t.deepEqual(toDoctrineType('any'), + t.deepEqual( + toDoctrineType('any'), { type: 'AllLiteral' - }, 'all'); + }, + 'all' + ); - t.deepEqual(toDoctrineType('(y:Foo) => Bar'), + t.deepEqual( + toDoctrineType('(y:Foo) => Bar'), { type: 'FunctionType', - params: [{ - type: 'ParameterType', - name: 'y', - expression: { - type: 'NameExpression', - name: 'Foo' + params: [ + { + type: 'ParameterType', + name: 'y', + expression: { + type: 'NameExpression', + name: 'Foo' + } } - }], + ], result: { type: 'NameExpression', name: 'Bar' } - }, 'function type'); + }, + 'function type' + ); - t.deepEqual(toDoctrineType('?number'), + t.deepEqual( + toDoctrineType('?number'), { type: 'NullableType', expression: { type: 'NameExpression', name: 'number' } - }, 'nullable'); + }, + 'nullable' + ); - t.deepEqual(toDoctrineType('number | string'), + t.deepEqual( + toDoctrineType('number | string'), { type: 'UnionType', elements: [ @@ -85,71 +104,101 @@ test('flowDoctrine', function (t) { name: 'string' } ] - }, 'union'); + }, + 'union' + ); - t.deepEqual(toDoctrineType('Object'), + t.deepEqual( + toDoctrineType('Object'), { type: 'NameExpression', name: 'Object' - }, 'object'); + }, + 'object' + ); - t.deepEqual(toDoctrineType('{ a: 1 }'), + t.deepEqual( + toDoctrineType('{ a: 1 }'), { type: 'RecordType', - fields: [{ - type: 'FieldType', - key: 'a', - value: { - type: 'NumericLiteralType', - value: 1 + fields: [ + { + type: 'FieldType', + key: 'a', + value: { + type: 'NumericLiteralType', + value: 1 + } } - }] - }, 'object with properties'); + ] + }, + 'object with properties' + ); - t.deepEqual(toDoctrineType('mixed'), + t.deepEqual( + toDoctrineType('mixed'), { type: 'AllLiteral' - }, 'alias mixed to any for now'); + }, + 'alias mixed to any for now' + ); - t.deepEqual(toDoctrineType('Array'), + t.deepEqual( + toDoctrineType('Array'), { type: 'NameExpression', name: 'Array' - }, 'array'); + }, + 'array' + ); - t.deepEqual(toDoctrineType('Array'), + t.deepEqual( + toDoctrineType('Array'), { type: 'TypeApplication', expression: { type: 'NameExpression', name: 'Array' }, - applications: [{ - type: 'NameExpression', - name: 'number' - }] - }, 'Array'); + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }, + 'Array' + ); - t.deepEqual(toDoctrineType('number[]'), + t.deepEqual( + toDoctrineType('number[]'), { type: 'TypeApplication', expression: { type: 'NameExpression', name: 'Array' }, - applications: [{ - type: 'NameExpression', - name: 'number' - }] - }, 'number[]'); + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }, + 'number[]' + ); - t.deepEqual(toDoctrineType('[]'), + t.deepEqual( + toDoctrineType('[]'), { type: 'ArrayType', elements: [] - }, '[]'); + }, + '[]' + ); - t.deepEqual(toDoctrineType('[number]'), + t.deepEqual( + toDoctrineType('[number]'), { type: 'ArrayType', elements: [ @@ -158,9 +207,12 @@ test('flowDoctrine', function (t) { name: 'number' } ] - }, '[number]'); + }, + '[number]' + ); - t.deepEqual(toDoctrineType('[string, boolean]'), + t.deepEqual( + toDoctrineType('[string, boolean]'), { type: 'ArrayType', elements: [ @@ -173,74 +225,107 @@ test('flowDoctrine', function (t) { name: 'boolean' } ] - }, '[string, boolean]'); + }, + '[string, boolean]' + ); - t.deepEqual(toDoctrineType('boolean'), + t.deepEqual( + toDoctrineType('boolean'), { type: 'NameExpression', name: 'boolean' - }, 'boolean'); + }, + 'boolean' + ); - t.deepEqual(toDoctrineType('any => any'), + t.deepEqual( + toDoctrineType('any => any'), { type: 'FunctionType', params: [ { - expression: {type: 'AllLiteral'}, + expression: { type: 'AllLiteral' }, name: '', type: 'ParameterType' } ], - result: {type: 'AllLiteral'}, - }, ''); + result: { type: 'AllLiteral' } + }, + '' + ); - t.deepEqual(toDoctrineType('undefined'), + t.deepEqual( + toDoctrineType('undefined'), { type: 'NameExpression', name: 'undefined' - }, 'undefined'); + }, + 'undefined' + ); - t.deepEqual(toDoctrineType('"value"'), + t.deepEqual( + toDoctrineType('"value"'), { type: 'StringLiteralType', value: 'value' - }, 'StringLiteralType'); + }, + 'StringLiteralType' + ); - t.deepEqual(toDoctrineType('1'), + t.deepEqual( + toDoctrineType('1'), { type: 'NumericLiteralType', value: '1' - }, 'NumericLiteralType'); + }, + 'NumericLiteralType' + ); - t.deepEqual(toDoctrineType('true'), + t.deepEqual( + toDoctrineType('true'), { type: 'BooleanLiteralType', value: true - }, 'BooleanLiteralType'); + }, + 'BooleanLiteralType' + ); - t.deepEqual(toDoctrineType('false'), + t.deepEqual( + toDoctrineType('false'), { type: 'BooleanLiteralType', value: false - }, 'BooleanLiteralType'); + }, + 'BooleanLiteralType' + ); - t.deepEqual(toDoctrineType('null'), + t.deepEqual( + toDoctrineType('null'), { - type: 'NullLiteral', - }, 'NullLiteral'); + type: 'NullLiteral' + }, + 'NullLiteral' + ); - t.deepEqual(toDoctrineType('void'), + t.deepEqual( + toDoctrineType('void'), { - type: 'VoidLiteral', - }, 'VoidLiteral'); + type: 'VoidLiteral' + }, + 'VoidLiteral' + ); // TODO: remove all these types - t.deepEqual(types, [ - 'IntersectionTypeAnnotation', - 'EmptyTypeAnnotation', - 'ThisTypeAnnotation', - 'TypeofTypeAnnotation' - ], 'Type coverage'); + t.deepEqual( + types, + [ + 'IntersectionTypeAnnotation', + 'EmptyTypeAnnotation', + 'ThisTypeAnnotation', + 'TypeofTypeAnnotation' + ], + 'Type coverage' + ); t.end(); }); diff --git a/test/lib/git/find_git.js b/test/lib/git/find_git.js index beb2dc0cb..9e4578a92 100644 --- a/test/lib/git/find_git.js +++ b/test/lib/git/find_git.js @@ -6,19 +6,18 @@ var test = require('tap').test, path = require('path'), findGit = require('../../../lib/git/find_git'); -test('findGit', function (t) { - +test('findGit', function(t) { mock(mockRepo.master); const root = path.parse(__dirname).root; t.equal( - findGit( - root + path.join('my', 'repository', 'path', 'index.js')), - root + path.join('my', 'repository', 'path', '.git'), 'finds git path'); + findGit(root + path.join('my', 'repository', 'path', 'index.js')), + root + path.join('my', 'repository', 'path', '.git'), + 'finds git path' + ); mock.restore(); t.end(); }); - diff --git a/test/lib/git/mock_repo.js b/test/lib/git/mock_repo.js index 0301d2d8c..5095fb865 100644 --- a/test/lib/git/mock_repo.js +++ b/test/lib/git/mock_repo.js @@ -5,8 +5,8 @@ module.exports = { repository: { path: { '.git': { - 'HEAD': 'ref: refs/heads/master', - 'config': '[remote "origin"]\n' + + HEAD: 'ref: refs/heads/master', + config: '[remote "origin"]\n' + 'url = git@github.com:foo/bar.git\n' + 'fetch = +refs/heads/*:refs/remotes/origin/*', refs: { @@ -25,8 +25,8 @@ module.exports = { repository: { path: { '.git': { - 'HEAD': 'e4cb2ffe677571d0503e659e4e64e01f45639c62', - 'config': '[remote "origin"]\n' + + HEAD: 'e4cb2ffe677571d0503e659e4e64e01f45639c62', + config: '[remote "origin"]\n' + 'url = git@github.com:foo/bar.git\n' + 'fetch = +refs/heads/*:refs/remotes/origin/*' }, @@ -50,8 +50,8 @@ module.exports = { repository: { path: { '.git': { - 'HEAD': 'ref: refs/heads/master', - 'config': '[remote "origin"]\n' + + HEAD: 'ref: refs/heads/master', + config: '[remote "origin"]\n' + 'url = git@github.enterprise.com:foo/bar.git\n' + 'fetch = +refs/heads/*:refs/remotes/origin/*', refs: { diff --git a/test/lib/git/url_prefix.js b/test/lib/git/url_prefix.js index 921efc198..b49f33635 100644 --- a/test/lib/git/url_prefix.js +++ b/test/lib/git/url_prefix.js @@ -6,36 +6,38 @@ var test = require('tap').test, getGithubURLPrefix = require('../../../lib/git/url_prefix'), parsePackedRefs = getGithubURLPrefix.parsePackedRefs; -test('getGithubURLPrefix', function (t) { - +test('getGithubURLPrefix', function(t) { mock(mockRepo.master); t.equal( - getGithubURLPrefix( - '/my/repository/path/'), - 'https://github.com/foo/bar/blob/this_is_the_sha/', - 'finds git path on master branch'); + getGithubURLPrefix('/my/repository/path/'), + 'https://github.com/foo/bar/blob/this_is_the_sha/', + 'finds git path on master branch' + ); mock.restore(); mock(mockRepo.detached); t.equal( - getGithubURLPrefix( - '/my/repository/path/'), - 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/', - 'finds git path with a detached head'); + getGithubURLPrefix('/my/repository/path/'), + 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/', + 'finds git path with a detached head' + ); mock.restore(); t.end(); }); -test('parsePackedRefs', function (t) { +test('parsePackedRefs', function(t) { var input = '# pack-refs with: peeled fully-peeled\n' + '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' + '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types'; - t.equal(parsePackedRefs(input, 'refs/heads/babel-6'), - '4acd658617928bd17ae7364ef2512630d97c007a', 'Finds babel 6 ref'); + t.equal( + parsePackedRefs(input, 'refs/heads/babel-6'), + '4acd658617928bd17ae7364ef2512630d97c007a', + 'Finds babel 6 ref' + ); t.end(); }); diff --git a/test/lib/github.js b/test/lib/github.js index 67bede965..34f362e75 100644 --- a/test/lib/github.js +++ b/test/lib/github.js @@ -10,75 +10,90 @@ var test = require('tap').test, github = require('../../lib/github'); function toComment(fn, filename) { - return parse({ - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {}).map(github); + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ).map(github); } const root = path.parse(__dirname).root; function evaluate(fn) { - return toComment(fn, root + path.join('my', 'repository', 'path', 'index.js')); + return toComment( + fn, + root + path.join('my', 'repository', 'path', 'index.js') + ); } -test('github', function (t) { - +test('github', function(t) { mock(mockRepo.master); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * get one * @returns {number} one */ - function getOne() { - return 1; - } - })[0].context.github, { - path: 'index.js', - url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, 'gets github url'); + function getOne() { + return 1; + } + })[0].context.github, + { + path: 'index.js', + url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }, + 'gets github url' + ); mock.restore(); t.end(); }); -test('malformed repository', function (t) { - +test('malformed repository', function(t) { mock(mockRepo.malformed); - t.equal(evaluate(function () { - /** + t.equal( + evaluate(function() { + /** * get one * @returns {number} one */ - function getOne() { - return 1; - } - })[0].context.github, undefined, 'does not crash'); + function getOne() { + return 1; + } + })[0].context.github, + undefined, + 'does not crash' + ); mock.restore(); t.end(); }); -test('enterprise repository', function (t) { - +test('enterprise repository', function(t) { mock(mockRepo.enterprise); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * get one * @returns {number} one */ - function getOne() { - return 1; - } - })[0].context.github, { - path: 'index.js', - url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, 'gets github enterprise url'); + function getOne() { + return 1; + } + })[0].context.github, + { + path: 'index.js', + url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }, + 'gets github enterprise url' + ); mock.restore(); diff --git a/test/lib/hierarchy.js b/test/lib/hierarchy.js index f17d5ff91..478ad03c1 100644 --- a/test/lib/hierarchy.js +++ b/test/lib/hierarchy.js @@ -5,10 +5,13 @@ var test = require('tap').test, hierarchy = require('../../lib/hierarchy'); function toComments(fn, filename) { - return parse({ - file: filename || 'test.js', - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {}); + return parse( + { + file: filename || 'test.js', + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ); } function evaluate(fn, callback) { @@ -16,35 +19,31 @@ function evaluate(fn, callback) { } function map(arr, prop) { - return arr.map(function (item) { + return arr.map(function(item) { return item[prop]; }); } -test('hierarchy', function (t) { - var comments = evaluate(function () { +test('hierarchy', function(t) { + var comments = evaluate(function() { /** * @name Class * @class */ - /** * @name getFoo * @memberof Class * @instance */ - /** * @name isClass * @memberof Class * @static */ - /** * @name MAGIC_NUMBER * @memberof Class */ - /** * @name event * @memberof Class @@ -66,23 +65,20 @@ test('hierarchy', function (t) { t.end(); }); -test('hierarchy - nesting', function (t) { - var comments = evaluate(function () { +test('hierarchy - nesting', function(t) { + var comments = evaluate(function() { /** * @name Parent * @class */ - /** * @name enum * @memberof Parent */ - /** * @name Parent * @memberof Parent.enum */ - /** * @name Child * @memberof Parent.enum @@ -96,25 +92,31 @@ test('hierarchy - nesting', function (t) { var enumMembers = classMembers.static[0].members; t.deepEqual(map(enumMembers.static, 'name'), ['Parent', 'Child']); - t.deepEqual(map(enumMembers.static[0].path, 'name'), ['Parent', 'enum', 'Parent']); - t.deepEqual(map(enumMembers.static[1].path, 'name'), ['Parent', 'enum', 'Child']); + t.deepEqual(map(enumMembers.static[0].path, 'name'), [ + 'Parent', + 'enum', + 'Parent' + ]); + t.deepEqual(map(enumMembers.static[1].path, 'name'), [ + 'Parent', + 'enum', + 'Child' + ]); t.end(); }); -test('hierarchy - multisignature', function (t) { - var comments = evaluate(function () { +test('hierarchy - multisignature', function(t) { + var comments = evaluate(function() { /** * @name Parent * @class */ - /** * @name foo * @memberof Parent * @instance */ - /** * @name foo * @memberof Parent @@ -126,52 +128,57 @@ test('hierarchy - multisignature', function (t) { t.end(); }); -test('hierarchy - missing memberof', function (t) { - var test = evaluate(function () { +test('hierarchy - missing memberof', function(t) { + var test = evaluate(function() { /** * @name test * @memberof DoesNotExist */ })[0]; - t.deepEqual(test.errors, [{ - message: '@memberof reference to DoesNotExist not found', - commentLineNumber: 2 - }], 'correct error message'); + t.deepEqual( + test.errors, + [ + { + message: '@memberof reference to DoesNotExist not found', + commentLineNumber: 2 + } + ], + 'correct error message' + ); t.end(); }); -test('hierarchy - anonymous', function (t) { - var result = evaluate(function () { +test('hierarchy - anonymous', function(t) { + var result = evaluate(function() { /** Test */ })[0]; - t.deepEqual(result.errors, [{ - message: 'could not determine @name for hierarchy' - }]); + t.deepEqual(result.errors, [ + { + message: 'could not determine @name for hierarchy' + } + ]); t.end(); }); -test('hierarchy - object prototype member names', function (t) { - var comments = evaluate(function () { +test('hierarchy - object prototype member names', function(t) { + var comments = evaluate(function() { /** * @name should * @function */ - /** * @name Assertion * @class * @memberof should */ - /** * @name hasOwnProperty * @memberof should.Assertion * @instance * @function **/ - /** * @name otherMethod * @memberof should.Assertion @@ -180,7 +187,10 @@ test('hierarchy - object prototype member names', function (t) { **/ }); - t.deepEqual(map(comments[0].members.static[0].members.instance, 'name'), [ 'hasOwnProperty', 'otherMethod' ]); + t.deepEqual(map(comments[0].members.static[0].members.instance, 'name'), [ + 'hasOwnProperty', + 'otherMethod' + ]); t.end(); }); diff --git a/test/lib/infer/access.js b/test/lib/infer/access.js index aa5ffd707..21355671c 100644 --- a/test/lib/infer/access.js +++ b/test/lib/infer/access.js @@ -6,35 +6,62 @@ var test = require('tap').test, inferAccess = require('../../../lib/infer/access'); function toComment(fn) { - return parse({ - source: '(' + fn.toString() + ')' - }, {})[0]; + return parse( + { + source: '(' + fn.toString() + ')' + }, + {} + )[0]; } function evaluate(fn, re) { return inferAccess(re)(inferName(toComment(fn))); } -test('inferAccess', function (t) { - t.equal(evaluate(function () { - /** Test */ - function _name() {} - }, '^_').access, 'private'); - - t.equal(evaluate(function () { - /** @private */ - function name() {} - }, '^_').access, 'private'); - - t.equal(evaluate(function () { - /** @public */ - function _name() {} - }, '^_').access, 'public'); - - t.equal(evaluate(function () { - /** Test */ - function name_() {} - }, '_$').access, 'private'); +test('inferAccess', function(t) { + t.equal( + evaluate( + function() { + /** Test */ + function _name() {} + }, + '^_' + ).access, + 'private' + ); + + t.equal( + evaluate( + function() { + /** @private */ + function name() {} + }, + '^_' + ).access, + 'private' + ); + + t.equal( + evaluate( + function() { + /** @public */ + function _name() {} + }, + '^_' + ).access, + 'public' + ); + + t.equal( + evaluate( + function() { + /** Test */ + function name_() {} + }, + '_$' + ).access, + 'private' + ); t.end(); }); diff --git a/test/lib/infer/finders.js b/test/lib/infer/finders.js index f591ffe0d..2bc566414 100644 --- a/test/lib/infer/finders.js +++ b/test/lib/infer/finders.js @@ -5,49 +5,85 @@ var test = require('tap').test, findTarget = require('../../../lib/infer/finders').findTarget; function toComment(fn) { - if (typeof fn == 'function') { fn = '(' + fn.toString() + ')'; } - return parse({ - source: fn - }, {})[0]; + return parse( + { + source: fn + }, + {} + )[0]; } function evaluate(fn, re) { return toComment(fn); } -test('findTarget', function (t) { - t.equal(findTarget(toComment(function () { - /** Test */ - var x = 10; - }).context.ast).type, 'VariableDeclarator', 'variable declarator'); +test('findTarget', function(t) { + t.equal( + findTarget( + toComment(function() { + /** Test */ + var x = 10; + }).context.ast + ).type, + 'VariableDeclarator', + 'variable declarator' + ); - t.equal(findTarget(toComment(function () { - var z = {}; + t.equal( + findTarget( + toComment(function() { + var z = {}; - /** Test */ - z.y = 10; - }).context.ast).type, 'NumericLiteral', 'assigned object value'); + /** Test */ + z.y = 10; + }).context.ast + ).type, + 'NumericLiteral', + 'assigned object value' + ); - t.equal(findTarget(toComment(function () { - var z = { - /** Test */ - y: 10 - }; - }).context.ast).type, 'NumericLiteral', 'object property'); + t.equal( + findTarget( + toComment(function() { + var z = { + /** Test */ + y: 10 + }; + }).context.ast + ).type, + 'NumericLiteral', + 'object property' + ); - t.equal(findTarget(toComment(` + t.equal( + findTarget( + toComment( + ` /** Test */ export var z = 10; - `).context.ast).type, 'VariableDeclarator', 'variable declarator in export'); + ` + ).context.ast + ).type, + 'VariableDeclarator', + 'variable declarator in export' + ); - t.equal(findTarget(toComment(` + t.equal( + findTarget( + toComment( + ` /** Test */ export default 10; - `).context.ast).type, 'NumericLiteral', 'default export'); + ` + ).context.ast + ).type, + 'NumericLiteral', + 'default export' + ); t.end(); }); diff --git a/test/lib/infer/kind.js b/test/lib/infer/kind.js index 6fd11c380..1509ebb99 100644 --- a/test/lib/infer/kind.js +++ b/test/lib/infer/kind.js @@ -5,92 +5,158 @@ var test = require('tap').test, parse = require('../../../lib/parsers/javascript'); function toComment(fn, filename) { - return parse({ - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {})[0]; + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; } -test('inferKind', function (t) { - t.equal(inferKind({ - kind: 'class', - tags: [] - }).kind, 'class', 'explicit'); - - t.equal(inferKind(toComment( - '/**' + - ' * Class' + - ' */' + - 'class C {}')).kind, 'class', 'es6 syntax'); - - t.equal(inferKind(toComment( - '/**' + - ' * Exported class' + - ' */' + - 'export class C {}')).kind, 'class', 'es6 syntax with export'); - - t.equal(inferKind(toComment( - '/**' + - ' * Export default class' + - ' */' + - 'export default class C {}')).kind, 'class', 'es6 syntax with default export'); - - t.equal(inferKind(toComment(function () { - /** function */ - function foo() { } - foo(); - })).kind, 'function', 'inferred function'); - - t.equal(inferKind(toComment(function () { - /** function */ - var foo = function () { }; - foo(); - })).kind, 'function', 'inferred var function'); - - t.equal(inferKind(toComment( - '/** Exported function */' + - 'export function foo() {}')).kind, 'function', 'inferred exported function'); - - t.equal(inferKind(toComment( - '/** Export default function */' + - 'export default function foo() {}')).kind, 'function', 'inferred exported function'); - - t.equal(inferKind(toComment( - 'class Foo { /** set b */ set b(v) { } }' - )).kind, 'member', 'member via set'); - - t.equal(inferKind(toComment( - 'var foo = { /** thing */ b: function(v) { } }' - )).kind, 'function', 'function via set'); - - t.equal(inferKind(toComment( - 'class Foo { /** get b */ get b() { } }' - )).kind, 'member', 'member via get'); - - t.equal(inferKind(toComment( - 'class Foo { /** b */ b(v) { } }' - )).kind, 'function', 'normal function as part of class'); - - t.equal(inferKind(toComment(function () { - /** class */ - function Foo() { } - })).kind, 'class', 'class via uppercase'); - - t.equal(inferKind(toComment(function () { - /** undefined */ - })).kind, undefined, 'undetectable'); - - t.equal(inferKind(toComment( - '/**' + - ' * This is a constant called foo' + - ' */' + - 'const foo = "bar";')).kind, 'constant', 'constant via const'); - - t.equal(inferKind(toComment( - '/**' + - ' * Exported constant' + - ' */' + - 'export const foo = "bar";')).kind, 'constant', 'constant via export const'); +test('inferKind', function(t) { + t.equal( + inferKind({ + kind: 'class', + tags: [] + }).kind, + 'class', + 'explicit' + ); + + t.equal( + inferKind(toComment('/**' + ' * Class' + ' */' + 'class C {}')).kind, + 'class', + 'es6 syntax' + ); + + t.equal( + inferKind( + toComment('/**' + ' * Exported class' + ' */' + 'export class C {}') + ).kind, + 'class', + 'es6 syntax with export' + ); + + t.equal( + inferKind( + toComment( + '/**' + ' * Export default class' + ' */' + 'export default class C {}' + ) + ).kind, + 'class', + 'es6 syntax with default export' + ); + + t.equal( + inferKind( + toComment(function() { + /** function */ + function foo() {} + foo(); + }) + ).kind, + 'function', + 'inferred function' + ); + + t.equal( + inferKind( + toComment(function() { + /** function */ + var foo = function() {}; + foo(); + }) + ).kind, + 'function', + 'inferred var function' + ); + + t.equal( + inferKind( + toComment('/** Exported function */' + 'export function foo() {}') + ).kind, + 'function', + 'inferred exported function' + ); + + t.equal( + inferKind( + toComment( + '/** Export default function */' + 'export default function foo() {}' + ) + ).kind, + 'function', + 'inferred exported function' + ); + + t.equal( + inferKind(toComment('class Foo { /** set b */ set b(v) { } }')).kind, + 'member', + 'member via set' + ); + + t.equal( + inferKind(toComment('var foo = { /** thing */ b: function(v) { } }')).kind, + 'function', + 'function via set' + ); + + t.equal( + inferKind(toComment('class Foo { /** get b */ get b() { } }')).kind, + 'member', + 'member via get' + ); + + t.equal( + inferKind(toComment('class Foo { /** b */ b(v) { } }')).kind, + 'function', + 'normal function as part of class' + ); + + t.equal( + inferKind( + toComment(function() { + /** class */ + function Foo() {} + }) + ).kind, + 'class', + 'class via uppercase' + ); + + t.equal( + inferKind( + toComment(function() { + /** undefined */ + }) + ).kind, + undefined, + 'undetectable' + ); + + t.equal( + inferKind( + toComment( + '/**' + + ' * This is a constant called foo' + + ' */' + + 'const foo = "bar";' + ) + ).kind, + 'constant', + 'constant via const' + ); + + t.equal( + inferKind( + toComment( + '/**' + ' * Exported constant' + ' */' + 'export const foo = "bar";' + ) + ).kind, + 'constant', + 'constant via export const' + ); t.end(); }); diff --git a/test/lib/infer/membership.js b/test/lib/infer/membership.js index bd7d35165..f20750709 100644 --- a/test/lib/infer/membership.js +++ b/test/lib/infer/membership.js @@ -5,19 +5,25 @@ var test = require('tap').test, inferMembership = require('../../../lib/infer/membership')(); function toComment(fn, file) { - return parse({ - file, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {}); + return parse( + { + file, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ); } function pick(obj, props) { - return props.reduce(function (memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, {}); + return props.reduce( + function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, + {} + ); } function evaluate(fn, file) { @@ -27,222 +33,376 @@ function evaluate(fn, file) { function Foo() {} function lend() {} -test('inferMembership - explicit', function (t) { - t.deepEqual(pick(evaluate(function () { - /** +test('inferMembership - explicit', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** * Test * @memberof Bar * @static */ - Foo.bar = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Bar', - scope: 'static' - }, 'explicit, static'); - - t.deepEqual(pick(evaluate(function () { - /** + Foo.bar = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Bar', + scope: 'static' + }, + 'explicit, static' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** * Test * @memberof Bar# */ - Foo.bar = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Bar', - scope: 'instance' - }, 'explicit, instance'); - - t.deepEqual(pick(evaluate(function () { - /** + Foo.bar = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Bar', + scope: 'instance' + }, + 'explicit, instance' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** * Test * @memberof Bar.prototype */ - Foo.bar = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Bar', - scope: 'instance' - }, 'explicit, prototype'); - - t.deepEqual(pick(evaluate(function () { - /** Test */ - Foo.bar = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'static' - }, 'implicit'); - - t.deepEqual(pick(evaluate(function () { - /** Test */ - Foo.prototype.bar = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'instance'); - - t.deepEqual(pick(evaluate(function () { - /** Test */ - Foo.bar.baz = 0; - })[0], ['memberof', 'scope']), { - memberof: 'Foo.bar', - scope: 'static' - }, 'compound'); - - t.deepEqual(pick(evaluate(function () { - /** Test */ - (0).baz = 0; - })[0], ['memberof', 'scope']), { }, 'unknown'); - - t.deepEqual(pick(evaluate(function () { - Foo.bar = { - /** Test */ - baz: 0 - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo.bar', - scope: 'static' - }, 'static object assignment'); - - t.deepEqual(pick(evaluate(function () { - Foo.prototype = { - /** Test */ - bar: 0 - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'instance object assignment'); + Foo.bar = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Bar', + scope: 'instance' + }, + 'explicit, prototype' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** Test */ + Foo.bar = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'static' + }, + 'implicit' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** Test */ + Foo.prototype.bar = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'instance' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** Test */ + Foo.bar.baz = 0; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo.bar', + scope: 'static' + }, + 'compound' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** Test */ + (0).baz = 0; + })[0], + ['memberof', 'scope'] + ), + {}, + 'unknown' + ); + + t.deepEqual( + pick( + evaluate(function() { + Foo.bar = { + /** Test */ + baz: 0 + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo.bar', + scope: 'static' + }, + 'static object assignment' + ); + + t.deepEqual( + pick( + evaluate(function() { + Foo.prototype = { + /** Test */ + bar: 0 + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'instance object assignment' + ); /* eslint object-shorthand: 0 */ - t.deepEqual(pick(evaluate(function () { - Foo.prototype = { - /** + t.deepEqual( + pick( + evaluate(function() { + Foo.prototype = { + /** * Test */ - bar: function () {} - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'instance object assignment, function'); - - t.deepEqual(pick(evaluate(function () { - Foo.prototype = { - /** + bar: function() {} + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'instance object assignment, function' + ); + + t.deepEqual( + pick( + evaluate(function() { + Foo.prototype = { + /** * Test */ - bar() {} - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'instance object assignment, shorthand function'); - - t.deepEqual(pick(evaluate(function () { - var Foo = { - /** Test */ - baz: 0 - }; - return Foo; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'static' - }, 'variable object assignment'); - - t.deepEqual(pick(evaluate(function () { - var Foo = { - /** Test */ - baz: function () {} - }; - return Foo; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'static' - }, 'variable object assignment, function'); - - t.deepEqual(pick(evaluate(function () { - function Foo() { - { - /** */ - this.bar = 0; - } - } - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'constructor function declaration assignment'); - - t.deepEqual(pick(evaluate(function () { - var Foo = function Bar() { - { - /** */ - this.baz = 0; - } - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'constructor function expression assignment'); - - t.deepEqual(pick(evaluate(function () { - class Foo { - constructor() { - { - /** */ - this.bar = 0; + bar() {} + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'instance object assignment, shorthand function' + ); + + t.deepEqual( + pick( + evaluate(function() { + var Foo = { + /** Test */ + baz: 0 + }; + return Foo; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'static' + }, + 'variable object assignment' + ); + + t.deepEqual( + pick( + evaluate(function() { + var Foo = { + /** Test */ + baz: function() {} + }; + return Foo; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'static' + }, + 'variable object assignment, function' + ); + + t.deepEqual( + pick( + evaluate(function() { + function Foo() { + { + /** */ + this.bar = 0; + } } - } + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'constructor function declaration assignment' + ); + + t.deepEqual( + pick( + evaluate(function() { + var Foo = function Bar() { + { + /** */ + this.baz = 0; + } + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'constructor function expression assignment' + ); + + t.deepEqual( + pick( + evaluate(function() { + class Foo { + constructor() { + { + /** */ + this.bar = 0; + } + } + } + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'constructor assignment' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** Test */ + module.exports = function() {}; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'module', + scope: 'static' + }, + 'simple' + ); + + t.deepEqual( + pick( + evaluate(function() { + lend( + /** @lends Foo */ { + /** Test */ + bar: 0 + } + ); + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'static' + }, + 'lends, static' + ); + + t.deepEqual( + pick( + evaluate(function() { + lend( + /** @lends Foo */ { + /** Test */ + bar: function() {} + } + ); + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'static' + }, + 'inferMembership - lends, static, function' + ); + + t.deepEqual( + pick( + evaluate(function() { + lend( + /** @lends Foo.prototype */ { + /** Test */ + bar: 0 + } + ); + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' } - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'constructor assignment'); - - t.deepEqual(pick(evaluate(function () { - /** Test */ - module.exports = function () {}; - })[0], ['memberof', 'scope']), { - memberof: 'module', - scope: 'static' - }, 'simple'); - - t.deepEqual(pick(evaluate(function () { - lend(/** @lends Foo */{ - /** Test */ - bar: 0 - }); - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'static' - }, 'lends, static'); - - t.deepEqual(pick(evaluate(function () { - lend(/** @lends Foo */{ - /** Test */ - bar: function () {} - }); - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'static' - }, 'inferMembership - lends, static, function'); - - t.deepEqual(pick(evaluate(function () { - lend(/** @lends Foo.prototype */{ - /** Test */ - bar: 0 - }); - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }); - - t.deepEqual(pick(evaluate(function () { - lend(/** @lends Foo.prototype */{ - /** Test */ - bar: function () {} - }); - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }, 'inferMembership - lends, instance, function'); + ); + + t.deepEqual( + pick( + evaluate(function() { + lend( + /** @lends Foo.prototype */ { + /** Test */ + bar: function() {} + } + ); + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + }, + 'inferMembership - lends, instance, function' + ); // t.deepEqual(pick(evaluate(function () { // /** Foo */ @@ -258,231 +418,310 @@ test('inferMembership - explicit', function (t) { // scope: 'static' // }, 'inferMembership - revealing, static, function'); - t.equal(evaluate(function () { - lend(/** @lends Foo */{}); - /** Test */ - })[0].memberof, undefined, 'inferMembership - lends applies only to following object'); + t.equal( + evaluate(function() { + lend(/** @lends Foo */ {}); + /** Test */ + })[0].memberof, + undefined, + 'inferMembership - lends applies only to following object' + ); t.end(); }); -test('inferMembership - exports', function (t) { - t.equal(evaluate(function () { - /** @module mod */ - /** foo */ - exports.foo = 1; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** @module mod */ - /** foo */ - exports.foo = function () {}; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** @module mod */ - /** bar */ - exports.foo.bar = 1; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - exports.foo = { - /** bar */ - bar: 1 - }; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - exports.foo = { +test('inferMembership - exports', function(t) { + t.equal( + evaluate(function() { + /** @module mod */ + /** foo */ + exports.foo = 1; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + /** foo */ + exports.foo = function() {}; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** @module mod */ /** bar */ - bar() {} - }; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - /** bar */ - exports.foo.prototype.bar = function () {}; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - exports.foo.prototype = { + exports.foo.bar = 1; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + exports.foo = { + /** bar */ + bar: 1 + }; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + exports.foo = { + /** bar */ + bar() {} + }; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ /** bar */ - bar() {} - }; - })[1].memberof, 'mod.foo'); + exports.foo.prototype.bar = function() {}; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + exports.foo.prototype = { + /** bar */ + bar() {} + }; + })[1].memberof, + 'mod.foo' + ); t.end(); }); -test('inferMembership - module.exports', function (t) { - t.equal(evaluate(function () { - /** @module mod */ - /** foo */ - module.exports.foo = 1; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** @module mod */ - /** foo */ - module.exports.foo = function () {}; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** @module mod */ - /** bar */ - module.exports.foo.bar = 1; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - module.exports.foo = { - /** bar */ - bar: 1 - }; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - module.exports.foo = { +test('inferMembership - module.exports', function(t) { + t.equal( + evaluate(function() { + /** @module mod */ + /** foo */ + module.exports.foo = 1; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + /** foo */ + module.exports.foo = function() {}; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** @module mod */ /** bar */ - bar() {} - }; - })[1].memberof, 'mod.foo'); - - t.equal(evaluate(function () { - /** @module mod */ - /** bar */ - module.exports.prototype.bar = function () {}; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** @module mod */ - module.exports.prototype = { + module.exports.foo.bar = 1; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + module.exports.foo = { + /** bar */ + bar: 1 + }; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + module.exports.foo = { + /** bar */ + bar() {} + }; + })[1].memberof, + 'mod.foo' + ); + + t.equal( + evaluate(function() { + /** @module mod */ /** bar */ - bar() {} - }; - })[1].memberof, 'mod'); - - t.equal(evaluate(function () { - /** + module.exports.prototype.bar = function() {}; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** @module mod */ + module.exports.prototype = { + /** bar */ + bar() {} + }; + })[1].memberof, + 'mod' + ); + + t.equal( + evaluate(function() { + /** * @module mod * @name exports */ - module.exports = 1; - })[0].memberof, undefined); + module.exports = 1; + })[0].memberof, + undefined + ); - t.equal(evaluate(function () { - /** + t.equal( + evaluate(function() { + /** * @module mod * @name exports */ - module.exports = function () {}; - })[0].memberof, undefined); - - t.equal(evaluate(function () { - /** @module mod */ - module.exports = { - /** foo */ - foo: 1 - }; - })[1].memberof, 'mod'); + module.exports = function() {}; + })[0].memberof, + undefined + ); + + t.equal( + evaluate(function() { + /** @module mod */ + module.exports = { + /** foo */ + foo: 1 + }; + })[1].memberof, + 'mod' + ); t.end(); }); -test('inferMembership - not module exports', function (t) { - var result = evaluate(function () { - /** +test('inferMembership - not module exports', function(t) { + var result = evaluate( + function() { + /** * @module mod */ - /** Test */ - global.module.exports.foo = 1; - }, '/path/mod.js'); + /** Test */ + global.module.exports.foo = 1; + }, + '/path/mod.js' + ); t.equal(result.length, 2); t.notEqual(result[0].memberof, 'mod'); t.end(); }); -test('inferMembership - anonymous @module', function (t) { - var result = evaluate(function () { - /** +test('inferMembership - anonymous @module', function(t) { + var result = evaluate( + function() { + /** * @module */ - /** Test */ - exports.foo = 1; - }, '/path/mod.js'); + /** Test */ + exports.foo = 1; + }, + '/path/mod.js' + ); t.equal(result.length, 2); t.equal(result[1].memberof, 'mod'); t.end(); }); -test('inferMembership - no @module', function (t) { - var result = evaluate(function () { - /** Test */ - exports.foo = 1; - }, '/path/mod.js'); +test('inferMembership - no @module', function(t) { + var result = evaluate( + function() { + /** Test */ + exports.foo = 1; + }, + '/path/mod.js' + ); t.equal(result.length, 1); t.equal(result[0].memberof, 'mod'); t.end(); }); -test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function (t) { - t.deepEqual(pick(evaluate(function () { - Foo.prototype = { - /** Test */ - bar() { - lend(); - lend(); - } - }; - })[0], ['memberof', 'scope']), { - memberof: 'Foo', - scope: 'instance' - }); +test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function(t) { + t.deepEqual( + pick( + evaluate(function() { + Foo.prototype = { + /** Test */ + bar() { + lend(); + lend(); + } + }; + })[0], + ['memberof', 'scope'] + ), + { + memberof: 'Foo', + scope: 'instance' + } + ); t.end(); }); -test('inferMembership - export', function (t) { - t.deepEqual(pick(evaluate( - 'export default class {' + - ' /** */' + - ' method() {}' + - '}', - 'test-file' - )[0], ['memberof', 'scope']), { - memberof: 'test-file', - scope: 'instance' - }); - - t.deepEqual(pick(evaluate( - 'export default class C {' + - ' /** */' + - ' method() {}' + - '}', - 'test-file' - )[0], ['memberof', 'scope']), { - memberof: 'C', - scope: 'instance' - }); - - t.deepEqual(pick(evaluate( - 'export class C {' + - ' /** */' + - ' method() {}' + - '}', - 'test-file' - )[0], ['memberof', 'scope']), { - memberof: 'C', - scope: 'instance' - }); +test('inferMembership - export', function(t) { + t.deepEqual( + pick( + evaluate( + 'export default class {' + ' /** */' + ' method() {}' + '}', + 'test-file' + )[0], + ['memberof', 'scope'] + ), + { + memberof: 'test-file', + scope: 'instance' + } + ); + + t.deepEqual( + pick( + evaluate( + 'export default class C {' + ' /** */' + ' method() {}' + '}', + 'test-file' + )[0], + ['memberof', 'scope'] + ), + { + memberof: 'C', + scope: 'instance' + } + ); + + t.deepEqual( + pick( + evaluate( + 'export class C {' + ' /** */' + ' method() {}' + '}', + 'test-file' + )[0], + ['memberof', 'scope'] + ), + { + memberof: 'C', + scope: 'instance' + } + ); t.end(); }); diff --git a/test/lib/infer/name.js b/test/lib/infer/name.js index 084a3b980..eb1851c29 100644 --- a/test/lib/infer/name.js +++ b/test/lib/infer/name.js @@ -5,141 +5,241 @@ var test = require('tap').test, inferName = require('../../../lib/infer/name'); function toComment(fn, file) { - return parse({ - file, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {})[0]; + return parse( + { + file, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; } function evaluate(fn, file) { return inferName(toComment(fn, file)); } -test('inferName', function (t) { - t.equal(evaluate(function () { - // ExpressionStatement (comment attached here) - // AssignmentExpression - // MemberExpression - // Identifier - /** Test */ - exports.name = test; - }).name, 'name', 'expression statement'); - - t.equal(evaluate(function () { - // ExpressionStatement - // AssignmentExpression - // MemberExpression (comment attached here) - // FunctionExpression - /** Test */ - exports.name = function () {}; - }).name, 'name', 'expression statement, function'); - - t.equal(evaluate(function () { - exports = { - // Property (comment attached here) - // Identifier - // FunctionExpression +test('inferName', function(t) { + t.equal( + evaluate(function() { + // ExpressionStatement (comment attached here) + // AssignmentExpression + // MemberExpression + // Identifier /** Test */ - name: test - }; - }).name, 'name', 'property'); - - t.equal(evaluate(function () { - exports = { - // Property - // Identifier (comment attached here) - // FunctionExpression + exports.name = test; + }).name, + 'name', + 'expression statement' + ); + + t.equal( + evaluate(function() { + // ExpressionStatement + // AssignmentExpression + // MemberExpression (comment attached here) + // FunctionExpression /** Test */ - name() {} - }; - }).name, 'name', 'property, function'); - - t.equal(evaluate(function () { - /** Test */ - function name() {} - }).name, 'name', 'function declaration'); - - t.equal(evaluate(function () { - /** Test */ - var name = function () {}; - }).name, 'name', 'anonymous function expression'); - - t.equal(evaluate(function () { - /** Test */ - var name = function name2() {}; - }).name, 'name', 'named function expression'); - - t.equal(evaluate(function () { - /** @name explicitName */ - function implicitName() {} - }).name, 'explicitName', 'explicit name'); - - t.equal(evaluate(function () { - /** @alias explicitAlias */ - function implicitName() {} - }).name, 'explicitAlias', 'explicit alias'); - - t.equal(evaluate(function () { - /** @class ExplicitClass */ - function ImplicitClass() {} - }).name, 'ExplicitClass', 'explicit class'); - - t.equal(evaluate(function () { - /** @class */ - function ImplicitClass() {} - }).name, 'ImplicitClass', 'anonymous class'); - - t.equal(evaluate(function () { - /** @event explicitEvent */ - function implicitName() {} - }).name, 'explicitEvent', 'explicitEvent'); - - t.equal(evaluate(function () { - /** @typedef {Object} ExplicitTypedef */ - function implicitName() {} - }).name, 'ExplicitTypedef', 'ExplicitTypedef'); - - t.equal(evaluate(function () { - /** @callback explicitCallback */ - function implicitName() {} - }).name, 'explicitCallback', 'explicitCallback'); - - t.equal(evaluate(function () { - /** @module explicitModule */ - function implicitName() {} - }).name, 'explicitModule'); - - t.equal(evaluate(function () { - /** @module {Function} explicitModule */ - function implicitName() {} - }).name, 'explicitModule'); - - t.equal(evaluate(function () { - /** @module */ - function implicitName() {} - }, '/path/inferred-from-file.js').name, 'inferred-from-file'); - - t.equal(evaluate(function () { - /** @module */ - }, '/path/inferred-from-file.js').name, 'inferred-from-file'); - - t.equal(evaluate('/** Test */ export function exported() {}').name, 'exported'); - - t.equal(evaluate('/** Test */ export default function() {}', - '/path/inferred-from-file.js').name, 'inferred-from-file'); - - t.equal(evaluate('/** Test */ export default function exported() {}', - '/path/inferred-from-file.js').name, 'exported'); + exports.name = function() {}; + }).name, + 'name', + 'expression statement, function' + ); + + t.equal( + evaluate(function() { + exports = { + // Property (comment attached here) + // Identifier + // FunctionExpression + /** Test */ + name: test + }; + }).name, + 'name', + 'property' + ); + + t.equal( + evaluate(function() { + exports = { + // Property + // Identifier (comment attached here) + // FunctionExpression + /** Test */ + name() {} + }; + }).name, + 'name', + 'property, function' + ); + + t.equal( + evaluate(function() { + /** Test */ + function name() {} + }).name, + 'name', + 'function declaration' + ); + + t.equal( + evaluate(function() { + /** Test */ + var name = function() {}; + }).name, + 'name', + 'anonymous function expression' + ); + + t.equal( + evaluate(function() { + /** Test */ + var name = function name2() {}; + }).name, + 'name', + 'named function expression' + ); + + t.equal( + evaluate(function() { + /** @name explicitName */ + function implicitName() {} + }).name, + 'explicitName', + 'explicit name' + ); + + t.equal( + evaluate(function() { + /** @alias explicitAlias */ + function implicitName() {} + }).name, + 'explicitAlias', + 'explicit alias' + ); + + t.equal( + evaluate(function() { + /** @class ExplicitClass */ + function ImplicitClass() {} + }).name, + 'ExplicitClass', + 'explicit class' + ); + + t.equal( + evaluate(function() { + /** @class */ + function ImplicitClass() {} + }).name, + 'ImplicitClass', + 'anonymous class' + ); + + t.equal( + evaluate(function() { + /** @event explicitEvent */ + function implicitName() {} + }).name, + 'explicitEvent', + 'explicitEvent' + ); + + t.equal( + evaluate(function() { + /** @typedef {Object} ExplicitTypedef */ + function implicitName() {} + }).name, + 'ExplicitTypedef', + 'ExplicitTypedef' + ); + + t.equal( + evaluate(function() { + /** @callback explicitCallback */ + function implicitName() {} + }).name, + 'explicitCallback', + 'explicitCallback' + ); + + t.equal( + evaluate(function() { + /** @module explicitModule */ + function implicitName() {} + }).name, + 'explicitModule' + ); + + t.equal( + evaluate(function() { + /** @module {Function} explicitModule */ + function implicitName() {} + }).name, + 'explicitModule' + ); + + t.equal( + evaluate( + function() { + /** @module */ + function implicitName() {} + }, + '/path/inferred-from-file.js' + ).name, + 'inferred-from-file' + ); + + t.equal( + evaluate( + function() { + /** @module */ + }, + '/path/inferred-from-file.js' + ).name, + 'inferred-from-file' + ); + + t.equal( + evaluate('/** Test */ export function exported() {}').name, + 'exported' + ); + + t.equal( + evaluate( + '/** Test */ export default function() {}', + '/path/inferred-from-file.js' + ).name, + 'inferred-from-file' + ); + + t.equal( + evaluate( + '/** Test */ export default function exported() {}', + '/path/inferred-from-file.js' + ).name, + 'exported' + ); t.equal(evaluate('/** Test */ export var life = 42;').name, 'life'); t.equal(evaluate('/** Test */ export class Wizard {}').name, 'Wizard'); - t.equal(evaluate('/** Test */ export default class Warlock {}', - '/path/inferred-from-file.js').name, 'Warlock'); - - t.equal(evaluate('/** Test */ export default class {}', - '/path/inferred-from-file.js').name, 'inferred-from-file'); + t.equal( + evaluate( + '/** Test */ export default class Warlock {}', + '/path/inferred-from-file.js' + ).name, + 'Warlock' + ); + + t.equal( + evaluate( + '/** Test */ export default class {}', + '/path/inferred-from-file.js' + ).name, + 'inferred-from-file' + ); t.end(); }); diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js index b320847ab..628f3b71a 100644 --- a/test/lib/infer/params.js +++ b/test/lib/infer/params.js @@ -5,43 +5,57 @@ var test = require('tap').test, inferParams = require('../../../lib/infer/params'); function toComment(fn, file) { - return parse({ - file, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {})[0]; + return parse( + { + file, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; } function evaluate(fn, file) { return inferParams(toComment(fn, file)); } -test('inferParams', function (t) { - t.deepEqual(evaluate(function () { - /** Test */ - function f(x) {} - }).params, [{lineNumber: 3, name: 'x', title: 'param'}]); - - t.deepEqual(evaluate(function () { - /** Test */ - var f = function (x) {}; - }).params, [{lineNumber: 3, name: 'x', title: 'param'}]); - - t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params, - [{lineNumber: 1, name: 'x', title: 'param'}]); - - t.deepEqual(evaluate(function () { - var x = 1, - g = function (y) {}, +test('inferParams', function(t) { + t.deepEqual( + evaluate(function() { /** Test */ - f = function (x) {}; - }).params, [{lineNumber: 5, name: 'x', title: 'param'}]); + function f(x) {} + }).params, + [{ lineNumber: 3, name: 'x', title: 'param' }] + ); - - t.deepEqual(evaluate('/** Test */ export function f(x) {}').params, - [{lineNumber: 1, name: 'x', title: 'param'}]); - - t.deepEqual(evaluate('/** Test */ export default function f(x) {}').params, - [{lineNumber: 1, name: 'x', title: 'param'}]); + t.deepEqual( + evaluate(function() { + /** Test */ + var f = function(x) {}; + }).params, + [{ lineNumber: 3, name: 'x', title: 'param' }] + ); + + t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params, [ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + t.deepEqual( + evaluate(function() { + var x = 1, + g = function(y) {}, + /** Test */ + f = function(x) {}; + }).params, + [{ lineNumber: 5, name: 'x', title: 'param' }] + ); + + t.deepEqual(evaluate('/** Test */ export function f(x) {}').params, [ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + t.deepEqual(evaluate('/** Test */ export default function f(x) {}').params, [ + { lineNumber: 1, name: 'x', title: 'param' } + ]); t.end(); }); diff --git a/test/lib/infer/type.js b/test/lib/infer/type.js index 387ddc0c1..0a72e4e1d 100644 --- a/test/lib/infer/type.js +++ b/test/lib/infer/type.js @@ -6,34 +6,30 @@ var test = require('tap').test, inferType = require('../../../lib/infer/type'); function toComment(code) { - return parse({ - source: code - }, {})[0]; + return parse( + { + source: code + }, + {} + )[0]; } function evaluate(code) { return inferType(inferKind(toComment(code))); } -test('inferType', function (t) { - t.deepEqual(evaluate( - '/** @typedef {T} V */' - ).type, { +test('inferType', function(t) { + t.deepEqual(evaluate('/** @typedef {T} V */').type, { name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'type V = T' - ).type, { + t.deepEqual(evaluate('/** */' + 'type V = T').type, { name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** @typedef {Array} V */' - ).type, { + t.deepEqual(evaluate('/** @typedef {Array} V */').type, { applications: [ { name: 'T', @@ -47,10 +43,7 @@ test('inferType', function (t) { type: 'TypeApplication' }); - t.deepEqual(evaluate( - '/** */' + - 'type V = Array' - ).type, { + t.deepEqual(evaluate('/** */' + 'type V = Array').type, { applications: [ { name: 'T', @@ -64,69 +57,42 @@ test('inferType', function (t) { type: 'TypeApplication' }); - t.deepEqual(evaluate( - '/** */' + - 'var x: number' - ).type, { + t.deepEqual(evaluate('/** */' + 'var x: number').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'let x: number' - ).type, { + t.deepEqual(evaluate('/** */' + 'let x: number').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'const x: number = 42;' - ).type, { + t.deepEqual(evaluate('/** */' + 'const x: number = 42;').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - 'let x,' + - '/** */' + - 'y: number' - ).type, { + t.deepEqual(evaluate('let x,' + '/** */' + 'y: number').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - 'class C {' + - '/** */' + - 'x: number;' + - '}' - ).type, { + t.deepEqual(evaluate('class C {' + '/** */' + 'x: number;' + '}').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'const x = 42;' - ).type, { + t.deepEqual(evaluate('/** */' + 'const x = 42;').type, { name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'const x = "abc";' - ).type, { + t.deepEqual(evaluate('/** */' + 'const x = "abc";').type, { name: 'string', type: 'NameExpression' }); - t.deepEqual(evaluate( - '/** */' + - 'const x = true;' - ).type, { + t.deepEqual(evaluate('/** */' + 'const x = true;').type, { name: 'boolean', type: 'NameExpression' }); diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js index b9271f490..e770cc75d 100644 --- a/test/lib/input/shallow.js +++ b/test/lib/input/shallow.js @@ -4,55 +4,55 @@ var test = require('tap').test, path = require('path'), shallow = require('../../../lib/input/shallow'); -test('shallow deps', function (t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], {}).then(deps => { +test('shallow deps', function(t) { + shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], { + }).then(deps => { t.equal(deps.length, 1); t.ok(deps[0], 'has path'); t.end(); }); }); -test('shallow deps multi', function (t) { - shallow([ - path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), - path.resolve(path.join(__dirname, '../../fixture/es6.output.json')) - ], {}).then(deps => { +test('shallow deps multi', function(t) { + shallow( + [ + path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), + path.resolve(path.join(__dirname, '../../fixture/es6.output.json')) + ], + {} + ).then(deps => { t.equal(deps.length, 2); t.ok(deps[0], 'has path'); t.end(); }); }); -test('shallow deps directory', function (t) { - shallow([ - path.resolve(path.join(__dirname, '../../fixture/html')) - ], {}).then(deps => { - t.equal(deps.length, 1); - t.ok(deps[0].file.match(/input.js/), 'is the input file'); - t.end(); - }).catch(err => { - t.fail(err); - t.end(); - }); +test('shallow deps directory', function(t) { + shallow([path.resolve(path.join(__dirname, '../../fixture/html'))], {}) + .then(deps => { + t.equal(deps.length, 1); + t.ok(deps[0].file.match(/input.js/), 'is the input file'); + t.end(); + }) + .catch(err => { + t.fail(err); + t.end(); + }); }); -test('throws on non-string or object input', function (t) { - shallow([ - true - ], {}).catch(err => { +test('throws on non-string or object input', function(t) { + shallow([true], {}).catch(err => { t.equal(err.message, 'Indexes should be either strings or objects'); t.end(); }); }); -test('shallow deps literal', function (t) { +test('shallow deps literal', function(t) { var obj = { file: 'foo.js', source: '//bar' }; - shallow([ - obj - ], {}).then(deps => { + shallow([obj], {}).then(deps => { t.equal(deps[0], obj); t.end(); }); diff --git a/test/lib/lint.js b/test/lib/lint.js index c1464e6d3..f64514ebd 100644 --- a/test/lib/lint.js +++ b/test/lib/lint.js @@ -6,47 +6,65 @@ var test = require('tap').test, formatLint = require('../../lib/lint').formatLint; function toComment(fn, filename) { - return parse({ - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {})[0]; + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; } function evaluate(fn) { return lintComments(toComment(fn, 'input.js')); } -test('lintComments', function (t) { - t.deepEqual(evaluate(function () { - /** +test('lintComments', function(t) { + t.deepEqual( + evaluate(function() { + /** * @param {foo */ - }).errors, [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' } - ], 'doctrine error'); + }).errors, + [ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ], + 'doctrine error' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @param {String} foo * @param {array} bar */ - }).errors, [ - { commentLineNumber: 1, message: 'type String found, string is standard' }, - { commentLineNumber: 2, message: 'type array found, Array is standard' } - ], 'non-canonical'); + }).errors, + [ + { + commentLineNumber: 1, + message: 'type String found, string is standard' + }, + { commentLineNumber: 2, message: 'type array found, Array is standard' } + ], + 'non-canonical' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @param {string} foo */ - }).errors, [], 'no errors'); + }).errors, + [], + 'no errors' + ); t.end(); }); -test('formatLint', function (t) { - var comment = evaluate(function () { +test('formatLint', function(t) { + var comment = evaluate(function() { // 2 // 3 /** 4 diff --git a/test/lib/merge_config.js b/test/lib/merge_config.js index bab68574b..4dd14ae54 100644 --- a/test/lib/merge_config.js +++ b/test/lib/merge_config.js @@ -5,65 +5,77 @@ var test = require('tap').test, _ = require('lodash'), mergeConfig = require('../../lib/merge_config'); -test('bad config', function (t) { - mergeConfig({ config: 'DOES-NOT-EXIST' }) - .catch(err => { - t.ok(err); - t.end(); - }); +test('bad config', function(t) { + mergeConfig({ config: 'DOES-NOT-EXIST' }).catch(err => { + t.ok(err); + t.end(); + }); }); -test('nc(mergeConfig)', function (t) { - +test('nc(mergeConfig)', function(t) { // Omit configuration from output, for simplicity - var nc = _.curryRight(_.omit, 2)(['config', 'no-package', 'parseExtension', 'project-homepage', - 'project-name', 'project-version']); + var nc = _.curryRight(_.omit, 2)([ + 'config', + 'no-package', + 'parseExtension', + 'project-homepage', + 'project-name', + 'project-version' + ]); - Promise.all([ + Promise.all( [ - { config: path.join(__dirname, '../config_fixture/config.json') }, - { foo: 'bar' } - - ], [ - { passThrough: true, config: path.join(__dirname, '../config_fixture/config.json') }, - { foo: 'bar', passThrough: true } - - ], [ - { config: path.join(__dirname, '../config_fixture/config_comments.json') }, - { foo: 'bar' } - - ], [ - { config: path.join(__dirname, '../config_fixture/config.yaml') }, - { foo: 'bar' } - - ], [ - { config: path.join(__dirname, '../config_fixture/config.yml') }, - { foo: 'bar' } - - ], [ - { config: path.join(__dirname, '../config_fixture/config') }, - { foo: 'bar' } - - ], [ - { config: path.join(__dirname, '../config_fixture/config_links.yml') }, - { foo: 'hello [link](https://github.com/my/link) world' } - - ], [ - { config: path.join(__dirname, '../config_fixture/config_file.yml') }, - { - toc: [{ - name: 'snowflake', - file: path.join(__dirname, '../fixture/snowflake.md') - }] - } - ] - ].map(pair => - mergeConfig(Object.assign(pair[0], { 'no-package': true })) - .then(nc) - .then(res => { - t.deepEqual(res, pair[1]); - }) - )).then(res => { + [ + { config: path.join(__dirname, '../config_fixture/config.json') }, + { foo: 'bar' } + ], + [ + { + passThrough: true, + config: path.join(__dirname, '../config_fixture/config.json') + }, + { foo: 'bar', passThrough: true } + ], + [ + { + config: path.join(__dirname, '../config_fixture/config_comments.json') + }, + { foo: 'bar' } + ], + [ + { config: path.join(__dirname, '../config_fixture/config.yaml') }, + { foo: 'bar' } + ], + [ + { config: path.join(__dirname, '../config_fixture/config.yml') }, + { foo: 'bar' } + ], + [ + { config: path.join(__dirname, '../config_fixture/config') }, + { foo: 'bar' } + ], + [ + { config: path.join(__dirname, '../config_fixture/config_links.yml') }, + { foo: 'hello [link](https://github.com/my/link) world' } + ], + [ + { config: path.join(__dirname, '../config_fixture/config_file.yml') }, + { + toc: [ + { + name: 'snowflake', + file: path.join(__dirname, '../fixture/snowflake.md') + } + ] + } + ] + ].map(pair => + mergeConfig(Object.assign(pair[0], { 'no-package': true })) + .then(nc) + .then(res => { + t.deepEqual(res, pair[1]); + })) + ).then(res => { t.end(); }); }); diff --git a/test/lib/nest.js b/test/lib/nest.js index d05c96f19..8210ce45b 100644 --- a/test/lib/nest.js +++ b/test/lib/nest.js @@ -5,21 +5,28 @@ var test = require('tap').test, nest = require('../../lib/nest'); function toComment(fn, filename) { - return parse({ - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {}).map(nest); + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ).map(nest); } -test('nest params - no params', function (t) { - t.deepEqual(toComment(function () { - /** @name foo */ - })[0].params, [], 'no params'); +test('nest params - no params', function(t) { + t.deepEqual( + toComment(function() { + /** @name foo */ + })[0].params, + [], + 'no params' + ); t.end(); }); -test('nest params - no nesting', function (t) { - var result = toComment(function () { +test('nest params - no nesting', function(t) { + var result = toComment(function() { /** @param {Object} foo */ }); t.equal(result[0].params.length, 1); @@ -28,8 +35,8 @@ test('nest params - no nesting', function (t) { t.end(); }); -test('nest params - basic', function (t) { - var result = toComment(function () { +test('nest params - basic', function(t) { + var result = toComment(function() { /** * @param {Object} foo * @param {string} foo.bar @@ -44,8 +51,8 @@ test('nest params - basic', function (t) { t.end(); }); -test('nest properties - basic', function (t) { - var result = toComment(function () { +test('nest properties - basic', function(t) { + var result = toComment(function() { /** * @property {Object} foo * @property {string} foo.bar @@ -60,8 +67,8 @@ test('nest properties - basic', function (t) { t.end(); }); -test('nest params - array', function (t) { - var result = toComment(function () { +test('nest params - array', function(t) { + var result = toComment(function() { /** * @param {Object[]} employees - The employees who are responsible for the project. * @param {string} employees[].name - The name of an employee. @@ -76,15 +83,19 @@ test('nest params - array', function (t) { t.end(); }); -test('nest params - missing parent', function (t) { - var result = toComment(function () { +test('nest params - missing parent', function(t) { + var result = toComment(function() { /** @param {string} foo.bar */ }); t.equal(result[0].params.length, 1); - t.deepEqual(result[0].errors[0], { - message: '@param foo.bar\'s parent foo not found', - commentLineNumber: 0 - }, 'correct error message'); + t.deepEqual( + result[0].errors[0], + { + message: "@param foo.bar's parent foo not found", + commentLineNumber: 0 + }, + 'correct error message' + ); t.equal(result[0].params[0].name, 'foo.bar'); t.end(); }); diff --git a/test/lib/output/util/formatters.js b/test/lib/output/util/formatters.js index 04dc55429..26babb131 100644 --- a/test/lib/output/util/formatters.js +++ b/test/lib/output/util/formatters.js @@ -2,35 +2,61 @@ var test = require('tap').test; var formatters = require('../../../../lib/output/util/formatters')(getHref); -test('formatters.parameters -- long form', function (t) { +test('formatters.parameters -- long form', function(t) { t.deepEqual(formatters.parameters({}), '()'); t.deepEqual(formatters.parameters({ params: [] }), '()'); - t.deepEqual(formatters.parameters({ params: [{ name: 'foo' }] }), '(foo: any)'); - t.deepEqual(formatters.parameters({ params: [{ name: 'foo', type: { type: 'OptionalType' } }] }), '(foo: any?)'); + t.deepEqual( + formatters.parameters({ params: [{ name: 'foo' }] }), + '(foo: any)' + ); + t.deepEqual( + formatters.parameters({ + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }), + '(foo: any?)' + ); t.done(); }); -test('formatters.parameters -- short form', function (t) { +test('formatters.parameters -- short form', function(t) { t.deepEqual(formatters.parameters({}, true), '()'); t.deepEqual(formatters.parameters({ params: [] }, true), '()'); - t.deepEqual(formatters.parameters({ params: [{ name: 'foo' }] }, true), '(foo)'); - t.deepEqual(formatters.parameters({ - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }, true), '(foo?)'); - t.deepEqual(formatters.parameters({ - params: [{ - title: 'param', - description: 'param', - type: { - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'number' - }}, - name: 'bar', - default: '1' - }] - }, true), '(bar = 1)'); + t.deepEqual( + formatters.parameters({ params: [{ name: 'foo' }] }, true), + '(foo)' + ); + t.deepEqual( + formatters.parameters( + { + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }, + true + ), + '(foo?)' + ); + t.deepEqual( + formatters.parameters( + { + params: [ + { + title: 'param', + description: 'param', + type: { + type: 'OptionalType', + expression: { + type: 'NameExpression', + name: 'number' + } + }, + name: 'bar', + default: '1' + } + ] + }, + true + ), + '(bar = 1)' + ); t.done(); }); diff --git a/test/lib/parse.js b/test/lib/parse.js index 5bde5893f..2e7518520 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -7,77 +7,102 @@ var test = require('tap').test, function pick(obj, props) { if (Array.isArray(props)) { - return props.reduce(function (memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, {}); + return props.reduce( + function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, + {} + ); } return obj[props]; } function evaluate(fn, filename) { - return parse({ - file: filename || 'test.js', - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, {}); + return parse( + { + file: filename || 'test.js', + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ); } function addJSDocTag(tree) { - visit(tree, 'link', function (node) { + visit(tree, 'link', function(node) { node.jsdoc = true; }); return tree; } function removePosition(tree) { - visit(tree, function (node) { + visit(tree, function(node) { delete node.position; }); return tree; } -test('parse - @abstract', function (t) { - t.equal(evaluate(function () { - /** @abstract */ - })[0].abstract, true); +test('parse - @abstract', function(t) { + t.equal( + evaluate(function() { + /** @abstract */ + })[0].abstract, + true + ); t.end(); }); -test('parse - @access', function (t) { - t.equal(evaluate(function () { - /** @access public */ - })[0].access, 'public', 'access public'); +test('parse - @access', function(t) { + t.equal( + evaluate(function() { + /** @access public */ + })[0].access, + 'public', + 'access public' + ); - t.equal(evaluate(function () { - /** @access protected */ - })[0].access, 'protected', 'access protected'); + t.equal( + evaluate(function() { + /** @access protected */ + })[0].access, + 'protected', + 'access protected' + ); - t.equal(evaluate(function () { - /** @access private */ - })[0].access, 'private', 'access private'); + t.equal( + evaluate(function() { + /** @access private */ + })[0].access, + 'private', + 'access private' + ); t.end(); }); -test('parse - @alias', function (t) { +test('parse - @alias', function(t) { t.end(); }); -test('parse - @arg', function (t) { +test('parse - @arg', function(t) { t.end(); }); -test('parse - @argument', function (t) { +test('parse - @argument', function(t) { t.end(); }); -test('parse - @augments', function (t) { - t.equal(evaluate(function () { - /** @augments Foo */ - })[0].augments[0].name, 'Foo', 'augments'); +test('parse - @augments', function(t) { + t.equal( + evaluate(function() { + /** @augments Foo */ + })[0].augments[0].name, + 'Foo', + 'augments' + ); t.end(); }); @@ -86,939 +111,1325 @@ test('parse - @augments', function (t) { * Dossier-style augments tag * https://github.com/google/closure-library/issues/746 */ -test('parse - @augments in dossier style', function (t) { - t.equal(evaluate(function () { - /** @augments {Foo} */ - })[0].augments[0].name, 'Foo', 'augments'); +test('parse - @augments in dossier style', function(t) { + t.equal( + evaluate(function() { + /** @augments {Foo} */ + })[0].augments[0].name, + 'Foo', + 'augments' + ); t.end(); }); -test('parse - @augments of complex passes through', function (t) { - t.deepEqual(evaluate(function () { - /** @augments {function()} */ - })[0].augments, []); +test('parse - @augments of complex passes through', function(t) { + t.deepEqual( + evaluate(function() { + /** @augments {function()} */ + })[0].augments, + [] + ); t.end(); }); -test('parse - @author', function (t) { +test('parse - @author', function(t) { t.end(); }); -test('parse - @borrows', function (t) { +test('parse - @borrows', function(t) { t.end(); }); -test('parse - @callback', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @callback name */ - })[0], ['kind', 'name', 'type']), { - name: 'name', - kind: 'typedef', - type: { - type: 'NameExpression', - name: 'Function' +test('parse - @callback', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @callback name */ + })[0], + ['kind', 'name', 'type'] + ), + { + name: 'name', + kind: 'typedef', + type: { + type: 'NameExpression', + name: 'Function' + } } - }); + ); t.end(); }); -test('parse - @class', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @class */ - })[0], ['kind', 'name', 'type']), { - kind: 'class' - }); - - t.deepEqual(pick(evaluate(function () { - /** @class name */ - })[0], ['kind', 'name', 'type']), { - name: 'name', - kind: 'class' - }); - - t.deepEqual(pick(evaluate(function () { - /** @class {Object} name */ - })[0], ['kind', 'name', 'type']), { - name: 'name', - kind: 'class', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @class', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @class */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'class' } - }); + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @class name */ + })[0], + ['kind', 'name', 'type'] + ), + { + name: 'name', + kind: 'class' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @class {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + name: 'name', + kind: 'class', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); t.end(); }); -test('parse - @classdesc', function (t) { - t.deepEqual(evaluate(function () { - /** @classdesc test */ - })[0].classdesc, remark().parse('test')); +test('parse - @classdesc', function(t) { + t.deepEqual( + evaluate(function() { + /** @classdesc test */ + })[0].classdesc, + remark().parse('test') + ); t.end(); }); -test('parse - @const', function (t) { +test('parse - @const', function(t) { t.end(); }); -test('parse - @constant', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @constant */ - })[0], ['kind', 'name', 'type']), { - kind: 'constant' - }); - - t.deepEqual(pick(evaluate(function () { - /** @constant name */ - })[0], ['kind', 'name', 'type']), { - kind: 'constant', - name: 'name' - }); - - - t.deepEqual(pick(evaluate(function () { - /** @constant {Object} */ - })[0], ['kind', 'name', 'type']), { - kind: 'constant', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @constant', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @constant */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'constant' } - }); - - t.deepEqual(pick(evaluate(function () { - /** @constant {Object} name */ - })[0], ['kind', 'name', 'type']), { - kind: 'constant', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @constant name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'constant', + name: 'name' } - }); + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @constant {Object} */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'constant', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @constant {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'constant', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); t.end(); }); -test('parse - @constructor', function (t) { +test('parse - @constructor', function(t) { t.end(); }); -test('parse - @constructs', function (t) { +test('parse - @constructs', function(t) { t.end(); }); -test('parse - @copyright', function (t) { - t.deepEqual(evaluate(function () { - /** @copyright test */ - })[0].copyright, remark().parse('test')); +test('parse - @copyright', function(t) { + t.deepEqual( + evaluate(function() { + /** @copyright test */ + })[0].copyright, + remark().parse('test') + ); t.end(); }); -test('parse - @default', function (t) { +test('parse - @default', function(t) { t.end(); }); -test('parse - @defaultvalue', function (t) { +test('parse - @defaultvalue', function(t) { t.end(); }); -test('parse - @deprecated', function (t) { - t.deepEqual(evaluate(function () { - /** @deprecated test */ - })[0].deprecated, remark().parse('test')); +test('parse - @deprecated', function(t) { + t.deepEqual( + evaluate(function() { + /** @deprecated test */ + })[0].deprecated, + remark().parse('test') + ); t.end(); }); -test('parse - @desc', function (t) { - t.deepEqual(evaluate(function () { - /** @desc test */ - })[0].description, remark().parse('test')); +test('parse - @desc', function(t) { + t.deepEqual( + evaluate(function() { + /** @desc test */ + })[0].description, + remark().parse('test') + ); t.end(); }); -test('parse - @description', function (t) { - t.deepEqual(evaluate(function () { - /** @description test */ - })[0].description, remark().parse('test')); +test('parse - @description', function(t) { + t.deepEqual( + evaluate(function() { + /** @description test */ + })[0].description, + remark().parse('test') + ); t.end(); }); -test('parse - description', function (t) { - t.deepEqual(evaluate(function () { - /** test */ - })[0].description, remark().parse('test')); +test('parse - description', function(t) { + t.deepEqual( + evaluate(function() { + /** test */ + })[0].description, + remark().parse('test') + ); t.end(); }); -test('parse - @emits', function (t) { +test('parse - @emits', function(t) { t.end(); }); -test('parse - @enum', function (t) { +test('parse - @enum', function(t) { t.end(); }); -test('parse - @event', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @event name */ - })[0], ['kind', 'name']), { - kind: 'event', - name: 'name' - }); +test('parse - @event', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @event name */ + })[0], + ['kind', 'name'] + ), + { + kind: 'event', + name: 'name' + } + ); t.end(); }); -test('parse - @example', function (t) { - t.deepEqual(evaluate(function () { - /** @example test */ - })[0].examples[0], { - description: 'test' - }, 'single line'); +test('parse - @example', function(t) { + t.deepEqual( + evaluate(function() { + /** @example test */ + })[0].examples[0], + { + description: 'test' + }, + 'single line' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @example * a * b */ - })[0].examples[0], { - description: 'a\nb' - }, 'multiline'); + })[0].examples[0], + { + description: 'a\nb' + }, + 'multiline' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @example caption * a * b */ - })[0].examples[0], { - description: 'a\nb', - caption: remark().parse('caption') - }, 'with caption'); - - t.deepEqual(evaluate(function () { - /** @example */ - })[0].errors[0], { - message: '@example without code', - commentLineNumber: 0 - }, 'missing description'); + })[0].examples[0], + { + description: 'a\nb', + caption: remark().parse('caption') + }, + 'with caption' + ); + + t.deepEqual( + evaluate(function() { + /** @example */ + })[0].errors[0], + { + message: '@example without code', + commentLineNumber: 0 + }, + 'missing description' + ); t.end(); }); -test('parse - @exception', function (t) { +test('parse - @exception', function(t) { t.end(); }); -test('parse - @exports', function (t) { +test('parse - @exports', function(t) { t.end(); }); -test('parse - @extends', function (t) { - t.deepEqual(evaluate(function () { - /** @extends Foo */ - })[0].augments[0].name, 'Foo', 'extends'); +test('parse - @extends', function(t) { + t.deepEqual( + evaluate(function() { + /** @extends Foo */ + })[0].augments[0].name, + 'Foo', + 'extends' + ); t.end(); }); -test('parse - @external', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @external name */ - })[0], ['kind', 'name']), { - kind: 'external', - name: 'name' - }); +test('parse - @external', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @external name */ + })[0], + ['kind', 'name'] + ), + { + kind: 'external', + name: 'name' + } + ); t.end(); }); -test('parse - @file', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @file */ - })[0], ['kind']), { - kind: 'file' - }); - - t.deepEqual(pick(evaluate(function () { - /** @file desc */ - })[0], ['kind', 'description']), { - kind: 'file', - description: remark().parse('desc') - }); +test('parse - @file', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @file */ + })[0], + ['kind'] + ), + { + kind: 'file' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @file desc */ + })[0], + ['kind', 'description'] + ), + { + kind: 'file', + description: remark().parse('desc') + } + ); t.end(); }); -test('parse - @fileoverview', function (t) { +test('parse - @fileoverview', function(t) { t.end(); }); -test('parse - @fires', function (t) { +test('parse - @fires', function(t) { t.end(); }); -test('parse - @func', function (t) { +test('parse - @func', function(t) { t.end(); }); -test('parse - @function', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @function */ - })[0], ['kind', 'name']), { - kind: 'function' - }); - - t.deepEqual(pick(evaluate(function () { - /** @function name */ - })[0], ['kind', 'name']), { - kind: 'function', - name: 'name' - }); +test('parse - @function', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @function */ + })[0], + ['kind', 'name'] + ), + { + kind: 'function' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @function name */ + })[0], + ['kind', 'name'] + ), + { + kind: 'function', + name: 'name' + } + ); t.end(); }); -test('parse - @global', function (t) { - t.equal(evaluate(function () { - /** @global */ - })[0].scope, 'global', 'global'); +test('parse - @global', function(t) { + t.equal( + evaluate(function() { + /** @global */ + })[0].scope, + 'global', + 'global' + ); t.end(); }); -test('parse - @host', function (t) { +test('parse - @host', function(t) { t.end(); }); -test('parse - @ignore', function (t) { - t.equal(evaluate(function () { - /** @ignore */ - })[0].ignore, true); +test('parse - @ignore', function(t) { + t.equal( + evaluate(function() { + /** @ignore */ + })[0].ignore, + true + ); t.end(); }); -test('parse - @implements', function (t) { +test('parse - @implements', function(t) { t.end(); }); -test('parse - @inheritdoc', function (t) { +test('parse - @inheritdoc', function(t) { t.end(); }); -test('parse - @inner', function (t) { - t.equal(evaluate(function () { - /** @inner*/ - })[0].scope, 'inner', 'inner'); +test('parse - @inner', function(t) { + t.equal( + evaluate(function() { + /** @inner*/ + })[0].scope, + 'inner', + 'inner' + ); t.end(); }); -test('parse - @instance', function (t) { - t.equal(evaluate(function () { - /** @instance*/ - })[0].scope, 'instance', 'instance'); +test('parse - @instance', function(t) { + t.equal( + evaluate(function() { + /** @instance*/ + })[0].scope, + 'instance', + 'instance' + ); t.end(); }); -test('parse - @interface', function (t) { - t.deepEqual(evaluate(function () { - /** @interface */ - })[0].interface, true, 'anonymous'); +test('parse - @interface', function(t) { + t.deepEqual( + evaluate(function() { + /** @interface */ + })[0].interface, + true, + 'anonymous' + ); - t.deepEqual(evaluate(function () { - /** @interface Foo */ - })[0].name, 'Foo', 'named'); + t.deepEqual( + evaluate(function() { + /** @interface Foo */ + })[0].name, + 'Foo', + 'named' + ); t.end(); }); -test('parse - @kind', function (t) { - t.equal(evaluate(function () { - /** @kind class */ - })[0].kind, 'class', 'kind'); +test('parse - @kind', function(t) { + t.equal( + evaluate(function() { + /** @kind class */ + })[0].kind, + 'class', + 'kind' + ); t.end(); }); -test('parse - @license', function (t) { +test('parse - @license', function(t) { t.end(); }); -test('parse - @listens', function (t) { +test('parse - @listens', function(t) { t.end(); }); -test('parse - @member', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @member */ - })[0], ['kind', 'name', 'type']), { - kind: 'member' - }); - - t.deepEqual(pick(evaluate(function () { - /** @member name */ - })[0], ['kind', 'name', 'type']), { - kind: 'member', - name: 'name' - }); - - t.deepEqual(pick(evaluate(function () { - /** @member {Object} */ - })[0], ['kind', 'name', 'type']), { - kind: 'member', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @member', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @member */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'member' } - }); - - t.deepEqual(pick(evaluate(function () { - /** @member {Object} name */ - })[0], ['kind', 'name', 'type']), { - kind: 'member', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @member name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'member', + name: 'name' } - }); + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @member {Object} */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'member', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @member {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'member', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); t.end(); }); -test('parse - @memberof', function (t) { - t.equal(evaluate(function () { - /** @memberof test */ - })[0].memberof, 'test', 'memberof'); +test('parse - @memberof', function(t) { + t.equal( + evaluate(function() { + /** @memberof test */ + })[0].memberof, + 'test', + 'memberof' + ); t.end(); }); -test('parse - @method', function (t) { +test('parse - @method', function(t) { t.end(); }); -test('parse - @mixes', function (t) { +test('parse - @mixes', function(t) { t.end(); }); -test('parse - @mixin', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @mixin */ - })[0], ['kind', 'name']), { - kind: 'mixin' - }); - - t.deepEqual(pick(evaluate(function () { - /** @mixin name */ - })[0], ['kind', 'name']), { - kind: 'mixin', - name: 'name' - }); +test('parse - @mixin', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @mixin */ + })[0], + ['kind', 'name'] + ), + { + kind: 'mixin' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @mixin name */ + })[0], + ['kind', 'name'] + ), + { + kind: 'mixin', + name: 'name' + } + ); t.end(); }); -test('parse - @module', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @module */ - })[0], ['kind', 'name', 'type']), { - kind: 'module' - }); - - t.deepEqual(pick(evaluate(function () { - /** @module name */ - })[0], ['kind', 'name', 'type']), { - kind: 'module', - name: 'name' - }); - - t.deepEqual(pick(evaluate(function () { - /** @module {Object} name */ - })[0], ['kind', 'name', 'type']), { - kind: 'module', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @module', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @module */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'module' } - }); + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @module name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'module', + name: 'name' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @module {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'module', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); t.end(); }); -test('parse - @name', function (t) { - t.equal(evaluate(function () { - /** @name test */ - })[0].name, 'test', 'name'); +test('parse - @name', function(t) { + t.equal( + evaluate(function() { + /** @name test */ + })[0].name, + 'test', + 'name' + ); t.end(); }); -test('parse - @namespace', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @namespace */ - })[0], ['kind', 'name', 'type']), { - kind: 'namespace' - }); - - t.deepEqual(pick(evaluate(function () { - /** @namespace name */ - })[0], ['kind', 'name', 'type']), { - kind: 'namespace', - name: 'name' - }); - - t.deepEqual(pick(evaluate(function () { - /** @namespace {Object} name */ - })[0], ['kind', 'name', 'type']), { - kind: 'namespace', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @namespace', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @namespace */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'namespace' } - }); + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @namespace name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'namespace', + name: 'name' + } + ); + + t.deepEqual( + pick( + evaluate(function() { + /** @namespace {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'namespace', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + } + ); t.end(); }); -test('parse - @override', function (t) { - t.equal(evaluate(function () { - /** @override */ - })[0].override, true); +test('parse - @override', function(t) { + t.equal( + evaluate(function() { + /** @override */ + })[0].override, + true + ); t.end(); }); -test('parse - @overview', function (t) { +test('parse - @overview', function(t) { t.end(); }); -test('parse - @param', function (t) { - t.deepEqual(evaluate(function () { - /** @param test */ - })[0].params[0], { - name: 'test', - title: 'param', - lineNumber: 0 - }, 'name'); - - t.deepEqual(evaluate(function () { - /** @param {number} test */ - })[0].params[0], { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' +test('parse - @param', function(t) { + t.deepEqual( + evaluate(function() { + /** @param test */ + })[0].params[0], + { + name: 'test', + title: 'param', + lineNumber: 0 + }, + 'name' + ); + + t.deepEqual( + evaluate(function() { + /** @param {number} test */ + })[0].params[0], + { + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 }, - lineNumber: 0 - }, 'name and type'); - - t.deepEqual(evaluate(function () { - /** @param {number} test - desc */ - })[0].params[0], { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' + 'name and type' + ); + + t.deepEqual( + evaluate(function() { + /** @param {number} test - desc */ + })[0].params[0], + { + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 }, - description: remark().parse('desc'), - lineNumber: 0 - }, 'complete'); + 'complete' + ); t.end(); }); -test('parse - @private', function (t) { - t.equal(evaluate(function () { - /** @private */ - })[0].access, 'private', 'private'); +test('parse - @private', function(t) { + t.equal( + evaluate(function() { + /** @private */ + })[0].access, + 'private', + 'private' + ); t.end(); }); -test('parse - @prop', function (t) { - t.deepEqual(evaluate(function () { - /** @prop {number} test */ - })[0].properties[0], { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' +test('parse - @prop', function(t) { + t.deepEqual( + evaluate(function() { + /** @prop {number} test */ + })[0].properties[0], + { + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 }, - lineNumber: 0 - }, 'name and type'); - - t.deepEqual(evaluate(function () { - /** @prop {number} test - desc */ - })[0].properties[0], { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' + 'name and type' + ); + + t.deepEqual( + evaluate(function() { + /** @prop {number} test - desc */ + })[0].properties[0], + { + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 }, - description: remark().parse('desc'), - lineNumber: 0 - }, 'complete'); + 'complete' + ); t.end(); }); -test('parse - @property', function (t) { - t.deepEqual(evaluate(function () { - /** @property {number} test */ - })[0].properties[0], { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' +test('parse - @property', function(t) { + t.deepEqual( + evaluate(function() { + /** @property {number} test */ + })[0].properties[0], + { + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 }, - lineNumber: 0 - }, 'name and type'); - - t.deepEqual(evaluate(function () { - /** @property {number} test - desc */ - })[0].properties[0], { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' + 'name and type' + ); + + t.deepEqual( + evaluate(function() { + /** @property {number} test - desc */ + })[0].properties[0], + { + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 }, - description: remark().parse('desc'), - lineNumber: 0 - }, 'complete'); + 'complete' + ); t.end(); }); -test('parse - @protected', function (t) { - t.equal(evaluate(function () { - /** @protected */ - })[0].access, 'protected', 'protected'); +test('parse - @protected', function(t) { + t.equal( + evaluate(function() { + /** @protected */ + })[0].access, + 'protected', + 'protected' + ); t.end(); }); -test('parse - @public', function (t) { +test('parse - @public', function(t) { t.end(); }); -test('parse - @readonly', function (t) { - t.equal(evaluate(function () { - /** @readonly */ - })[0].readonly, true); +test('parse - @readonly', function(t) { + t.equal( + evaluate(function() { + /** @readonly */ + })[0].readonly, + true + ); t.end(); }); -test('parse - @requires', function (t) { +test('parse - @requires', function(t) { t.end(); }); -test('parse - @return', function (t) { - t.deepEqual(evaluate(function () { - /** @return test */ - })[0].returns[0], { - title: 'returns', - description: remark().parse('test') - }, 'description'); - - t.deepEqual(evaluate(function () { - /** @return {number} test */ - })[0].returns[0], { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, 'description and type'); +test('parse - @return', function(t) { + t.deepEqual( + evaluate(function() { + /** @return test */ + })[0].returns[0], + { + title: 'returns', + description: remark().parse('test') + }, + 'description' + ); + + t.deepEqual( + evaluate(function() { + /** @return {number} test */ + })[0].returns[0], + { + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }, + 'description and type' + ); t.end(); }); -test('parse - @returns', function (t) { - t.deepEqual(evaluate(function () { - /** @returns test */ - })[0].returns[0], { - title: 'returns', - description: remark().parse('test') - }, 'description'); - - t.deepEqual(evaluate(function () { - /** @returns {number} test */ - })[0].returns[0], { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, 'description and type'); +test('parse - @returns', function(t) { + t.deepEqual( + evaluate(function() { + /** @returns test */ + })[0].returns[0], + { + title: 'returns', + description: remark().parse('test') + }, + 'description' + ); + + t.deepEqual( + evaluate(function() { + /** @returns {number} test */ + })[0].returns[0], + { + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }, + 'description and type' + ); t.end(); }); -test('parse - @see', function (t) { - t.deepEqual(evaluate(function () { - /** @see test */ - })[0].sees, [ - remark().parse('test') - ], 'single'); +test('parse - @see', function(t) { + t.deepEqual( + evaluate(function() { + /** @see test */ + })[0].sees, + [remark().parse('test')], + 'single' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @see a * @see b */ - })[0].sees, [ - remark().parse('a'), - remark().parse('b') - ], 'multiple'); + })[0].sees, + [remark().parse('a'), remark().parse('b')], + 'multiple' + ); t.end(); }); -test('parse - @since', function (t) { +test('parse - @since', function(t) { t.end(); }); -test('parse - @static', function (t) { - t.equal(evaluate(function () { - /** @static */ - })[0].scope, 'static', 'static'); +test('parse - @static', function(t) { + t.equal( + evaluate(function() { + /** @static */ + })[0].scope, + 'static', + 'static' + ); t.end(); }); -test('parse - @summary', function (t) { - t.deepEqual(evaluate(function () { - /** @summary test */ - })[0].summary, remark().parse('test')); +test('parse - @summary', function(t) { + t.deepEqual( + evaluate(function() { + /** @summary test */ + })[0].summary, + remark().parse('test') + ); t.end(); }); -test('parse - @this', function (t) { +test('parse - @this', function(t) { t.end(); }); -test('parse - @throws', function (t) { - t.deepEqual(evaluate(function () { - /** @throws desc */ - })[0].throws[0], { - description: remark().parse('desc') - }, 'description'); - - t.deepEqual(evaluate(function () { - /** @throws {Error} */ - })[0].throws[0], { - type: { - name: 'Error', - type: 'NameExpression' - } - }, 'type'); - - t.deepEqual(evaluate(function () { - /** @throws {Error} desc */ - })[0].throws[0], { - type: { - name: 'Error', - type: 'NameExpression' +test('parse - @throws', function(t) { + t.deepEqual( + evaluate(function() { + /** @throws desc */ + })[0].throws[0], + { + description: remark().parse('desc') + }, + 'description' + ); + + t.deepEqual( + evaluate(function() { + /** @throws {Error} */ + })[0].throws[0], + { + type: { + name: 'Error', + type: 'NameExpression' + } }, - description: remark().parse('desc') - }, 'type and description'); + 'type' + ); + + t.deepEqual( + evaluate(function() { + /** @throws {Error} desc */ + })[0].throws[0], + { + type: { + name: 'Error', + type: 'NameExpression' + }, + description: remark().parse('desc') + }, + 'type and description' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @throws a * @throws b */ - })[0].throws, [{ - description: remark().parse('a') - }, { - description: remark().parse('b') - }], 'multiple'); + })[0].throws, + [ + { + description: remark().parse('a') + }, + { + description: remark().parse('b') + } + ], + 'multiple' + ); t.end(); }); -test('parse - @todo', function (t) { - t.deepEqual(evaluate(function () { - /** @todo test */ - })[0].todos, [ - remark().parse('test') - ], 'single'); +test('parse - @todo', function(t) { + t.deepEqual( + evaluate(function() { + /** @todo test */ + })[0].todos, + [remark().parse('test')], + 'single' + ); - t.deepEqual(evaluate(function () { - /** + t.deepEqual( + evaluate(function() { + /** * @todo a * @todo b */ - })[0].todos, [ - remark().parse('a'), - remark().parse('b') - ], 'multiple'); + })[0].todos, + [remark().parse('a'), remark().parse('b')], + 'multiple' + ); t.end(); }); -test('parse - @tutorial', function (t) { +test('parse - @tutorial', function(t) { t.end(); }); -test('parse - @type', function (t) { +test('parse - @type', function(t) { t.end(); }); -test('parse - @typedef', function (t) { - t.deepEqual(pick(evaluate(function () { - /** @typedef {Object} name */ - })[0], ['kind', 'name', 'type']), { - kind: 'typedef', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' +test('parse - @typedef', function(t) { + t.deepEqual( + pick( + evaluate(function() { + /** @typedef {Object} name */ + })[0], + ['kind', 'name', 'type'] + ), + { + kind: 'typedef', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } } - }); + ); t.end(); }); -test('parse - @var', function (t) { +test('parse - @var', function(t) { t.end(); }); -test('parse - @variation', function (t) { - t.equal(evaluate(function () { - /** @variation 1 */ - })[0].variation, 1, 'variation'); - - t.end(); -}); +test('parse - @variation', function(t) { + t.equal( + evaluate(function() { + /** @variation 1 */ + })[0].variation, + 1, + 'variation' + ); -test('parse - @version', function (t) { t.end(); }); -test('parse - @virtual', function (t) { +test('parse - @version', function(t) { t.end(); }); -test('parse - unknown tag', function (t) { - t.deepEqual(evaluate(function () { - /** @unknown */ - })[0].errors[0], { - message: 'unknown tag @unknown', - commentLineNumber: 0 - }); - +test('parse - @virtual', function(t) { t.end(); }); -test('parse - {@link}', function (t) { - t.deepEqual(removePosition(evaluate(function () { - /** {@link Foo} */ - })[0].description), addJSDocTag(removePosition(remark().parse('[Foo](Foo)')))); - - t.deepEqual(removePosition(evaluate(function () { - /** {@link Foo|text} */ - })[0].description), addJSDocTag(removePosition(remark().parse('[text](Foo)')))); - - t.deepEqual(removePosition(evaluate(function () { - /** {@link Foo text} */ - })[0].description), addJSDocTag(removePosition(remark().parse('[text](Foo)')))); +test('parse - unknown tag', function(t) { + t.deepEqual( + evaluate(function() { + /** @unknown */ + })[0].errors[0], + { + message: 'unknown tag @unknown', + commentLineNumber: 0 + } + ); + + t.end(); +}); + +test('parse - {@link}', function(t) { + t.deepEqual( + removePosition( + evaluate(function() { + /** {@link Foo} */ + })[0].description + ), + addJSDocTag(removePosition(remark().parse('[Foo](Foo)'))) + ); + + t.deepEqual( + removePosition( + evaluate(function() { + /** {@link Foo|text} */ + })[0].description + ), + addJSDocTag(removePosition(remark().parse('[text](Foo)'))) + ); + + t.deepEqual( + removePosition( + evaluate(function() { + /** {@link Foo text} */ + })[0].description + ), + addJSDocTag(removePosition(remark().parse('[text](Foo)'))) + ); t.done(); }); -test('parse - {@linkcode}', function (t) { - t.end(); -}); - -test('parse - {@linkplain}', function (t) { - t.end(); -}); - -test('parse - {@tutorial}', function (t) { - t.deepEqual(removePosition(evaluate(function () { - /** {@tutorial id} */ - })[0].description), { - type: 'root', - children: [{ - type: 'paragraph', - children: [{ - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [{ - type: 'text', - value: 'id' - }] - }] - }] - }); - - t.deepEqual(removePosition(evaluate(function () { - /** {@tutorial id|text} */ - })[0].description), { - type: 'root', - children: [{ - type: 'paragraph', - children: [{ - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [{ - type: 'text', - value: 'text' - }] - }] - }] - }); - - t.deepEqual(removePosition(evaluate(function () { - /** {@tutorial id text} */ - })[0].description), { - type: 'root', - children: [{ - type: 'paragraph', - children: [{ - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [{ - type: 'text', - value: 'text' - }] - }] - }] - }); +test('parse - {@linkcode}', function(t) { + t.end(); +}); + +test('parse - {@linkplain}', function(t) { + t.end(); +}); + +test('parse - {@tutorial}', function(t) { + t.deepEqual( + removePosition( + evaluate(function() { + /** {@tutorial id} */ + })[0].description + ), + { + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'id' + } + ] + } + ] + } + ] + } + ); + + t.deepEqual( + removePosition( + evaluate(function() { + /** {@tutorial id|text} */ + })[0].description + ), + { + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + } + ); + + t.deepEqual( + removePosition( + evaluate(function() { + /** {@tutorial id text} */ + })[0].description + ), + { + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + } + ); t.done(); }); diff --git a/test/lib/parsers/javascript.js b/test/lib/parsers/javascript.js index 3541d357a..022506bee 100644 --- a/test/lib/parsers/javascript.js +++ b/test/lib/parsers/javascript.js @@ -6,61 +6,96 @@ var test = require('tap').test, function toComments(source, filename, opts) { source = typeof source === 'string' ? source : '(' + source.toString() + ')'; - return parse({ - file: filename || 'test.js', - source - }, opts || {}); + return parse( + { + file: filename || 'test.js', + source + }, + opts || {} + ); } -test('parse - leading comment', function (t) { - t.deepEqual(toComments(function () { - /** one */ - /** two */ - function two() {} - }).map(function (c) { - return c.description; - }), [remark().parse('one'), remark().parse('two')]); +test('parse - leading comment', function(t) { + t.deepEqual( + toComments(function() { + /** one */ + /** two */ + function two() {} + }).map(function(c) { + return c.description; + }), + [remark().parse('one'), remark().parse('two')] + ); t.end(); }); -test('parse - trailing comment', function (t) { - t.deepEqual(toComments(function () { - /** one */ - function one() {} - /** two */ - }).map(function (c) { - return c.description; - }), [remark().parse('one'), remark().parse('two')]); +test('parse - trailing comment', function(t) { + t.deepEqual( + toComments(function() { + /** one */ + function one() {} + /** two */ + }).map(function(c) { + return c.description; + }), + [remark().parse('one'), remark().parse('two')] + ); t.end(); }); -test('parse - unknown tag', function (t) { - t.equal(toComments(function () { - /** @unknown */ - })[0].tags[0].title, 'unknown'); +test('parse - unknown tag', function(t) { + t.equal( + toComments(function() { + /** @unknown */ + })[0].tags[0].title, + 'unknown' + ); t.end(); }); -test('parse - error', function (t) { - t.deepEqual(toComments(function () { - /** @param {foo */ - })[0].errors, [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' }]); +test('parse - error', function(t) { + t.deepEqual( + toComments(function() { + /** @param {foo */ + })[0].errors, + [ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ] + ); t.end(); }); -test('parse - document exported', function (t) { - t.equal(toComments(` +test('parse - document exported', function(t) { + t.equal( + toComments( + ` export class C {} - `).length, 0); - t.equal(toComments(` + ` + ).length, + 0 + ); + t.equal( + toComments( + ` export class C {} - `, 'test.js', {documentExported: true}).length, 1); - t.equal(toComments(` + `, + 'test.js', + { documentExported: true } + ).length, + 1 + ); + t.equal( + toComments( + ` export class C { method() {} } - `, 'test.js', {documentExported: true}).length, 2); + `, + 'test.js', + { documentExported: true } + ).length, + 2 + ); t.end(); }); diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js index dc80b2c0a..9025fac35 100644 --- a/test/lib/parsers/polyglot.js +++ b/test/lib/parsers/polyglot.js @@ -6,67 +6,84 @@ var test = require('tap').test, remark = require('remark'), polyglot = require('../../../lib/parsers/polyglot'); -test('polyglot', function (t) { - var file = path.resolve(path.join(__dirname, '../../fixture/polyglot/blend.cpp')); +test('polyglot', function(t) { + var file = path.resolve( + path.join(__dirname, '../../fixture/polyglot/blend.cpp') + ); var result = polyglot({ file, source: fs.readFileSync(file, 'utf8') }); delete result[0].context.file; delete result[0].context.sortKey; - t.deepEqual(result, [{ - errors: [], - augments: [], - examples: [], - properties: [], - throws: [], - todos: [], - sees: [], - context: { - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } }, - description: remark().parse('This method moves a hex to a color'), - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, - name: 'hexToUInt32Color', params: [{ - lineNumber: 3, - title: 'param', - name: 'hex', - type: { - name: 'string', - type: 'NameExpression' - }} - ], - returns: [ + t.deepEqual( + result, + [ { - title: 'returns', - description: remark().parse('color'), - type: { - name: 'number', - type: 'NameExpression' - } + errors: [], + augments: [], + examples: [], + properties: [], + throws: [], + todos: [], + sees: [], + context: { + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } + }, + description: remark().parse('This method moves a hex to a color'), + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, + name: 'hexToUInt32Color', + params: [ + { + lineNumber: 3, + title: 'param', + name: 'hex', + type: { + name: 'string', + type: 'NameExpression' + } + } + ], + returns: [ + { + title: 'returns', + description: remark().parse('color'), + type: { + name: 'number', + type: 'NameExpression' + } + } + ], + tags: [ + { + description: null, + lineNumber: 2, + name: 'hexToUInt32Color', + title: 'name' + }, + { + description: null, + lineNumber: 3, + name: 'hex', + title: 'param', + type: { + name: 'string', + type: 'NameExpression' + } + }, + { + description: 'color', + lineNumber: 4, + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + } + ] } ], - tags: [{ - description: null, - lineNumber: 2, - name: 'hexToUInt32Color', - title: 'name' - }, - { - description: null, - lineNumber: 3, - name: 'hex', - title: 'param', - type: { - name: 'string', type: 'NameExpression' - } - }, - { - description: 'color', - lineNumber: 4, - title: 'returns', - type: { - name: 'number', type: 'NameExpression' - } - }]}], 'polyglot parser'); + 'polyglot parser' + ); t.end(); }); diff --git a/test/lib/server.js b/test/lib/server.js index e20808c3b..ab2fbc3e6 100644 --- a/test/lib/server.js +++ b/test/lib/server.js @@ -26,67 +26,78 @@ var indexFile = new File({ contents: new Buffer('') }); -test('server - throws on bad port', function (t) { - t.throws(function () { - var server = new Server('4001'); - }, 'port must be a number'); - t.throws(function () { - var server = new Server(); - }, 'port must be provided'); +test('server - throws on bad port', function(t) { + t.throws( + function() { + var server = new Server('4001'); + }, + 'port must be a number' + ); + t.throws( + function() { + var server = new Server(); + }, + 'port must be provided' + ); t.end(); }); -test('server', function (t) { +test('server', function(t) { var server = new Server(4001); t.ok(server, 'server is initialized'); - server.start().then(function () { - - t.test('start can be called more than once, without a callback', function (tt) { - server.start(); - tt.end(); - }); + server.start().then(function() { + t.test( + 'start can be called more than once, without a callback', + function(tt) { + server.start(); + tt.end(); + } + ); - t.test('base path', function (tt) { - get('http://localhost:4001/file.coffee', function (code) { + t.test('base path', function(tt) { + get('http://localhost:4001/file.coffee', function(code) { tt.equal(code, 404, 'does not have a file, emits 404'); tt.end(); }); }); - t.test('base path', function (tt) { + t.test('base path', function(tt) { server.setFiles([coffeeFile]); - get('http://localhost:4001/file.coffee', function (text) { + get('http://localhost:4001/file.coffee', function(text) { tt.equal(text, 'test = 123', 'emits response'); tt.end(); }); }); - t.test('reset files', function (tt) { + t.test('reset files', function(tt) { server.setFiles([coffeeFile, jsFile]); - get('http://localhost:4001/file.js', function (text) { + get('http://localhost:4001/file.js', function(text) { tt.equal(text, 'var test = 123;', 'emits response'); tt.end(); }); }); - t.test('index.html special case', function (tt) { + t.test('index.html special case', function(tt) { server.setFiles([coffeeFile, indexFile, jsFile]); - get('http://localhost:4001/', function (text) { + get('http://localhost:4001/', function(text) { tt.equal(text, '', 'sends index.html when / is requested'); tt.end(); }); }); - t.test('cleanup', function (tt) { - server.stop().then(function () { + t.test('cleanup', function(tt) { + server.stop().then(function() { tt.end(); }); }); - t.test('stop can be called more than once, without a callback', function (tt) { - server.stop(); - tt.end(); - }); + t.test( + 'stop can be called more than once, without a callback', + function(tt) { + server.stop(); + tt.end(); + } + ); t.end(); }); diff --git a/test/lib/sort.js b/test/lib/sort.js index 9b3f405aa..a90cc6673 100644 --- a/test/lib/sort.js +++ b/test/lib/sort.js @@ -4,169 +4,185 @@ var test = require('tap').test, sort = require('../../lib/sort'), path = require('path'); -test('sort stream alphanumeric', function (t) { +test('sort stream alphanumeric', function(t) { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var banana = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual(sort([ - apples, carrot, banana - ]), [ - apples, carrot, banana - ], 'sort stream alphanumeric'); + t.deepEqual( + sort([apples, carrot, banana]), + [apples, carrot, banana], + 'sort stream alphanumeric' + ); - t.deepEqual(sort([ - carrot, apples, banana - ]), [ - apples, carrot, banana - ], 'sort stream alphanumeric'); + t.deepEqual( + sort([carrot, apples, banana]), + [apples, carrot, banana], + 'sort stream alphanumeric' + ); t.end(); }); -test('sort stream with configuration', function (t) { +test('sort stream with configuration', function(t) { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual(sort([ - apples, carrot, bananas - ], { - toc: ['carrot', 'bananas'] - }), [ - carrot, bananas, apples - ], 'with configuration'); + t.deepEqual( + sort([apples, carrot, bananas], { + toc: ['carrot', 'bananas'] + }), + [carrot, bananas, apples], + 'with configuration' + ); t.end(); }); -test('sort stream with configuration and a section', function (t) { +test('sort stream with configuration and a section', function(t) { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; - var section = { name: 'This is the banana type', description: 'here lies bananas' }; + var section = { + name: 'This is the banana type', + description: 'here lies bananas' + }; var sectionMarkdown = { - 'name': 'This is the banana type', - 'description': { - 'type': 'root', - 'children': [{ - 'type': 'paragraph', - 'children': [{ - 'type': 'text', - 'value': 'here lies bananas', - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 + name: 'This is the banana type', + description: { + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'text', + value: 'here lies bananas', + position: { + start: { + line: 1, + column: 1, + offset: 0 + }, + end: { + line: 1, + column: 18, + offset: 17 + }, + indent: [] + } + } + ], + position: { + start: { + line: 1, + column: 1, + offset: 0 }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 + end: { + line: 1, + column: 18, + offset: 17 }, - 'indent': [] + indent: [] } - }], - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 - }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 - },'indent': [] } - }], - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 + ], + position: { + start: { + line: 1, + column: 1, + offset: 0 }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 + end: { + line: 1, + column: 18, + offset: 17 } } }, - 'kind': 'note' + kind: 'note' }; - t.deepEqual(sort([ - apples, carrot, bananas - ], { - toc: ['carrot', section, 'bananas'] - }), [ - carrot, sectionMarkdown, bananas, apples - ], 'with configuration'); + t.deepEqual( + sort([apples, carrot, bananas], { + toc: ['carrot', section, 'bananas'] + }), + [carrot, sectionMarkdown, bananas, apples], + 'with configuration' + ); t.end(); }); -test('sort an already-sorted stream containing a section/description', function (t) { +test('sort an already-sorted stream containing a section/description', function(t) { // this happens in the 'serve' task var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; - var section = { name: 'This is the banana type', description: 'here lies bananas' }; + var section = { + name: 'This is the banana type', + description: 'here lies bananas' + }; var sectionMarkdown = { - 'name': 'This is the banana type', - 'description': { - 'type': 'root', - 'children': [{ - 'type': 'paragraph', - 'children': [{ - 'type': 'text', - 'value': 'here lies bananas', - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 + name: 'This is the banana type', + description: { + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'text', + value: 'here lies bananas', + position: { + start: { + line: 1, + column: 1, + offset: 0 + }, + end: { + line: 1, + column: 18, + offset: 17 + }, + indent: [] + } + } + ], + position: { + start: { + line: 1, + column: 1, + offset: 0 }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 + end: { + line: 1, + column: 18, + offset: 17 }, - 'indent': [] + indent: [] } - }], - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 - }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 - },'indent': [] } - }], - 'position': { - 'start': { - 'line': 1, - 'column': 1, - 'offset': 0 + ], + position: { + start: { + line: 1, + column: 1, + offset: 0 }, - 'end': { - 'line': 1, - 'column': 18, - 'offset': 17 + end: { + line: 1, + column: 18, + offset: 17 } } }, - 'kind': 'note' + kind: 'note' }; var config = { @@ -179,7 +195,7 @@ test('sort an already-sorted stream containing a section/description', function t.end(); }); -test('sort toc with files', function (t) { +test('sort toc with files', function(t) { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -193,43 +209,47 @@ test('sort toc with files', function (t) { name: 'snowflake', kind: 'note', description: { - children: [{ - children: [{ + children: [ + { + children: [ + { + position: { + end: { column: 16, line: 1, offset: 15 }, + indent: [], + start: { column: 3, line: 1, offset: 2 } + }, + type: 'text', + value: 'The Snowflake' + } + ], + depth: 1, position: { - end: {column: 16, line: 1, offset: 15}, + end: { column: 16, line: 1, offset: 15 }, indent: [], - start: {column: 3, line: 1, offset: 2} + start: { column: 1, line: 1, offset: 0 } }, - type: 'text', - value: 'The Snowflake' - }], - depth: 1, - position: { - end: {column: 16, line: 1, offset: 15}, - indent: [], - start: {column: 1, line: 1, offset: 0} - }, - type: 'heading' - }], + type: 'heading' + } + ], position: { - end: {column: 1, line: 2, offset: 16}, - start: {column: 1, line: 1, offset: 0} + end: { column: 1, line: 2, offset: 16 }, + start: { column: 1, line: 1, offset: 0 } }, type: 'root' } }; - t.deepEqual(sort([ - apples, carrot, bananas - ], { - toc: [snowflake] - }), [ - processedSnowflake, apples, carrot, bananas - ], 'with configuration'); + t.deepEqual( + sort([apples, carrot, bananas], { + toc: [snowflake] + }), + [processedSnowflake, apples, carrot, bananas], + 'with configuration' + ); t.end(); }); -test('sort toc with files absolute path', function (t) { +test('sort toc with files absolute path', function(t) { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -243,38 +263,42 @@ test('sort toc with files absolute path', function (t) { name: 'snowflake', kind: 'note', description: { - children: [{ - children: [{ + children: [ + { + children: [ + { + position: { + end: { column: 16, line: 1, offset: 15 }, + indent: [], + start: { column: 3, line: 1, offset: 2 } + }, + type: 'text', + value: 'The Snowflake' + } + ], + depth: 1, position: { - end: {column: 16, line: 1, offset: 15}, + end: { column: 16, line: 1, offset: 15 }, indent: [], - start: {column: 3, line: 1, offset: 2} + start: { column: 1, line: 1, offset: 0 } }, - type: 'text', - value: 'The Snowflake' - }], - depth: 1, - position: { - end: {column: 16, line: 1, offset: 15}, - indent: [], - start: {column: 1, line: 1, offset: 0} - }, - type: 'heading' - }], + type: 'heading' + } + ], position: { - end: {column: 1, line: 2, offset: 16}, - start: {column: 1, line: 1, offset: 0} + end: { column: 1, line: 2, offset: 16 }, + start: { column: 1, line: 1, offset: 0 } }, type: 'root' } }; - t.deepEqual(sort([ - apples, carrot, bananas - ], { - toc: [snowflake] - }), [ - processedSnowflake, apples, carrot, bananas - ], 'with configuration'); + t.deepEqual( + sort([apples, carrot, bananas], { + toc: [snowflake] + }), + [processedSnowflake, apples, carrot, bananas], + 'with configuration' + ); t.end(); }); diff --git a/test/lib/walk.js b/test/lib/walk.js index 1f20f7928..10d9645e8 100644 --- a/test/lib/walk.js +++ b/test/lib/walk.js @@ -1,12 +1,9 @@ 'use strict'; -var test = require('tap').test, - walk = require('../../lib/walk'); - -test('walk', function (group) { - - group.test('flat comments', function (t) { +var test = require('tap').test, walk = require('../../lib/walk'); +test('walk', function(group) { + group.test('flat comments', function(t) { var comments = [{ name: 'Tom' }]; function renamer(comment, options) { @@ -17,27 +14,30 @@ test('walk', function (group) { } } - t.deepEqual(walk(comments, renamer), [ - { name: 'Tim' } - ], 'no-option case'); + t.deepEqual(walk(comments, renamer), [{ name: 'Tim' }], 'no-option case'); - t.deepEqual(walk(comments, renamer, { name: 'John' }), [ - { name: 'John' } - ], 'with options'); + t.deepEqual( + walk(comments, renamer, { name: 'John' }), + [{ name: 'John' }], + 'with options' + ); t.end(); }); - group.test('nested comments', function (t) { - - var comments = [{ - name: 'Tom', - members: { - static: [{ - name: 'Billy' - }] + group.test('nested comments', function(t) { + var comments = [ + { + name: 'Tom', + members: { + static: [ + { + name: 'Billy' + } + ] + } } - }]; + ]; function renamer(comment, options) { if (options) { @@ -47,25 +47,41 @@ test('walk', function (group) { } } - t.deepEqual(walk(comments, renamer), [{ - name: 'Tim', - members: { - static: [{ - name: 'Tim' - }] - } - }], 'no-option case'); + t.deepEqual( + walk(comments, renamer), + [ + { + name: 'Tim', + members: { + static: [ + { + name: 'Tim' + } + ] + } + } + ], + 'no-option case' + ); - t.deepEqual(walk(comments, renamer, { - name: 'Bob' - }), [{ - name: 'Bob', - members: { - static: [{ - name: 'Bob' - }] - } - }], 'with options'); + t.deepEqual( + walk(comments, renamer, { + name: 'Bob' + }), + [ + { + name: 'Bob', + members: { + static: [ + { + name: 'Bob' + } + ] + } + } + ], + 'with options' + ); t.end(); }); diff --git a/test/linker.js b/test/linker.js index 3e9c6be5b..2a4192e82 100644 --- a/test/linker.js +++ b/test/linker.js @@ -2,31 +2,34 @@ var LinkerStack = require('../lib/output/util/linker_stack'), test = require('tap').test; -test('linkerStack', function (t) { - +test('linkerStack', function(t) { var linkerStack = new LinkerStack({}); - t.equal(linkerStack.link('string'), + t.equal( + linkerStack.link('string'), 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String', - 'Default global resolution of string'); - - t.equal(new LinkerStack({ - paths: { - Point: 'http://geojson.org/geojson-spec.html#point' - } - }).link('Point'), + 'Default global resolution of string' + ); + + t.equal( + new LinkerStack({ + paths: { + Point: 'http://geojson.org/geojson-spec.html#point' + } + }).link('Point'), 'http://geojson.org/geojson-spec.html#point', - 'Custom hardcoded path for a GeoJSON type'); - - - t.equal(new LinkerStack({ - paths: { - Image: 'http://custom.com/' - } - }).link('Image'), + 'Custom hardcoded path for a GeoJSON type' + ); + + t.equal( + new LinkerStack({ + paths: { + Image: 'http://custom.com/' + } + }).link('Image'), 'http://custom.com/', - 'Prefers config link to native.'); - + 'Prefers config link to native.' + ); var linker = new LinkerStack({ paths: { @@ -34,15 +37,18 @@ test('linkerStack', function (t) { } }); - linker.namespaceResolver([{ - namespace: 'Image', - }], function (namespace) { - return '#' + namespace; - }); + linker.namespaceResolver( + [ + { + namespace: 'Image' + } + ], + function(namespace) { + return '#' + namespace; + } + ); - t.equal(linker.link('Image'), - '#Image', - 'Prefers local link over all.'); + t.equal(linker.link('Image'), '#Image', 'Prefers local link over all.'); t.end(); }); diff --git a/test/normalize.js b/test/normalize.js index a55135e47..fe457040c 100644 --- a/test/normalize.js +++ b/test/normalize.js @@ -1,8 +1,8 @@ 'use strict'; var walk = require('../lib/walk'); -module.exports = function (comments) { - return walk(comments, function (comment) { +module.exports = function(comments) { + return walk(comments, function(comment) { var hasGithub = !!comment.context.github; var path = comment.context.path; comment.context = { diff --git a/test/test.js b/test/test.js index e818a505a..71bc9faf3 100644 --- a/test/test.js +++ b/test/test.js @@ -33,7 +33,7 @@ function readOptionsFromFile(file) { } if (fs.existsSync(path.join(__dirname, '../.git'))) { - test('git option', function (t) { + test('git option', function(t) { var file = path.join(__dirname, './fixture/simple.input.js'); documentation.build([file], { github: true }).then(result => { normalize(result); @@ -57,151 +57,189 @@ if (fs.existsSync(path.join(__dirname, '../.git'))) { }); } -test('document-exported error', function (t) { +test('document-exported error', function(t) { var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); - documentation.build([file], { documentExported: true }).then(result => { - }, err => { - t.match(err.message, /Unable to find the value x/g, 'Produces a descriptive error'); - t.end(); - }); -}); - -test('external modules option', function (t) { - documentation.build([ - path.join(__dirname, 'fixture', 'external.input.js') - ], { - external: '(external|external/node_modules/*)' - }).then(result => { - normalize(result); - var outputfile = path.join(__dirname, 'fixture', '_external-deps-included.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); + documentation.build([file], { documentExported: true }).then( + result => {}, + err => { + t.match( + err.message, + /Unable to find the value x/g, + 'Produces a descriptive error' + ); + t.end(); } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); + ); }); -test('bad input', function (tt) { - glob.sync(path.join(__dirname, 'fixture/bad', '*.input.js')).forEach(function (file) { - tt.test(path.basename(file), function (t) { - documentation.build([file], readOptionsFromFile(file)).then(res => { - t.equal(res, undefined); - }).catch(error => { - // make error a serializable object - error = JSON.parse(JSON.stringify(error)); - // remove system-specific path - delete error.filename; - delete error.codeFrame; - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(error, null, 2)); - } - var expect = JSON.parse(fs.readFileSync(outputfile)); - t.deepEqual(error, expect); - t.end(); - }); +test('external modules option', function(t) { + documentation + .build([path.join(__dirname, 'fixture', 'external.input.js')], { + external: '(external|external/node_modules/*)' + }) + .then(result => { + normalize(result); + var outputfile = path.join( + __dirname, + 'fixture', + '_external-deps-included.json' + ); + if (UPDATE) { + fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); + } + var expect = require(outputfile); + t.deepEqual(result, expect); + t.end(); }); - }); - tt.end(); }); -test('html', function (tt) { - glob.sync(path.join(__dirname, 'fixture/html', '*.input.js')).forEach(function (file) { - tt.test(path.basename(file), function (t) { - documentation.build([file], readOptionsFromFile(file)) - .then(result => outputHtml(result, {})) - .then(result => { - var clean = result.sort((a, b) => a.path > b.path) - .filter(r => r.path.match(/(html)$/)) - .map(r => r.contents) - .join('\n'); - var outputfile = file.replace('.input.js', '.output.files'); - if (UPDATE) { - fs.writeFileSync(outputfile, clean, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.deepEqual(clean, expect); - t.end(); - }) - .catch(err => { - t.fail(err); - }); +test('bad input', function(tt) { + glob + .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) + .forEach(function(file) { + tt.test(path.basename(file), function(t) { + documentation + .build([file], readOptionsFromFile(file)) + .then(res => { + t.equal(res, undefined); + }) + .catch(error => { + // make error a serializable object + error = JSON.parse(JSON.stringify(error)); + // remove system-specific path + delete error.filename; + delete error.codeFrame; + var outputfile = file.replace('.input.js', '.output.json'); + if (UPDATE) { + fs.writeFileSync(outputfile, JSON.stringify(error, null, 2)); + } + var expect = JSON.parse(fs.readFileSync(outputfile)); + t.deepEqual(error, expect); + t.end(); + }); + }); }); - }); tt.end(); }); -test('outputs', function (ttt) { - glob.sync(path.join(__dirname, 'fixture', '*.input.js')).forEach(function (file) { - ttt.test(path.basename(file), function (tt) { - documentation.build([file], readOptionsFromFile(file)).then(result => { - - tt.test('markdown', function (t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: true }).then(result => { - var outputfile = file.replace('.input.js', '.output.md'); +test('html', function(tt) { + glob + .sync(path.join(__dirname, 'fixture/html', '*.input.js')) + .forEach(function(file) { + tt.test(path.basename(file), function(t) { + documentation + .build([file], readOptionsFromFile(file)) + .then(result => outputHtml(result, {})) + .then(result => { + var clean = result + .sort((a, b) => a.path > b.path) + .filter(r => r.path.match(/(html)$/)) + .map(r => r.contents) + .join('\n'); + var outputfile = file.replace('.input.js', '.output.files'); if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); + fs.writeFileSync(outputfile, clean, 'utf8'); } var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); + t.deepEqual(clean, expect); t.end(); - }).catch(error => t.ifError(error)); - }); + }) + .catch(err => { + t.fail(err); + }); + }); + }); + tt.end(); +}); - if (file.match(/es6.input.js/)) { - tt.test('no markdown TOC', function (t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: false }).then(result => { - var outputfile = file.replace('.input.js', '.output-toc.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }).catch(error => t.ifError(error)); +test('outputs', function(ttt) { + glob + .sync(path.join(__dirname, 'fixture', '*.input.js')) + .forEach(function(file) { + ttt.test(path.basename(file), function(tt) { + documentation.build([file], readOptionsFromFile(file)).then(result => { + tt.test('markdown', function(t) { + outputMarkdown(_.cloneDeep(result), { markdownToc: true }) + .then(result => { + var outputfile = file.replace('.input.js', '.output.md'); + if (UPDATE) { + fs.writeFileSync(outputfile, result, 'utf8'); + } + var expect = fs.readFileSync(outputfile, 'utf8'); + t.equal(result.toString(), expect, 'markdown output correct'); + t.end(); + }) + .catch(error => t.ifError(error)); + }); + + if (file.match(/es6.input.js/)) { + tt.test('no markdown TOC', function(t) { + outputMarkdown(_.cloneDeep(result), { markdownToc: false }) + .then(result => { + var outputfile = file.replace('.input.js', '.output-toc.md'); + if (UPDATE) { + fs.writeFileSync(outputfile, result, 'utf8'); + } + var expect = fs.readFileSync(outputfile, 'utf8'); + t.equal(result.toString(), expect, 'markdown output correct'); + t.end(); + }) + .catch(error => t.ifError(error)); + }); + } + + tt.test('markdown AST', function(t) { + outputMarkdownAST(_.cloneDeep(result), {}) + .then(result => { + var outputfile = file.replace('.input.js', '.output.md.json'); + if (UPDATE) { + fs.writeFileSync( + outputfile, + JSON.stringify(result, null, 2), + 'utf8' + ); + } + var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); + t.deepEqual(result, expect, 'markdown AST output correct'); + t.end(); + }) + .catch(error => t.ifError(error)); }); - } - tt.test('markdown AST', function (t) { - outputMarkdownAST(_.cloneDeep(result), {}).then(result => { - var outputfile = file.replace('.input.js', '.output.md.json'); + tt.test('JSON', function(t) { + normalize(result); + result.forEach(function(comment) { + validate( + comment, + documentationSchema.jsonSchema + ).errors.forEach(function(error) { + t.ifError(error); + }); + }); + var outputfile = file.replace('.input.js', '.output.json'); if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2), 'utf8'); + fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); } - var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); - t.deepEqual(result, expect, 'markdown AST output correct'); + var expect = require(outputfile); + t.deepEqual(makePOJO(result), expect); t.end(); - }).catch(error => t.ifError(error)); - }); - - tt.test('JSON', function (t) { - normalize(result); - result.forEach(function (comment) { - validate(comment, documentationSchema.jsonSchema).errors.forEach(function (error) { - t.ifError(error); - }); }); - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(makePOJO(result), expect); - t.end(); - }); - tt.end(); + tt.end(); + }); }); }); - }); ttt.end(); }); -test('highlightAuto md output', function (t) { - var file = path.join(__dirname, 'fixture/auto_lang_hljs/multilanguage.input.js'), - hljsConfig = {hljs: {highlightAuto: true, languages: ['js', 'css', 'html']}}; +test('highlightAuto md output', function(t) { + var file = path.join( + __dirname, + 'fixture/auto_lang_hljs/multilanguage.input.js' + ), + hljsConfig = { + hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } + }; documentation.build(file, {}).then(result => { outputMarkdown(result, hljsConfig).then(result => { @@ -210,18 +248,24 @@ test('highlightAuto md output', function (t) { fs.writeFileSync(outputfile, result, 'utf8'); } var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'recognizes examples in html, css and js'); + t.equal( + result.toString(), + expect, + 'recognizes examples in html, css and js' + ); t.end(); }); }); }); -test('config', function (t) { +test('config', function(t) { var file = path.join(__dirname, 'fixture', 'class.input.js'); var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); - documentation.build([file], { - config: path.join(__dirname, 'fixture', 'simple.config.yml') - }).then(out => outputMarkdown(out, {})) + documentation + .build([file], { + config: path.join(__dirname, 'fixture', 'simple.config.yml') + }) + .then(out => outputMarkdown(out, {})) .then(md => { if (UPDATE) { fs.writeFileSync(outputfile, md); @@ -236,24 +280,33 @@ test('config', function (t) { }); }); -test('multi-file input', function (t) { - documentation.build([ - path.join(__dirname, 'fixture', 'simple.input.js'), - path.join(__dirname, 'fixture', 'simple-two.input.js') - ], {}).then(result => { - normalize(result); - var outputfile = path.join(__dirname, 'fixture', '_multi-file-input.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); +test('multi-file input', function(t) { + documentation + .build( + [ + path.join(__dirname, 'fixture', 'simple.input.js'), + path.join(__dirname, 'fixture', 'simple-two.input.js') + ], + {} + ) + .then(result => { + normalize(result); + var outputfile = path.join( + __dirname, + 'fixture', + '_multi-file-input.json' + ); + if (UPDATE) { + fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); + } + var expect = require(outputfile); + t.deepEqual(result, expect); + t.end(); + }); }); -test('accepts simple relative paths', function (t) { - chdir(__dirname, function () { +test('accepts simple relative paths', function(t) { + chdir(__dirname, function() { documentation.build('test/fixture/simple.input.js', {}).then(data => { t.equal(data.length, 1, 'simple has no dependencies'); t.end(); @@ -261,8 +314,8 @@ test('accepts simple relative paths', function (t) { }); }); -test('.lint', function (t) { - chdir(__dirname, function () { +test('.lint', function(t) { + chdir(__dirname, function() { documentation.lint('test/fixture/simple.input.js', {}).then(data => { t.equal(data, '', 'outputs lint information'); t.end(); @@ -270,11 +323,15 @@ test('.lint', function (t) { }); }); -test('.lint with bad input', function (t) { - chdir(__dirname, function () { - documentation.lint('test/fixture/bad/syntax.input.js', {}).catch(err => { - t.ok(err, 'returns an error when syntax is incorrect'); - t.end(); - }); +test('.lint with bad input', function(t) { + chdir(__dirname, function() { + documentation + .lint('test/fixture/bad/syntax.input', { + parseExtension: ['input'] + }) + .catch(err => { + t.ok(err, 'returns an error when syntax is incorrect'); + t.end(); + }); }); }); diff --git a/test/utils.js b/test/utils.js index 539bf347e..ad1614cd0 100644 --- a/test/utils.js +++ b/test/utils.js @@ -1,15 +1,16 @@ 'use strict'; -var http = require('http'), - concat = require('concat-stream'); +var http = require('http'), concat = require('concat-stream'); function get(url, callback) { - http.get(url, function (res) { - res.pipe(concat(function (text) { - if (res.statusCode >= 400) { - return callback(res.statusCode); - } - callback(text.toString()); - })); + http.get(url, function(res) { + res.pipe( + concat(function(text) { + if (res.statusCode >= 400) { + return callback(res.statusCode); + } + callback(text.toString()); + }) + ); }); } From cf2ef2bc50b7af3efece730b7b4d3b45ab3eb450 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 10 Apr 2017 16:19:11 -0400 Subject: [PATCH 020/555] =?UTF-8?q?Update=20dependencies=20to=20enable=20G?= =?UTF-8?q?reenkeeper=20=F0=9F=8C=B4=20(#711)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update dependencies https://greenkeeper.io/ * docs(readme): add Greenkeeper badge https://greenkeeper.io/ * chore(greenkeeper): Exclude remote-origin-url and yargs from Greenkeeper for now --- README.md | 2 ++ lib/commands/readme.js | 2 +- lib/inline_tokenizer.js | 6 +++--- package.json | 34 ++++++++++++++++++++-------------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 9ae967c85..bf78e7e3c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # documentation +[![Greenkeeper badge](https://badges.greenkeeper.io/documentationjs/documentation.svg)](https://greenkeeper.io/) + [![Circle CI](https://circleci.com/gh/documentationjs/documentation/tree/master.svg?style=shield)](https://circleci.com/gh/documentationjs/documentation/tree/master) [![npm version](https://badge.fury.io/js/documentation.svg)](http://badge.fury.io/js/documentation) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/documentationjs/documentation?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) diff --git a/lib/commands/readme.js b/lib/commands/readme.js index 9573c0e24..27202da4e 100644 --- a/lib/commands/readme.js +++ b/lib/commands/readme.js @@ -114,7 +114,7 @@ module.exports.handler = function readme(argv /*: Object*/) { }; // wrap the inject utility as an remark plugin -function plugin(remark, options) { +function plugin(options) { return function transform(targetAst, file, next) { if (!inject(options.section, targetAst, options.toInject)) { return next(new Error(`Heading ${options.section} not found.`)); diff --git a/lib/inline_tokenizer.js b/lib/inline_tokenizer.js index 062ce30f9..1c5eb907e 100644 --- a/lib/inline_tokenizer.js +++ b/lib/inline_tokenizer.js @@ -56,11 +56,11 @@ var tokenizeTutorial = makeTokenizer( * This does not handle the `[text]({@link url})` and `[text]({@tutorial url})` forms of these tags. * That's a JSDoc misfeature; just use regular markdown syntax instead: `[text](url)`. * - * @param {Object} processor - remark instance + * @param {Object} options - for the plugin * @returns {undefined} */ -module.exports = function(processor /*: Object*/) { - var proto = processor.Parser.prototype; +module.exports = function(options /*: Object*/) { + var proto = this.Parser.prototype; proto.inlineTokenizers.tokenizeLink = tokenizeLink; proto.inlineTokenizers.tokenizeTutorial = tokenizeTutorial; var methods = proto.inlineMethods; diff --git a/package.json b/package.json index c20fc3320..d21136ce8 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "documentation": "./bin/documentation.js" }, "dependencies": { - "ansi-html": "^0.0.6", + "ansi-html": "^0.0.7", "babel-core": "^6.17.0", - "babel-generator": "6.19.0", - "babel-plugin-system-import-transformer": "2.4.0", + "babel-generator": "6.24.1", + "babel-plugin-system-import-transformer": "3.1.0", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2015": "^6.16.0", "babel-preset-react": "^6.16.0", @@ -38,12 +38,12 @@ "micromatch": "^2.1.6", "mime": "^1.3.4", "module-deps-sortable": "4.0.6", - "parse-filepath": "^0.6.3", + "parse-filepath": "^1.0.1", "pify": "^2.3.0", "read-pkg-up": "^2.0.0", - "remark": "^6.0.1", - "remark-html": "5.0.1", - "remark-toc": "^3.0.0", + "remark": "^7.0.0", + "remark-html": "6.0.0", + "remark-toc": "^4.0.0", "remote-origin-url": "0.4.0", "resolve": "^1.1.6", "shelljs": "^0.7.5", @@ -62,18 +62,18 @@ "devDependencies": { "are-we-flow-yet": "^1.0.0", "chdir": "0.0.0", - "cz-conventional-changelog": "1.2.0", + "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", - "flow-bin": "^0.37.4", - "fs-extra": "^1.0.0", + "flow-bin": "^0.43.1", + "fs-extra": "^2.1.2", "husky": "^0.13.3", "json-schema": "0.2.3", "lint-staged": "^3.4.0", - "mock-fs": "^3.5.0", + "mock-fs": "^4.2.0", "prettier": "^0.22.0", - "standard-changelog": "0.0.1", - "tap": "^8.0.0", - "tmp": "^0.0.29" + "standard-changelog": "1.0.1", + "tap": "^10.3.2", + "tmp": "^0.0.31" }, "keywords": [ "documentation", @@ -110,5 +110,11 @@ "*.js": [ "prettier --write --single-quote" ] + }, + "greenkeeper": { + "ignore": [ + "remote-origin-url", + "yargs" + ] } } From 3a92ab96218bdda67808184bb24206b2f9c08a66 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Apr 2017 16:33:31 -0400 Subject: [PATCH 021/555] build(package): Remove extend, debounce, and resolve dependencies (#713) extend and debounce are swapped for lodash versions, and resolve was no longer used Fixes #712 --- lib/commands/build.js | 7 +++---- lib/commands/serve.js | 7 +++---- lib/parsers/polyglot.js | 4 ++-- package.json | 3 --- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/commands/build.js b/lib/commands/build.js index 52b7dbb22..63def7210 100644 --- a/lib/commands/build.js +++ b/lib/commands/build.js @@ -6,10 +6,9 @@ var streamArray = require('stream-array'), path = require('path'), fs = require('fs'), vfs = require('vinyl-fs'), - extend = require('extend'), chokidar = require('chokidar'), documentation = require('../../'), - debounce = require('debounce'); + _ = require('lodash'); module.exports.command = 'build [input..]'; module.exports.describe = 'build documentation'; @@ -20,7 +19,7 @@ module.exports.describe = 'build documentation'; * @returns {Object} yargs with options * @private */ -module.exports.builder = extend( +module.exports.builder = _.assign( {}, sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, @@ -105,7 +104,7 @@ module.exports.handler = function build(argv /*: Object*/) { function updateWatcher() { if (!watcher) { watcher = chokidar.watch(argv.input); - watcher.on('all', debounce(generator, 300)); + watcher.on('all', _.debounce(generator, 300)); } documentation .expandInputs(argv.input, argv) diff --git a/lib/commands/serve.js b/lib/commands/serve.js index dfa7e6f7c..ebc386878 100644 --- a/lib/commands/serve.js +++ b/lib/commands/serve.js @@ -3,12 +3,11 @@ var errorPage = require('../../lib/serve/error_page'), fs = require('fs'), - extend = require('extend'), path = require('path'), chokidar = require('chokidar'), sharedOptions = require('./shared_options'), Server = require('../../lib/serve/server'), - debounce = require('debounce'), + _ = require('lodash'), documentation = require('../../'); module.exports.command = 'serve [input..]'; @@ -19,7 +18,7 @@ module.exports.description = 'generate, update, and display HTML documentation'; * @returns {Object} yargs with options * @private */ -module.exports.builder = extend( +module.exports.builder = _.assign( {}, sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, @@ -66,7 +65,7 @@ module.exports.handler = function serve(argv /*: Object*/) { function updateWatcher() { if (!watcher) { watcher = chokidar.watch(argv.input); - watcher.on('all', debounce(updateServer, 300)); + watcher.on('all', _.debounce(updateServer, 300)); } documentation diff --git a/lib/parsers/polyglot.js b/lib/parsers/polyglot.js index 3fcd70cbc..dccb9c070 100644 --- a/lib/parsers/polyglot.js +++ b/lib/parsers/polyglot.js @@ -2,7 +2,7 @@ /* @flow */ var getComments = require('get-comments'), - extend = require('extend'), + _ = require('lodash'), isJSDocComment = require('../../lib/is_jsdoc_comment'), parse = require('../../lib/parse'); @@ -18,7 +18,7 @@ function parsePolyglot(sourceFile /*: SourceFile*/) { .filter(isJSDocComment) .map(comment => { var context = { - loc: extend({}, comment.loc), + loc: _.clone(comment.loc), file: sourceFile.file, sortKey: sourceFile.file + ' ' + comment.loc.start.line }; diff --git a/package.json b/package.json index d21136ce8..def2c53f6 100644 --- a/package.json +++ b/package.json @@ -22,10 +22,8 @@ "chalk": "^1.1.1", "chokidar": "^1.2.0", "concat-stream": "^1.5.0", - "debounce": "^1.0.0", "disparity": "^2.0.0", "doctrine": "^2.0.0", - "extend": "^3.0.0", "get-comments": "^1.0.1", "git-url-parse": "^6.0.1", "github-slugger": "1.1.1", @@ -45,7 +43,6 @@ "remark-html": "6.0.0", "remark-toc": "^4.0.0", "remote-origin-url": "0.4.0", - "resolve": "^1.1.6", "shelljs": "^0.7.5", "stream-array": "^1.1.0", "strip-json-comments": "^2.0.0", From d7fb94e07573ce0027fc3121582b486a7b08db65 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Apr 2017 17:23:16 -0400 Subject: [PATCH 022/555] docs(readme): Improve README: add new logo, simplify (#714) Also moves the GreenKeeper badge to the correct line --- .github/documentation-js-logo.png | Bin 0 -> 33868 bytes README.md | 49 +++++++----------------------- 2 files changed, 11 insertions(+), 38 deletions(-) create mode 100644 .github/documentation-js-logo.png diff --git a/.github/documentation-js-logo.png b/.github/documentation-js-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..595163c503b35883a655751e0d80c2bfddd112f5 GIT binary patch literal 33868 zcmdSAWmHsq*f%_YfJjM63J6HUP|~GzcXtdS-6bX6N|zuY4bt7+42^UNNDkfcZanAQ z>;3rL&$nl zJ2@6Pdl86*rKG1LM8#8H)x^`vgvXRZNbm)}J1;PS4aC`q+}+07)`{0$fa34GyujzD z+h7XvzmGUu2~fO$T98~*PLW*1&JjZXj+v9mgq59}oQsE<^&Jm48wVpf8w)EZn1u(- z%E83K%FDvT%fd?j??oZ_f}G#c)QneIRQ%t?fNug67S7K0ykM}Kn;WwmJF}gmIhd7) zhX>5U24-Vp0-j)U^00L_a%Zx2qI{a-pE*P!P9~0)_Rf}ew&YK98X4QUI15lvfS(ot z|GNrsJn;XV5BTyw6oS|SWN`$}PcHS77X%^)Nr}E!bx+@4@^B}<^Z?($K;-o>zMgN{ z1$vdHQi%|$#7%EEl0Mh;JgxbK#UDFT6HcC)}64rm$ zSCB}hhF|D^*90;`xafZuRV17k#eWxeuOG#KgRoFcgunhbBs7rqyX1dEL^}x-ss0;6 zVT4AD{ok0cEJ(Ov|BaC(_m z5*mI%XOZqL%rx>t$qVZvFyrUEGKjPO{0xDOijqo_MJg}sktpt7f#yGIr3S-^!RgN- zXYOZS4Iua5wA4PM`}key^RudWI8gr=SwBX^N8%eoKf*0bA>>CsZyu?{FK-~i@Dv%D z|B=;#8VNV(55fCLcL*Wr95Tp$NMFx@Po10{fpC(IF{+Z40%7v`hH3EDaHL$0X|j7H zZeoiinwcLPL)^bp(B`s!r)@`WyZLbX#f^f29d~Rh!a@7Ufqu+Fm^RIkqMl9y(^VSV z@H5JUXuBi*Eq1>!OR*Du6FcM3e^Z32vW8QT`w3TStQDPutGvdBNof;LPI*{=+`enZ6vp66I6|Ec4d4q?aTe)}&;r18;cUmOjf(dsjO zm`ffQ97IFEPhmt4G4gzsXC3-n+sx3+o}HgT<;BD6EbHNZ{j~q2u&N{UGf3zRoq2rP zoSs2tB}+({mVupZESU~5W|tt|Q}>#+NNcRAS{ z?(lLX_Wr-ppMAyhop$x(>%kB4l7c*E4HH}pDxWzh$GFumF}uZaYTxT}*M!pK-73d><7!=?bqUWiM_J))bb1P4Ee0^CzB zaN8Qr66(-T1$9>Pbyf2Jqm~x>>v)-dAa>j^+9)~n`}eWH(+rqUzcg`yitM>$qMNw%lHswj%z+7ef;@Ah z!QjyE5F|4suKdgS;pD4bG&6|!#r!{XN`<+f=TJNei+^aSndSc-vnF06gws4^#O9c~EH>(VOkVT}-9e6~lq7xDE%|_;XOE<;m zv^AD#2$lmG&3!Y{%J{n~-DmTB`sA!9#9hk^ejt|u9!>}`Z-1%p$_!0cw+)2r4K3Wt z%8ZJ|5}#ukw{t4OqzQR=35bUh2O4eBkJgb`khtf1;%;G z@L+fM5ot2HRL9Bjk>hE~<~H@fvo2As8`Zf+f31|Kjl&Zts&>#ppFR$-CnOZwO^5y; z>ytDxu=D4Eo>Wg8A6M(539+T$OG}`8pNeIXPLIhIg1PgRvWjzrMd6mGayAbomV}5j zFtkMONj8<9hWhWOA${``gjT*4f!jCTR(&NhyOM zcJgwP04!&pbpZ@+8;&)9nkV(K8E3m?far!DFEXC`k$5-{K%+3y{dlTC^jj2YE84}x zvzLiWgo&F^(&5x=r;G>J!WV<{v}HZ9{|%?cKRpRn=BS&+U&WLpQxWlvjY}W|mewM| z=sIJRoqLH@J={LLx^OM`77986Z0zB&R^dk1Xi+9B1EMq z+ZRAh)v2im`;0zQArAF*4UL#5W~Nc$py5DvR3LjuW)N(w5tSzy`Aqna6Tl(#zf&hA zW0vm)6y#2W>`$l0QsVy<*TsB3G8j)j@|;6HAtbFUJP)W?E zJu56rQ9kjBf&zQvTYaMJ%vffj;SY}M6+=#l#UF(;!+feY*1r_oFCgVf)PCjrqvebW z6pckkDrFSy6^u_}DJmLI{lDPTTTB3TK9LN5_-E{ok01XiI99R&%1bTNWt5x|L`O{V zIgv1#a4~(^irs|58v7r8a;{mY5e^zg``5L~j(-Pe18j_pJU)St&|*0Lvxql!6&tIP zAO;Q&?OT;IJe)+1$$QcY_2D&Scd=ORsJdZ zEde5(>kF(Re8P=?R1nx~b}?}iw>)5)UueNnPXFDAXuPs4b`w&tiLg@8a?SPs+|@=K zR!RrFD#T&=|M5vFxsQ2B5W-)4+RyyYX?31vmqg17+Gxu1`&aIP8B7g>*8#kwUk&_^ zP85S*2o%wPrQwC(2lNr2B<<;vW(yP1$}_L#*B0}Z@{@vWB|H4l2?54l@B5K(rLd+0)oe9atg@Zdu$D=`A z9+unvrbO&L^dA#Tky@9W#SK`x7u@kd*gI|px9^akXMOklx#$q067;_c2cWvKF=mgY z=1ECA!)Y6MMXkxIELk%%_=Q#YSbY{^F|73!BA(cQzF2nr+aWgQ*R6h4Ui0JL zKTu7&FicI&znei`zp~Q{o{6&gB0G$h^P8PT#DNG27w?JlD8_rl)B6qK#e{zY1nI<| zCiutmn6B+SY@7#|IRfe=-iIRTzZ{;qeL9EZD7BHAAi~aN?kj&?_An{)hsV=n9@fGP zW^P&Wmw~yhcJETwpMno1)P3Y*XJTpl`zcl|sk9PPLh(hC%8<#TGbJxRj`9D#yv900 z40*WX7j#dzt+$qsywD!^u0%cHixK&qqot@9D0Fw6N#*JC1hll_ab;vZX)!QWy-`E9 z^))gdYzR6YZwa1~CqV;$=yvOc4mXoY(a_9K%l7*fAA;EKSQY7v%`Nrn)U??)GX`LFoA?&`XngQ!QPMeGbM?zPcZn!=;Q7ZG^JFYyA!xyo~2cu z!wDODDB8pntk@xyvVd`e*D@3S8k_&)r>u9%yz=Xrz^5pnbMA)e58oX7ULTK*@tmgU zX$r~n)vKWp^Ly_6o)o{DH`wOuiiws_n?MYyR6KchxBK=|EdA&S7Jl%_!1~ik%}3d+ znyE#1`dF=F2#l#Z(}$p#ZaBXCYb!i%JxHF2ISt>fX6>;Bzg z1jsKokB$EVnkjceG;W=H!+F-&T;(I{BL?Rfeu7=jDZ10cewZ@3L9bKvP9Gf?A`IHavGvp(8ilRs?59;`_sMu} z1_%S~4?3a^K@C+tkvv>D=vJvX!1U{pXjyVyZX)mf1aRr3;2%Ip&~pZ6m5TBY|I7#W z&d>K;2s@+7n~K|AC@;!I60dRxmu5FAmoz%rz|V%#dYj_?{_dl!<+2=~PoiHLcGfk^l z!{K_)l%^6Jaoc)M&L9)osr!h`^#XZQL!kVXOkJ5YAS8wCgCv94fFp?r7X~LLjUiJe z=8~e?tfK%JGHdT`FLLC(8$*1JsulZ2sU(~FtyXkRk4(oIqw^C)_bcQ~(f5#DM6s~g z!sbG3H}6wQmTj|M-QIZ1&I|C8KT~Eap|Kh# zl0w^}%lpY;9*VdbB&Cg$TI@U*9Q(d=MyQc+WR|JBP_J*yr2uCmhuIX*G{+3WG;gaL zoaj>e1#NhZJUq`xjh*y%+}y!>`;Bw6*Q=SKR|F&CxLk?GYrUL|ORd;EVpXs@$#_~b zmP!66xNcrmd?g*d_Vdj&{=*+CjWL#F+aD%2wqr=*QIhVW%ebCW;Oz;WPB# zW`Y6q@UCuiah!*~Js=S+q>CRlaOL0C5NzmtIXnq(8dXWdJ+rX6K9+Y4Z|VzYI!fhD&0uM-L07 zO{iGp!Ct{agk$+Gc|&}tdYDN|NcCIe$W{RG)B4B1g|GkBfHB&*%V1Y}R97DI>DuvI_!1gA;ZMaX;sE44 zOuoFK@xuE>7M>7l1tQL-8`EFLjAeAo!=xO9ZU zU^--6bZW{M+-pG0_|sUh46}*UmoQ-47?YKufcb-XqE=r`_S`Bb6-BnQiRl$1yc4I% zlTZDl&A)08Cu0a-t=;gqeL~kw7u> zO*;zo2YcBNdYUw5&k6MtYGfD30i-XxyGJFkfT`)#R{J9iD`WlLDgz41;1kPO0Y;B= z2V4K)n+^DSXr$RF!7}mgSyE4!Llde`3|Z{^59;qZ!#_qS&FF>=2B{V3%!M{je45^_ zJu6ahXD*Z(@n`gj!3SW3^^@iELF?F8Bzck7PP8XppZ>IsMP!Y>*Ypf#UF0D+)&~j8OEEjjoGL0C1jpVet1^~+ zP?LE#+@RH1Rs{&i&{lV{3mWqRK{}-gK^6CEd1MExVSu+GZtb$t-Er9?THbJE;LnKt z(=LcxhozJ8@VcMXR2b_J0STomcgX8COQy$^vNVcc-``c#|1F}|AxiUgCJ+=)zzYk)(uZjLw{+%h?WWBU@E<0 zl{?&E8vPr>2?iZ)jDCV0($4m4K{Pi^qaRk!XBgDoNjB`YzQqk~CTvr-6@lK?Kxpj> zMW?er#=ldgx?kBNzHH~=4QAaV=oKgFfcBKXj($%pep_089%+1=bSOGG|LT|~!GCQi z;18b@A_D%+xLY30ZfmlEnqO?NqbhUBhmlxqT(u;sRfB@^RDaO?3a@|5<2m(W^soDi z&V(PwAa# z7m1l=JgiWD+&bkXscT{}tLPFm4e%Z#z026G>U4xWn+xJ`Uo9h*x}cY5Cxg!Y+}beV zJ&p2Ot!!GYpMbFO;7!!4(491{st!vQWFx(6e~!k z4DrH;p=3$jT`$9O8x<)B&I1pTwt!hwN`w%w@rp~e!WEar-uAe#yE{4OeZG*W%;oT! zOS`d+Oi?0MsbR%*y7N{nxT~bygk8JZ^T@39m*8i z_aq*B^xbty>kn)rwe|_BB8{y3F>b%3U-%G{1h{5x(-%dzB^4~Jbt=x1H`|iw;^4oz z2t$3jAX?7C54Z&H#j?isJbHV_A7)TUysufrn-YXz7jVRYpLIss_8AAKtyohx$m&op zBxn{K-E{6>y7GCWDSCaXxDP;nW!)J|!hlJ(;0|_`+mC=6s4q7m4cX}@#FN+4Y9)?) zH4>X&R_B;J@ivoH&Gfi&$yRx@VhX$L-OHg zqu&4mTtaa0>NfqAI_~qfa8sd_IYLmYQW5ey{TTaSr8MQ4-58J z0{XglNAMW@HDn^&$Y$riI#bVxw%!b}dCD8~Hnf=AyI#`OA8ZuG9CHg0@Cx~5og&m9 zjm{0Ma9LaQP8=|deX?OdBOGYCO2J$h+jHzuEfA;hBJ%v z5g#+XufaQi+^tgL4=bE6s8*lBx<%cYtdZmTwlWA$)8$f|vC(MYcS9B95clbYRP#No ztYhO01Zu=EFcoGUVG&`Cr5a+(j}aZ;ChPW@T{A61dKW51wr7`4Z9 zAyk2koT<9pC+7W-Qr2z}4Q{{Q=gMeLpiG*^SJg`r3K=K4eMkqkSD}Hqac^*_)_jDk zwyYkO*5*z#NMyERU~SzUjhW$zPvc4w<|P0kFJ>X;y5F&}X!t1?w>=r|wiqyJm)Sjz zk6E<*Jhil^j`PrRK*Wx4^3I zcvZ&2UM7QPgtsooNqIK{f{}c>1Xa8&i#&lDlS|x}>P^&{DenAtT?*ORxx7YDFfu&% z<1!(M`$wT*FfFE8TIpgXzwYHPbj@a)AZGul>uPj8P8!$8zT)~jqwU{4kGj_PcTAcd zeW^S`g8Dl?qrDp@p7W2tNl8>2@=~G>9yeSWTRalXpj=W&jS705<4J;%^OH5MatI$a zrgEw);1MC${e#f=X7beJh;fqq%$WSlT-E`cXz4JqzT54*rB5Ra(7r_IQsm$k{rro%55cEl#b$cMW}ozVZxS;8222x? z!4yVR_1PRF8}`9821Ql1$l-KZ0$FkQz83pvUKVGEmm2c=y>oT*G_dw_l9osV-?i;u z54j5!?t3SeP_C)MPj8Gkh=Zi_aUg)Dg9#i*8{?bm5|;z;?UdS>i8kQHDOfPk4W zo3Id$H@dKXOq|IsDTMdv@nA7edn2bi)zH_=YU|d)$q~Lb`o@{8De$mMFD{0xuHooV zVWqPIU#PoQs0A;|>eZ;HfF5VQ8QgK~O=W%N#^S;OQ3;CTqT(wzmT|tr_t5df`q^BI z_Z7x0$I@Q-%Xdk7lNXntcPTgw+Fqh2&g7IgK5r0fU@=R6d33#2%`@&>i+|9hAltO? z+V)6RDC1@jY~QCr_7c1j>tE%iV00PdDrV|9Rc0mHHUBD}OXGWa^YauO!VueS?%<}7 zF^}&EfEd4T$G>jj7ToP*cw9Nvy!>@uf4DXx)rR%*2-)8A(xLfw#Var2?MQq|Qdkfd z^ZTVrPat^*1o`;AXq0#QWcwnnfOXxtYcjXr35X8u%kVjPHhO5=*Q;RDvD;J@#iz(_ z=3wDik*<+Z=3cSrcJX5QZoHV_F!|;uT?yTX$zF9vO>M4xZ-?(K_-*%tU|c zR4O>DyaYVde#7;x>AdYTNb@zA53fqAGQzQZD~EW@(_3d4CqI&r-7(xzX+|-uhl{yy zOTnhAkSk`R#h?|TY$(DH8Z-Lc}kf#MufCCP2LaXiG?d!hVcLe%tq=mwRMOfr;p);kn-lwak7ey!u{Jfek#|*%+fA zzQA7YApIUcMwqUkbAw10KzM9@Ica<|uBwi3j{hhuf9Q&!I$#^G!U zvb)=ZvD!C+x7cz=HZ?ED#5v0BqKKYjyek^1N;6A0C>y^FVk2VF)}5F5kl3@?M8fNqyLhiWsl8;d#aQQw`0})HLO*UUEdy z3?g80YyR*%liJ@C5W>%$w{)K&g_DxrkZQlZrJ** z>i83oe0%qZvc={T<;8KRaU6)K|NU zLn>f2c5hZOF+y)vHEzkJ+HYc($nQSYK8*8}N^k_J9YaV>x6Ia@6nqImtEX3=(d#Ap zfY>oG`VzW!5;6`ulE~>nN%m%O%*=>bpYM06xQJd&fC&g`wQ4ry!KDdR*|^TV$1b-x zRhAS-;cL4!o)Y`*7pc*9iA{Pt3ni!IW8Y;1A^_LB`_oBJ!%|N}rWqk;fy$EvSaS$N z5pxHE?>S4xRaIu+@ZG{?+){y#Rt%8lT-%=hO!CFSx$ph{{lH-|&B1j7;;*X#CX1zN zQ+2|i+;hBom=5N~x5rzgXaQf^b(kJ9@A2?#X8Y50m8eeJ)ep6THiG$Ls1)G({eT?z z&07^5m%X1h-CGJPffF}c@vA8N5kO?j*Y=1_>V2o;MDz>5eU7HJ@3|-H2W@Tw@?842 z+pj0t`lzHj2a#vi=Wn^l^SSM2pmb8$sWY|NyCJAYCo6(DHIGRoUyipn_>9O%dR$_x z$M5)DT5Y1_P;L7A=e!8*L(3pu*e@FhN7{866@*W+xms+jnEKZ`&lqz+YLDL<}-DBiFu z3HkW8%}bw^!Qoo3*x{b0_9NT7@$K`qZ<(#EDRfj)*n&5hF>s)ahf@PO!HZtN3^Uj^ zQ6IXzd;@q-SNmS>u(p-3o6BJIkzWtj3tx4zN5U$hdtI#t`_Y~q7@%S@-4J5I2BxiV z>w&TUIAyOpbcE*dZZS+$2oLXuZk0-oahLs3Tin-l6cmV49UfPF&|DZ&14&_**EB<_ z-nQUHd9GeY3?K#Xu%n1P3ge+{X3q4w8FDyxRCU^sMApCAf(2G0!ESmb)-#S6Z|{zR zmWg990YC?Wvm9@A=gdDJo?H)GnEgWAC*;KCYR8l9W%eca>$1$A`VmBxJQN)vU(`fv z9jw`@x!H-rcZ1@qPETvdj!L>n#o3)!Mdt%+&b zKHQ-dlayOWBD(J^v;h$nl8QP~t@oOGwT)iln76~| ziVEAROT>90pP)mP*Z`BS55D%#2qBe0LzZF7wBB_>;y%Zw@42sUbCd#H z+10=Xelb3mI8IszS}D+NYkt8zGM<-yP#oFeulI27y)8%ei-1dQxJTTxne&bNGV$tN zt=Tpn+tF5xLC-)^{^b|_+ao01$6rw>GP>MnowrIcZd)Ym51A{U=ze-fpVjd?p`^0y zK2<(?t`6*cZx;si!&EtblXdtBolA2`@;znja@%h7hKGd#*3><2wrDy%A|-P)erF*- zx6p2S3HNNwiQ-pVY5x6-lc7_!+o%$sRc+jl9M6QqfY?Ffapx_GFRN$o))NULYe2g)X<>wk<|z>b)eI;o4}m`@~^3 z_eb}7QJ>pJo`7BMj{wg*8`p9t(2$)TlQX(S_X!N)%9J=pS5Jc zkL+oWJ1>2xZgU{1G`Rk-nTkAuIZmLL&(?7NXi%|~r9>(e7Y3rShh7x-9NFCJ z%LVc@mV6V{?rjch18eQNmm|bI7d>j1rD95I<vj3cx7L4mNs`)tS_$3T_fR2QtAd85D zztTwJ_P8m*fqM3oBK&YL=$XFg!Lfy&IuydER8^_I;1upri;kYP-OtjI9v7D0sf(+Y zVAwIi%Q)8xk1xm#I8rjlJVY~f-*@KcE`>6puK&hnH(#kNciAm4e0(ZV9Thc|0>iiH z8Jm4rcV{`X@6T~qp`~5#3|7K}r$-#hW{>qk900?XcmLBzkFwVHVKk7MF}_Z9?JSLk zBA8FDte_{>h5`GcF`l4?aGI8b$}aCceIu{=9O{w3h}ISpA@@;}Tg9mtxHo+`O)owm z#^(_yEJc?dj+kueGsNxLErAvo(*&mAS}Z6#^zf#l9$?x&moEA9b-9Yipfs(u4zFq`cOsX?FNu<2K!#l z4WQ*d#p8O9+wZ5h)+yL3M=Tb&FE?tGu;{-GICg{sF2dGcg7tu;aos5i!*8iuH?WVfYt8(jSNH4{~Pdm`?%2 zx#mP;e&g6^+x2C*nX#nRu5{NiS4rF0BJ3}W74Oz+1F1ObYU@IzxrHu0gkPtyGKo8% zA#*$V{%y*1x~@PxH!-ukM6Nw2TeCQ_pjjq%`#Yf!R0jL)$3}xm9|nA(W&*!c= z)tm}zd;^5+(bsizMIVcm^zy2WUfl<-f6>U!m{wQS;N26KxHV#2ME@3Z0&BU8^4WT3v;nil)8?Vrhx(@r3s+@eo1@{Yb&*Z}fYV zZhS}L4YWaR&=@_TPlU|H?DgOW7&3?DEEYv2_~Khb_SL0(zrWu{GaY@8hwk4aQ{xUt z)}m16Jv`KmhrzO=%ozUYx(6rx-h+z#SZGfX-)yHv^tTi%z_=80oi|D0$NpTf&ueD$ zhZR4Qx8LMhz$GP{jI$7CT1J67lKXM_R6AADct|c>}{>JCM|pIcDotYNctTAwR>e` z?g0L&LXV5_cH*(R#kU1FA|T6v0F$wuDO=>$PJ~pye;_phGXp?95^%@d;sS`xinO#MYLECOLya({Q)_$NMry zJ<4*-==D-xUvy!6w)+Ev2Cg@A>01Oixgzinep_?u!YscY2QLlUE!_4WdTVB z=7t^@=nytV0%vx9JuWCR>8N#0{lU_S2Z{M?eKqdZXmGH7$-ql^l5x)d<85~0tTBRxb3^Kq?_=_e%q zfJ!t2^$(5cX2+L6y5oEOaInJim-3QCO= z{V6^y@Quhy!1m`{^l<-~OP^!;5Ad&G_pad4A~ZTJ*UOI_KgVka8dtXaloAZxxS3!@ z3wUfTAHs{zcOZ~G6`^tF!b#W%C(%ucw`Gi&cJ~X+p!OLc(K&I`oe<2B(2mgls~iES z){G2%KN|s(HNe?0UZm>cw|TxQ?c15T5QD59JbI#QM2nKO!-K@DuofQAFeHP!Gv*7H zR(I}>K5v!rl(1CbgH9MwD{h4XI)2+2)W0)YA@u8SE$|LD3$5uZYLumTJaBSYTl!VX zZni7vBjuf?MT=igIOkR?;X=riyTKW0_Cuz@;Nx7U<49GP$LOoqKt_wM?1%691d%5g`_VeAk*h4TvL0{W@y#f&o(L!e~4@|D1Ji*}SaDcX7U+oQXP zLkf^PEotx#khkK{v#q%KR=3{Rz1ZV8&Hyaq}CMp!-uGAd>}29S5u0j zgP$~LsscLt$iKffmDXp!d)bGZq;+|`=R){P<$LV6MeiRnlWZY=vzW!w_P1xneXL{4 z5xslbW3_4}>gYdkts0EQ@uQF;y!i>lM$YhkiL`)cQ26rJ!-K7P?ZjGxm9|9FsOl4L&U8Xwl(_5#y2Bb;e9e zg)nicQu=fjPp#^Q`Y|jdlMmE3_{~rWC@ASab_^8_+1w0Aq3pzLUyd9;bLyz%mDA^1 z#Weh(a&62u^Q=!)5!Du6*eF*JUq(Mk=e%kMDBPN*33=mCi5Pno{kols!4YPWv701Y zP9Ae1BvyicoUWXjpJ0!yqmgbf835{8yU&t%LkbdVno8uk5eF~D=7Oi#-2_GrVJ*ah zE*LNQS{{dBzmGITC`Y}*rbEsRV)9l(GCQ0n^J3YsK7vceNE6s;6j%+qV%H@YQYAi zntHKG$jUY*=eZk0-5agTKj)2*3HV)qvJf$WKlFo~v@=dtK$T6YnY<%68~)bVC*@=; zgQv||xVK$v(@<4j%C_?+d9=qGIimm(vQ>>ydBS_uaDIl%Se-AK*G8KOC*^0Bfkac;S+-@ zoh#?KVA@O>*<{B-2m{P>E;~^QEh5T%CA+PVfI$9=AsnvyE*zfYr<(0nhQ&4f`>zqm zqkZ?h`EF$R^9nz`tYtbqs~}qtlY!FR$t|jYz_iD{gVb|x!qbh@A8`Icw(BVi5+ z%Gv@n{0lcdmEr0uaaU5Q%uOm5H+3Br?H^xLdubznE}cWN#f!$L-l^c^V~zllobS~ztge?CK8H(F21Q|b~E10rQ^Lg~7HyJI`OxjXwVEBmbn zO_>R0^nh}tX7yp0lPip_rvnKDG)t>BaxrAkQOXG59CY%TZ|tgV5xwrx_rL!Eq$$vg ziMAg;z;k*#GK9bC7IYY79_&C^@fMx5)*gbKH+6~eo>yX{*aC8;#pFcr+>8s~Dme%{ zV!nFk%iFrrv0U(%&DayKIF#)_6-*Dft)MU-t) z89|JT6L~T)j<4RVbyTdk-_^(&N~jR?5z3maqQ)E-TJ4D)WvWN?vFY}Prs{{arGOA3 zW$H#AsE-8Ex2TI9r^^unhQR7iwxcj>F*)B)CnBEj=_J*#ZM%+qhqi6aNJ453>*p7Q zdJZt6k(l!zWMPEiSOmsV?@L7kl^2i|TKMKxWCy|*%EpasjH}LykeQ_Ss%0YF_;i1r znryrj$+_9BcGoRbOn>KK&jxA1@7}oha;Rl1%i^z{v;!7q0LaI64_4R|Ikg zcMqB;*=j%?qmt|v11gL*AN=0R&0FUqK=(6UC4^qJRN=t2m&VE!t7i)kQ}{os&g0`u zZ%=uOkrU*K`1#fX8M5e6Ot375T=>>g7Es1^;^CB!_xnS}=Br)&RmoW!?znmL%IXG^ zSftH9esh&Rpg0-}Aw)2rqOV@xTeDHO3}9Pi4gDtMj#cNgW1H-Ry~rj8e|Uc*(&5Lu zp=3Ei^|q`=w8$7}tDiQGryD4EJj%1s@IJ114T#zQR7)r>oGsX#?D9na?aGP&M< zj6W@u3A9|$T8-J+D~4)&v?cV(Gfdj!$^#9ki^B~OFZ<@CY&f-#zk z2ERYkrBd=?yns-ETfB2^1BCOWj@;A%yRk~RiE|t-c608IHIO*9H`?0&44OzhZ^*G% zWf1w|%t_aIaw1S66$#YTZlCO)&j#OK@h!yoLhwbM=`Gum!kD*h*=}PBTg|mCVO^7I z{t?opn0M=t=tYkxIwDbH0e>}$A2TG%=}k(crqA9-#x@t1BYa*+A(~rZrpfPwJq^#K z(FK-n*m0+$)b*`&1Pb&YdAg~59$#dol%?h-M=9p{40``IL>R;tm?#{0O%M|1I|LnV8OX+ow6WM?A*b92IHH|X^iY=L1!9HvZ2N1m@w{S|3?H`MXC9L z15a0HsTF)ge~#32d2h;f0lWuw7{=>c5#PyJDNQSvdS#kP%OORRg@r$5EQXb2Wq_<0 zP5gB1*Khv2J@e>w$q|4ZgsVZT;Iv`u{$vZr5X$k%=cD99*p$0T!W7>iCC1ktg?#hg zS?fW-50sxe9XyRwmM=t(5dI=vh5`i=Ksod@NuKiVqvmAP*DN`<1v zi=Ko{w?qFk+^((RQ;CX;CLSo+X_(e(>haVP-=aA)rEH`pM3SY!^B7)EUnX$ARa4g> z_Dd{lzL>XPiuy{@X%KWz#J9;&2Nl#mYsuaIX)f4P)_sd7jR0^JXG5j&o`089lkN&f z!d1oZpyo#BH$BpQtaiLPsg<5Gm<$XLQll*fOBg}0>NeH-$sN)px}MCsmcTFJ!tJR& zEDK1oWqI*23Sa^($Hm{>0nE z+eFO+s&Bt>H+#;B%rDZhwSPK@$S6~%MWfSU=EC`rL{*kdc}Ao<4flg5^EqSyyeL$V z1q)kcwzI@EPLXY4#W*zKP-+Alk(GA{S_IhiBk5$~F&97eLUS|8Kl|hZ(6pbvUtC?O zc9%!o$R>=sOGFe9mx7Cwcq)`@ykl=_k5THUQ1G3z5>FNdkRy2$I}j=dbiS=T9-ul1 zKvz>9ENwmyH>4Ekw}RAc-f5PXV5p%MyI2K?446EV$;bh^Xv0BM?2EMLzmO%y-IQCJ zkwLo}@2FiN&mx~MYB5b)6xlQxf=WHZeB2zT>lx*ex>B`qgL^#h#S{SRX^1njTR@W?zv)_NWbD$;;J^4`_VIyp4FP7%g5(Kb04y!CX3ikQdSqh)h~Cv`~^d_SJo@vKW9+_Os+S zqq-dlaY^HDMaZuHt_UEYv)}*|&OgFZt|u?lJy0sCM0$F)scJPDGE0o%H&KJ=&hdsKol6 zAjrT>nDuqo*^3v2`mu|S=Ad%d;{03u+1|`ITR{D##|?_gq?0vn`hh9*Vs4aML;b&QH^Fp4%x3?p1UglLxwVhZMw~M)_$hR=J zFxRbDi;_Q}K<{6Be?iz;as-?u-6|g$5&U>?a?PMI{+mkhN7hJ+RHLsu?L=qG41t;d z^#UwNQY4RWMT2GNOs=|OkLVzdu;HV+N z9M7WhfNFIMya)#*?Zugk$U?R{VaGWpFdk>1xdCX0vVPb|8*6kx$>)W#Q-}Gl1Beyb ziJ8ckpEJ}4Mqx@y$qdT==q=5Y5Gw0FLm^UfneGlMHGRLEzW?i{M_zuUil65|@NMEZ z%?Z`ulDjEe3?U7{x|{gHLC*WiG!Ca?1HeJSCxo2Rpw&ML?OjX4SnXPAExRJ=;mtrD39+F) zxmUzChoC^`x{m;FxWxNL)*a)i0x!{e`aI)y#*VcFJ2ZOs*B1n!E=|E}chFu7^nv6t z9(?{2uRE+584cG%Ys%A7Mfp>GNunD*{M?FIB^$i_UHY%-)sS~ZWilTe6wZ*JBo!+- z|A;z}yorCliOCm~s8e2Is}4<*7nR>SV`L@WB~iTdGLkzksXNu3LzYl$LwI3zHk3%x zSa7!tx~hd-LIqi#ow9mfC$)SQ!kxxQw+5ga}|79gslx^C07lQ zkf8MDL6*~YGGL%cj1RP#_~&1mXhJ%@CBu8e6k z3uA)c9{_4>qmu%Hvi1~lIv1{p%8S-Ix*9Q)-la(#-^BRDM7L~n_&%h_!+7BUl)C(M z{$4&TgGLtHi&h)}UtE3nIN)DoGJ#9__TcbtO=5+8@D2qD+Gep@99ih%S9$(741~* zosRd+%1Elro$RMM=|@y!gcb!N2=5;}>$VuvsnLWMHjMVvdJ5!*1gANYPGPznjJT2Ekh> z03H-v8!tA}kB0w&4sZ)KzeHS0QWW3gI$V0oA@0S4Ggtbn3ZoBB(@rJC;7{9@iQ=yD1yplm*@e8@6=vJ!`$$Q*Xt9J~sBCfeIZ)&G!qndk_ z7$0>Xy7i+=ka1>;bgV3rgD|-1nWxtDA19h6R_jTd`G)6vc;`5JEqUUNuQ$ps8DLeL z5k<~>ywZ4E9Gd{F*VT;+!bAx{G#b;4fg4L;L$*I_? z>6Vwjc@q5j({uRfj*f89QZxjRXFc_HHv9bMZU1oEy;yx0r+#FGvz!Q5lH$KmG5Ax*y<0CWqni7YGriC9yb3#@eEAp;^PT7=b1mhb82ILQe z_-Y@*bDqsv;y`gFg9Pit%#`TfFqY8C7kXDvz3=iDEy9$3chxG3`_vef`70m?N~)?? z3lvm|AMM$-XKH%iN%>SOko)DE_)#v^8HLV|)UO9uYC*n^b~|x802U)3aGN^V2jO}K z-`<=ZjrOydT$dJC>?f-I5n2iO|Jr-2s5-i)T@)v1LU4Cj!QEXGBtUR?7D0l$OK^wa z?(QVP-GaNjySts{ee-=s#=bcJ-M-j;laVp#UfngTo>?~QDJM_c<#UFFKJrMW#&#fX z@b?>O4Fr1G#xGqy=}MR`%$v06y>6*MG!wBv%7HSb$3j+MdW_4afmUBrEFO^9x&BV) zXQfCh%V&17CuI>6bhX5x$-zSxo+wy|03}yPW9%)GMxhL^R^?R@#Sw{ZGpAu`{41ny zA(wP?B{S3|yEfl@Zoooop9>^n8~ z(I@)AL+Je59HQcR)p$xE7^u;GyUnpwvz?HVb+yrO6K8?CLIUMqa3B{TXiToZqWDGbt16#mXK%Aj@81YR(+eYd#757+4u%4kj_$7DXhyYuM zqk_(XVHBP>P7XtqCSGa8%sSjki%*X^fu+WN6&>`wL`^AgVjcp^=e=QbH6_sL6)-~U z#S!W-7*Fs%`LuMz&2Ufl(H|Ts&9|DN8pG3DB6j-lh_k2Ea;B8q?&J^3@?aLmRqRZF zX<;n+!f1Ha;Rdb*YPCf_?M>BI!cqjhc+aKk4!-k@mw9SUWh06x0Vx1$&kS95CM_-O zl~$h}3xikvpBC`3FivxI?u`Mu0*BUlCh5wdkKuqer7=$=xZ#_uol8u6;ywR7=~8}a zF7&cN&;vzZXGrA zX?FZIl;Tnoq4tPBHDI7HTtBxCGX%Y4v;6?}5K{QK63P%oQ{6a<59P}?QgBLtHh>D4 z5wOSV;c`8m!_Pi!EER{AH(Akhc->PCQTrpop4t=e#XBxAAwGC3U$Np^MaBR9eylW_ z+FA-+3gE;@W?=(NC8N9-mFd>g!)&YYvfZvoNma zd&&|AwGr({^22yj4jnZ@#JRq<9``ET^r%xe`Ps6qV!B3A@mS3e^a%wFwi~!Awud)?{=UH|_{mjUk>5Ul zWE$JK?kHx_qTyOo&j<;(UkIpD6Q8#;WouU(nz9|nLIOTqy6kOHI)78$7Y*Hrl;@R& zvr)lkA9)hDkC{i9c~oDCbcuWXPNXncxZ)_6g5t$Y3WRj|vbKk=<}cs&_hB^(jmTu3 zx0mM_QW1(C(z1n^v5aLU-g+Jox zGc6jI%(cbM(?Y9oYjoC*5{FkE3UgwTCv@V6=F_;SarJfJJ#uEUonkJAC>+lUZ$(2Q z#V6B+YWr!q3{9H&=rtnrgSx~B2_;u^V@xA*$pRe}ve=JThw5CViaL6t$|TWILr%J_VooLO$G>j&Sk#3l`vBm3YT_9w-DDgk zJ-*l>e5)s9Xu9?z6dCyTuzu7hr3V+GY`lvF5y!p<_UCM49V!voZFf#Z(q&aSWFQIHe|G6V+WXaRh(ILWEzmx6ZKSeQ6Ot+*1D z;ZIJsLMltx()bR8ieQ>VPJQk2{m$EgjsKI=r`w57x-@$_eHT zo}_pcU(>HHMtbB6?zttthR8a9{%%=F0aSr*o6cKv#QaJ>rq>j`)>+hDr_gEE(@qJ9 zZn2AeKlvw9Iuz<+yFn=Ug@S@RZWG*Q! z96k~lVHPL!?YlqTc=%shnPen~72ul~wm!tTnv`Fr zwPfEq0cC;6aIV!G5O{5GO7lI$JtK&i8X^<4ObYT9V@RxZwK9vJDq`698EJm5QDkP( zRo=k3k0}E;c_VHYq0aS=MH3nvr>hydoW`n2IQVnR&$2Cqe1zbg#x>9lmp)}TBL1Sj z1&IbB4?1;Ox~Q2sW4v*H`(itCV-3K;c9XzfCCU^K`YVsb*7o7-aHsIR*6KcTfSb_M zfe8c=kdj&>n33Ws30;qx5uZCRKe|bLVE?wA3k++>c{8|hnR`b|zCahJo)>SHVY=a% zV1^~yO@;zb|54~ESz@YtF=7*5<4Hj9^D$q3!{R=CMcPH$w|*nBA*rkURiI(Tefdr` zMi2j8;%TYkcE|)z0B{H-WMKETutaU0U84BY2#EVf)wj+Y08=*FpG0^3EzREvIz|{l zFP=B^kGJFfLSE>+*9ZH!LoV3Gs_P|E6Y3uQbwiv-b{7+X!2~60ij59qJK$g+4MUFj z$?$1dd}@rA(bh=0;8H(l1cK#5PdGiu{No|>5Rl3{C%sB{?4H_huQ**p$V0Jv(D}zs z4q1!ZZ=gr!lwJ!b@A=o}cCJ4kjB#+6Qzd49P*<`szO7{tG|`dQ>OP)(s3PuCw$ z%hEI318e9f%T6dNvKk}JaI-zMC0kB$)8BmBu|(D9Z+ki9l*4fH!5$b^r*;-elic&?yjJn*m6h$2I@51`eu8Db!Ib$x` z4>d`A^wq}p?e?4wrf?uK*EM0$Sd{>UFiL|?v;2`XNMXr}1)t-VAU+)~xQ2(SC*766 zW~(<>;PUom>?D$c^c#aO@yxi4uFIi{Cf`>CS>N%8ACQkV)|~yZmXN-FTvT`}CzJYp z8|^3$3xTz4cTsrEi*c23!1j=~zZZKzM@xtrm%9@X@4<yO!wJl z-K^#P62eHDCw4$LDVk{W{>hkWur%Vclm7yBOizTeUdD+KFp)**%jDZ0Q};i**-Htg zrPAuW`?U{&Vmv`HUNzSjER(z#Rk3UGplV-3FTULRWkN3pr&)FNJ849RvY9z9j%L-x za^2GIEZw8;WVD66+R);NUagZQ8&AYVGOX;?q8r=gggP1l;C~yvUlZ< zgo+B`G_u%%1iPa^Dvu6Tu(OYzgPVvo!Th9#C#A8Abh8u$fC{rSNRZ zX*pR=@Vm7Bvq~^$LTgv1grF4&8qdA+dtp|Q1=Ep1hOysBP>~`Y(@&aX45^Sw%vC}-D=YY z&*$WAp0(?@X9;mhzKdUuXqT6GSP-)Fwq@AoX{H8fu)j6n!t(g}n6aF*I9$1zPbKc+ z$cE4vzEn85#Y;~!2K9A`l*RIDHldsq-BalY=A1io-)q#lE#!*b)?`YUtHsbSo2ad% zpaO!MunX^Bo{UvaLtE2lzc|*)t&d0-emgd)vJh6IDd!xY@J$D;YGZKP?5cIhf|Z<< zo&`5c!@e1toH>fx8+>wpz~mU#6xdzk+fuy>+dADGRO!d9(yBf z$xb1s)sWxW3)1$=`lGi-kZvHj4sQbpGAiAZT6~{=vmW0E?2__{nR$GBYGO;mE6d+a znvH|3?6l{qD$>Mi#r2XozUnL0_F6ih}GUlKOBwiW+ig-((YrgU?_Bq37UdAAcT??JWMb$^F(?t&HW-E zuV4nk5Pv#On-hnD#cutJ^gf}*6cmB|ba?q4Gvq$SRUUvB_y;DocQQ@yQiGPfLVH%r zKbrWPja}%-gpR`~K4jiQe1Q1)<^t;DQyx#o)?kwY9EQUs47B&6%RFSZwf3xoik%v4 zrd5bphJi{>@#1RN(Iz8@VZFh1w8jWhL$D1y6iD6l%jb(K2m=FI0m9E<}Fz2 zh8V7XXP$a*j`86stvP*sN-ykiXEt|ilaPsFc0S** z!%hQ63adG3kZSRMQfkU!|MRp#CD_81JZ;exLl!%Y`h)MMwuTBzf4z{wH6<@Fae(X8 zN+>Q|{OH$aY(?8~z3|Xs3dfp=uoih~nC!=lLsn5;Ca8wBrj&^$B($32eEK&B7IP{(y47A4n6x1-IvJiSJ0| z_gi%AGgc^S18qt5Yt*}C>_c3a2XcPP-$H-sPas8-GLu)M{4BF!R(l>a8@i%FHNVLT zp%9O+x&RaF7xv=bN)O3)R`-(6jB1&m8@s#OOS`&hHrlMVI+|C!A>j{;ogEuzUE`*o zNi2$v5a#8nyLXV4W~Q4hRz^gHC{oyM~~L+jQFY38#3C`v#|vfM5-(tTC;vpSUG=77)NxZ&pX7jGQgv}u37 z9Jr-#`7VUWyROiqc_8zn%P3Zd-&yRsFiNo6agvI<36g$iE-l`+|FHuzi3jdJRL)@( z4;`!bif3b4>`-tiB}fnufQLxVOAk)^6!b}{wQ_P{+Ap07+`4pI3qujeylOz!6reG0 zZ!{^Hql^+cC$auK772BDe8GNZbbARi6uN9SuN-g%I58OK zPXX&)3zCwLbXH#lOz8SJ?Ri1xFag6*>oxDabHlWyxV|$oa1$N0v@q`;RfEs?E~P%hKnKtXrT-FAJMFLXrr%O*yc zTVj^@GAgVbk5|ye)OsFe&0Nh#VxtS>dyf$lT+j2TQyUH|zwwh`qfrQqP2+$*O{QB) z5?HR=eVxfP`*_o(YM1)$3ez9Cl3xtJJ4U8$%J}6=m>Kaww8g!7D~w>0S@PDya-W)5 zF(hB2ba6&kMFCaCeeXK+my^y(+xMk=hH3wjk}7D;46lh;{?zz{h{osrmY|m-ONaUP z(9OYJqnFzW0Or&2nuQwE2UW{BP}}=r!g4C!dT}NQxJ!Seu5o3Ax)$G~XsOFb;Pt%p z0lRc#`+4a=?6BF=%VKsK`@zzNbnHvMx?uFOc+H6D`4keD9U1Vza;!d&&D32?6)x(Q zH)n^^^%wH$mNXmqbHfFU<}su3ntyhlm|HOSYb65zOlPv7aqZmVNnLTA-vI+4xzAX( zUz{NxbjMVe_o(J` zc;A5p*wOG?JiJEH{huQQ2v%&liWgRKa5~@xo#AKX-~|dl{gLW16ui}%d@BPQBb2ehnMhi@j7<);=DI~OH<$%l-&${*zLyVpmN4E_bmSR^AE6Gk39mZ zE(^F_t#@ad(d9X{D_J>7UKD`Tl5^(y9b>W=p@+)W&ijajp2rLDCpMcu_2ypGf~*GC z;p4M+uUDbvu3M{-2xqQPdfq56)L}I}EzOKAtREKPrMwS>Pj^FR4vv0HR(r6ko|O1) z5TORZC@r(gd5T<<0&^2qCw6l%HvE^LI|LdusV671aa?qstJ6`()L_r_@~eFYEu_8Y zDSLKDy#qTdVf!OmB-N3gp_IuNRDShcO!&Z>Wkgksz`AhsHFhQPIl@AL>}4uy2iHp} z3zxy|&<9CfW4Bs({`&(m8-QxZ7xzXv zll8@Lr08ZL{zPbqaN{vz99BbNf#b*NW??JAvmUg`)bfx&hBvkL`U7?q8}ndQ=;icg z670yA)4d=R(lNuefNr%%=Tmev^_Z%oj1^%kO{XqmO*Be^+a;pIr#b5M40=~Z=L#ld z@}t3JD>g7OMQhnX*p7eB+Y-`yz^(3=I6=s_)fpp>wepIU(8KS*?ir)qF}<@A@@EI# z`t#7@`OysD2^!$PzHPbX`eJ{Xg->tO=M!)-zXBP9vxFq){d|)xYM7|N1rzJN&O0fs zhVPI%`EX!%*jDhu&39`ym2muqn~TqIO@=~t3RN$4&Xp|th&8zc?`(SIiRg)N*f6oS z$$s%p@We;&eU#3-$1Y{_m4&HUpOEHZZv$IL8WTFYH|D&rPS^IIXxpLXxG!-F45x`h z!4JLB`y=7cTpy?e?nMnAzZz3Rt?7cM{!j?~BkSPd9T*6)z@Q_>=D=^QSUmN4F2B`# zCmr!#ETG`4VSpkY1Q{^x4-u;b_U7@5YVbFu;Odd~6`}J^{mj@@;gfiQ>cJFM)16c6 z#a@!y{qC322V$q3r{e1$QwIeVS^KO{TS!?n>WvWQtu3UxM+?t;mXoOwt43_Fziodb zS9oo33I|TmxjG{dd7gcu$iWm+VYe^5G{r58xaY8NId({O zJxJUEhZ1S|vg>LPs{|*-Yi1w|@ZZb_CkJ^D0g86|eDmzjdcq~$173`YY;3V1mN7x+ zDK{64q)$kZZ}GZRU6C{dF!SNru%O&w;H{XGCWd-@H0QPX=M*?^B;FAT4-LbiJ*l{p z>F1P^x4Ob|(yB_oy5F03=6g9KbBE@`H#Ha3<6Au~oscIx9OG1Ow4Ge9KJBcW%V37f z26u|Cc)eFd>ZBb)>~gWuuPC2+IWO4QX?C`mQ3oj;zWr_8DO>zYch&|qr1Ygm?}WHR zQgC^{e?Nso5T4R}C$P!GBow!#HCuoW8lnN8$L2O1np802*T4gV-oP*2PN9MtY`&*J4o+4$JgSaD14%p+>&5dE=`Gi{p0!XvDPC5v1+H^O@yj zdKv1Sjc?V>+qF(F53txOKRYMN&EpZ(n=vzLF*rj<1Ey_k9p|<0Rm(wV`5g*F)jOX$ zjF@w7f4;Y`bIdAp-Nc?3+JX3UohrG1$+kn$`R)eOZ|RBaa=u{pZd?*)m*AA|I&Gx^ zTbf8C;CWcb{dyZs`$qZfEAITh#ww0&n*bM#dK@48LN!QO9)c7K{!U$d?&H9K(A1i( z&{?x=G=|o)9hx6BbRv&AUTIa9?wCc1WqWyshyRFo{1!w#abZ#b?Dgwxl!uk8m*fkKcUR-;&@K(}6?{F@jRIlDNJX$HKZ>FvUm|DzYKFI*(U5m)!75ncjqqzl6zHEwA^QMYaD&Y5 zMD2|tT#tGq9+T!(A?lwEk{A1M_?&8z0$ZaRpIKJUzUnr!Y}MOMxbrT9C~(lXG-{=F zJqjAzDWmh6_?!6A*&2G};5r@OW277jxxWm7cswu`!Ot3bmU(n3aC#mKh-x7lb)IqR zGWK}Kig>mCA_6#qB7ma?5yFjN&BG^AoZWpm0k9t1-S3_RPrQyEtPekA8;{68NW$bd~yG{upKYp zfd~f=#|DqXuG55SSBg7FIU(xmb^Y^7?}U~YNQA=kV`Ge)d~O$I6!58CTsxuo6mM;; zd#X>kt%hVmm%4YsDz0LEI>rCHc7qRsWG5e2?dp&a?M?tMp(4w7Z6pGuUkHY1K3dwf zFzvm%sN?$egyGoQv^2r0e9%%(RN+5oa(=jB9Jo36(w_}eGe>Y;ziY&AvhmD(`DECg z#d7)UprZB>x_a~gLNAceqn(_ZBL%NWBX+j@$C zErF9qkh+mks1jl#q(+}5ka)MzvkHs&aU&k>;pKz4;@N6wN_12_&b8s_?K{KjtUew^ zw{HBXOi)O6^L+SL+A^VGGXjQw2;Igde8$=;;|H7 zKF%@4QqVC~V{@?mBaub%<;U`MgNoL?9nsFR;GW&ePk)@nt6w(;)ATi+^T%U2hsV7c zEe||AzA_bb^>zX(0*zQeHtDTDMPpD&L9z8?WFVhM8HC<(z<0HW1bn?J)C9z)^ZJ*9 z6EWG&Bi%;y&|~%Yr$1=}2TsRseg!Uyjd1biDPu2}Tx7QQcP zep)29eyU}r-14rWJFfC_;UT-p>tp%cT@lOOg#j)F{SN zxZZ=+nz!*3+wNcQwdy_}DiINwE4nWwSkQ5&&Rs#7+RorZKW((AEFgZls!u>!!m7K; zCK7G-bG}$;l>|qTzA;I`y?M!yjQ$03cKN1h$?EvHz)`D%J8V$@awjQY$<{>V^R1e~ zaD~wcj=$(irPc)X+e61u!@zc93a`y`EGyU3wN1uG*xk*t|CEpkMV zhTn~p=Kb9Qlh+ej7gbMoSvh9!GM9g{;jnER5I6CiZ7`C20D6lldlt;qy!P;Zx<9n99=OKeCDg(ff>Gx%wKWe+bJ$H zUY|fe-D!Pt?Yr^X+BJ5+965=&y^G5(a^C$;{Vo+ilt2^p{z*O8<@hXellJFTtfQbBWC+MERIta!T5%JMkQ@3XN;0o2;4^ z=%F9sg?#b?2J2}+2BVs>RAetdPXID5f@DrF>tlb!VeMQ|P4(HP^vL?IW}vm}z!};v zX-5R=WiDTID}wgR6mYg_w}s4y#E{KFjM;UAOc3HLY#kB`9ZX@dsj#i?N7L?pMb&{) zvfXiCeC(@^s`kh(v%VuRYT?7oc(%nZCqmE?QL1kx`0+3h4dh-hDpLK5fW0m$d7T@C zc0_j1>jrEP!TGc(g#urEu1m<}a-}%v+Wr(+Nj9~sG8x8hobBGEcLfU0hupK0LrVi` zgG~1kN{sUK@TQdW==cO5|2P;m1B=R@hUXqqc-IBDQJZGynUR@n1KlLKs8J(k!y(=B zUf)J34__W2$Akuq{@%~{e%;Xbqu_uv5hm9do?&k98-nGo5Esk2pZiZB!^r0fT?B>T z59x_E&x=it|bRuc(;VkeI6r<}wQGqKWZ$35SCQwyjRQ z6;7-7c|1ylG;eX-`*os1*>!b@9fR#E`wPe7_}EXuIVIc;TYEma+W|9HEL6-`Dd}Dq zCju|qLC;FwC6U{LO~Li}SlQ092>FA3{`3NHz-CicH&i(5g^T?wr8I}x8 z>dKS(ive^#mR#ra%Ob3s*J*#F>a}*y503`~mAeoCN6 zG5{#fdW)6d=2zINvkFd9sylS8+cs{W`o=8uj7MjD0omE$4&@qV4`HJ53zn$F_)YXT z7(nUZ)w z0=_dpusjeqMzp$6tom3^bi=V}6D(OHwo|O;2PWv9K}$y`GFJ<`r9|}GyTT%A_;<#? z3!U=%iFz?j-xd5T63&uC+o>APf!bWe71=x$(~gs_Bijv|oW3{lLtU2Cuv8~-ZU=da zn%4UA%1_ws%~VD`786N<@$kKi+Ib&~(I)Q7Ko30wC1hk%B`#P%;CoK%g5dh<$9N;9 zLwdy_l{fj$mIx~Dp0aJosq)mWaM{-a`)^_p(CL$EYV>}>K1&@PFVUSy0?YUk#vHmv` zS)Tq8Tr2j*#QS$C7}%#AqPH4JdXhL&mLLp9blG-YcLG>4|au zIrS2Vh_;tp(6>vqz4y^otzAxFm57_(*J5bMx_ZK4Eoz6X|DY`1$|_Ti?tded!cAF> zQptMGQni+HV>lN}tKfP1{*R+JvPO1pApLT{{6I&7KkXXx##dx4_C2M+0YRvwmc2*2cttb348x=K!QYOuz${yZ<+Vw96+P~)XekSVw zOx6#s5@AB9>|Wp#Sq?6dM6~AARwPg%ALBf=efMt9(UPv`Wed?jm~5c7^zq@GbnmgL=)%X3JG98 zzXyjTV0(V+yxRuP_uu>&{7C=M#T6R>MbtJ=sY$#Cbf&jx1tfX=2QdP%g5fzL!^pIVlCI; zbklC%rjnGr_vU@JB{vH6Kj%+SQk6|gk61`o5AWEr%U;&BY-$QPCW(K!@go5R$vVQN zSRgPnCCOCwXy{ib>Q^W0vm~WH2z?6hXgj_`28H;xf13ffUoA1sZar#!{t%=?*<-}@ zik(eQ8@20N?$2PahzVi>$*E{5d)*W7ITH!jb_|U2#Bf-rWsED2^yG+xc}$J9&(7Dw zi(E>J>*ecnQ4WkxbA}W*L=$9ki;&W+>t>c z2~R2(r0OVEC)d$x1gmO_4eZEf81qtC=1(@2l(Tx$LBbXWbQWjKl|6HMp*0|U zaGF|S7i~1taOS{2-FRR>k~be^q}ez?1rSR^gr?Q9QN$?*{x+G1-U&yozzB( zW!xm+&`cjI|HmfTFQb5R0XE6y*~nNcLUD^P1Qx+nLDDv!sQ-M@f?jByYrJI@hnit& zW!IcucpX>5hQ&Jwid^a<&U971Lm`eIy^0v!qg1=ak>JYa z5@B-(RvxqY(V1x^aTUGbDiTt1gt-g5XkITklO+v|>(d|BfGU;upw=pJWYztI)kYyS zZJiGAoUsX@>t|9Q43Z8PwRJ>f3C-6x6UNGC9GqB!XPn)bPA!+1ing6hD;Jlu<1|tb z`J%#Ni@l{keQtn3$1pkQ92Q^Yih{C4jenPv64Yz4@il`j{iiYC5*P=yr2(6Ig|E0_ z82#lM)(8`}6;!gdOMJ7@l_FX7m^7vK*jCoy=N3YjQ&f$HV(egAZYuUr$8pK#;5PgO zfUrS~0b0uY$XeX5ANxOx_FR7GOHK=~O+|)7vtpW{Q>-Mr-mY2>vjONC1edz`Zc;DA z1aDP^_PVn6>_<;kv!EiP8ScQ-l%nJS-sB7_C<=)sb>4V}ya8GYI$?Tu=b<+v}?Z1&L&V zJM1J9(bI#&46uL}KpZ%XC$6|rs^5RP9G7-4Wt{=y5GpwIP7~p?q_Z3*(Z6hvAPRcr zq2zK#>lc%A_Yld@G&qx52t0sq!C=C^EdV?R|+M2gG=+*B^`4 zN23FR-wmt`T*3bk@nrXx*R-I31qH%OBx%N$W)XznG37baNFA$r!#Xke&T-t+bpR## zN8$p*X8lal6b~kw}JW~3*B2>k|njPNX95qby zUtNQv2xE>PT55r5xJNccXP|nImg5IHiH&O!1cJ_lKBgX z3KHNJ(MhBqyvz>n%|7+OfAwJ~;`#pJMME2-AP)v|XD@f(hGkg+kFKD8`Fk386zH(H zyq@x^LIse-UXWqTnGBen4Fc2<1kix|)e)^hEY|gj_x2UK4SQHa4z3yv)|*Zbe#-(c z&tDepE3Tj3g{!Kl{j&_fjX{Y2QE$`peqEJ9^X8_!yTrO$H3!0e27_KX0q^D&qSNab z6r{@Q0VhbA(`my__m(sX_^Z0IB1p#!Q(DwOKIQl>1zs8YL$+vFub>O@75D&Z zS>WVYT?1OQ;nsP3_dz4B(x=Gad$Jp%y>fYj`YI{YhRhmSIHB3fSvU{nLv^hO{w%u^Iv zDv-At8R42%{KLdvlP>x_zV77D$Yi34YP0xpK%h%*sv~f`66on-UCQbAFA#uuFfuJx zTn@dAIpG@NI~r(X=lsVd6Abpq2lS0NgW@E?QyTeW7;Dw*F zvx{cs#rFLUO>24{!r5(L_?Y|(yrH-uo~6E+5ScYiAzoOoaeYP!uNYdx{D#q_Lk{m%ed&-HLqm`evJad#*H#>0<^Gy^&^IIBHUe>WWKe`5mMX~v;V9dmAiZ4L z&@Wg4HEe+|m>%(j)EB!=jy&wC8a!Oef0| z%&xm~t3o-vjpIwAiZD#JbAsj*Yria12~PLw_E<^N{^hF#$gCpAcK)EFWDt_E#5t+t z55@lY8rJ3`G56~vPc=W!O%Ebs$a!4qUr_7ncocI0UU>|qbDi_D z7er1S##;k2uK2Y1te%pNuw{KK!-frek_pmNJ%oUg{kZe@d$Z+}lClazMo`fd;*#`y zKUvGZVZCLU`G2pT+is*>+XOAdzC4tXrR%-LpPuLFf3*Fl6?0CVt^8vY%*tvG6gbM(Sttr-tmJYr?Z@5+aVJ@(8wPD`etx#3AODh?M(eM| zft6o*n-#i}^nKNt+7Uyu)RRIAtn$of-!@gVJ_XzcmABcyj96*rO96*F~Qk8*v%(?7$P`0L~iP_d{%-cWKX+owmz z`ohN#cFy+(G&<GS^_-8rtN=iZ$b)9R4GV*5fdgk zYWVeI*;>?*p9RuQZx3I+X|$y_8K!oM-}hp;sbS14qq{WdH<$JHu%IPK>6u#Fn^EEn z?*dhb$t;+@`OC|>xbP?P;2={GgMe(Fzr5zAGHOrNEF0l?_Z!;xWqrfhHsZb%w{XOm zTz+w#(7qJ^h0F$X-+Er@iN+a#<`b}0tWZ6`^~IU_>(^%Ehu~5r!p7FDwfG=_{%3YK zR+tD3*#XF({*j^>+$qt$;T7@|Gl+JAdg6;C>V*QvN8e3lJOqnd-%MQS)0@M@Sv75@9e zY4Be^_7X5!2 z=EZ{$^4AWjpaY*Fe4xV1S#0Doq*cAg2`lYoX`S9aogp~8!U_>ed6&w{WysFW3dZz7 z_>K`TBLw|R4Gd@x(6RJCH@-0==HKF-VqJelhK2?(yZ*c7^#D?5KZMtrOY#(T7gN<6 zheVTK?f*m2vcymK(RL}La{^oOEIEqd!+Q$Ur=&|5AKVa)|Hd}i2w%BqC(;y5x_#{E|rBl5)UPC}#B!3{6|_NY(HAwT#r z*#CvHS4Ch$G-*d>4I{os=NjD|F1NoKy`+EZ#P|TV>W*C^=Wy7}@?tvzGt8>UG~933o7FsE!rsqDw}n2RdCFaHm% z0c@$L`u_)jl2hlV07S=F!U}Qtv{pa%@uDgaEEj;-AIJMf80CFVK_4kN^Mx literal 0 HcmV?d00001 diff --git a/README.md b/README.md index bf78e7e3c..2392408bc 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ -# documentation +

+ +

-[![Greenkeeper badge](https://badges.greenkeeper.io/documentationjs/documentation.svg)](https://greenkeeper.io/) +

+ The documentation system for modern JavaScript +

+[![Greenkeeper badge](https://badges.greenkeeper.io/documentationjs/documentation.svg)](https://greenkeeper.io/) [![Circle CI](https://circleci.com/gh/documentationjs/documentation/tree/master.svg?style=shield)](https://circleci.com/gh/documentationjs/documentation/tree/master) [![npm version](https://badge.fury.io/js/documentation.svg)](http://badge.fury.io/js/documentation) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/documentationjs/documentation?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) @@ -9,42 +14,10 @@ [![Coverage Status](https://coveralls.io/repos/github/documentationjs/documentation/badge.svg?branch=master)](https://coveralls.io/github/documentationjs/documentation?branch=master) [![Inline docs](http://inch-ci.org/github/documentationjs/documentation.svg?branch=master&style=flat-square)](http://inch-ci.org/github/documentationjs/documentation) -A **documentation generation system** that's -_beautiful_ by default, _flexible_ across formats and styles, and -_powerful_ enough to support [JSDoc](http://usejsdoc.org/)'s advanced syntax. - -**ES5 and ES6 support of JavaScript, with support for other transpilers a possibility** - -Using [babel](https://babeljs.io/), we have support for a wide range -of [ES6 & ES7 features](https://github.com/lukehoban/es6features), as well -as [Flow](http://flowtype.org/) type annotations. - -**Powerful inference** - -By statically analyzing your JavaScript code, documentation.js can write -many parts of your documentation for you. It can infer parameter names -and types, class membership, return values from Flow types, and lots more. - -**Support for C++** - -You can use the `--polyglot` mode of documentationjs to document native node.js -modules in JSDoc _within the C++ code that implements the feature_. - -**Support for following dependency trees** - -Using [module-deps](https://github.com/substack/module-deps), `documentation` can -crawl `require()` graphs - pointing it to your app's `main` file will find all -referenced files and include all of their documentation. - -**GitHub Integration** - -The `--github` option automatically permalinks documentation to the exact -sections of code it refers to in a GitHub repository. - -**Gulp integration** - -The [gulp-documentation](https://github.com/documentationjs/gulp-documentation) project -lets you run `documentation` as a [Gulp](http://gulpjs.com/) build task. +* Supports modern JavaScript: ES5, ES2017, JSX, and [Flow](http://flowtype.org/) type annotations. +* Infers parameters, types, membership, and more. Write less documentation: let the computer write it for you. +* Integrates with GitHub to link directly from documentation to the code it refers to. +* Customizable output: HTML, JSON, Markdown, and more ## Examples From 38b628ec6625e0842819349edd8def355805a7ce Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 10 Apr 2017 18:45:37 -0400 Subject: [PATCH 023/555] chore(standard-version): Use standard-version to release new versions (#717) https://github.com/documentationjs/documentation/issues/715 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index def2c53f6..7a9c654d3 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "lint-staged": "^3.4.0", "mock-fs": "^4.2.0", "prettier": "^0.22.0", - "standard-changelog": "1.0.1", + "standard-version": "^4.0.0", "tap": "^10.3.2", "tmp": "^0.0.31" }, @@ -87,6 +87,7 @@ "url": "git@github.com:documentationjs/documentation.git" }, "scripts": { + "release": "standard-version", "precommit": "lint-staged --verbose", "format": "prettier --write '{lib,test}/**/*.js' --single-quote", "doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md", From 09d282b0737edcdafdbceb34e7ec571cb4fd1bcb Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 10 Apr 2017 18:46:06 -0400 Subject: [PATCH 024/555] chore(release): 4.0.0-beta.19 --- CHANGELOG.md | 23 +++++++++++++++++++++++ package.json | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f33cf6130..cb7968e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [4.0.0-beta.19](https://github.com/documentationjs/documentation/compare/v4.0.0-beta.18...v4.0.0-beta.19) (2017-04-10) + + +### Bug Fixes + +* **inference:** Refactor membership inference ([84c9215](https://github.com/documentationjs/documentation/commit/84c9215)) +* **inference:** Robust parsing for shorthand object methods ([802dc4c](https://github.com/documentationjs/documentation/commit/802dc4c)) +* **scopes:** Support inner scope ([#665](https://github.com/documentationjs/documentation/issues/665)) ([8cc34b6](https://github.com/documentationjs/documentation/commit/8cc34b6)) + + +### Features + +* **core:** Support Flow interface declarations ([e2915dc](https://github.com/documentationjs/documentation/commit/e2915dc)) +* **core:** Switch to Promises everywhere. Adopt Node v4 ES6 ([#648](https://github.com/documentationjs/documentation/issues/648)) ([631c692](https://github.com/documentationjs/documentation/commit/631c692)) +* **markdown:** Add `[@see](https://github.com/see)` tag output in Markdown ([#682](https://github.com/documentationjs/documentation/issues/682)) ([f07285a](https://github.com/documentationjs/documentation/commit/f07285a)) + + + # [4.0.0-beta.18](https://github.com/documentationjs/documentation/compare/v4.0.0-beta.17...v4.0.0-beta.18) (2016-12-29) diff --git a/package.json b/package.json index 7a9c654d3..31ea7100b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "4.0.0-beta.18", + "version": "4.0.0-beta.19", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From e4e7866823c216eb902db9534552fe2c7125f174 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 10 Apr 2017 18:57:48 -0400 Subject: [PATCH 025/555] test(fixtures): Update test fixtures for new version --- test/fixture/html/nested.config-output.html | 4 ++-- test/fixture/html/nested.output.files | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index 0367dc120..b5feef73f 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -2,7 +2,7 @@ - documentation 4.0.0-beta.18 | Documentation + documentation 4.0.0-beta.19 | Documentation @@ -14,7 +14,7 @@

documentation

-
4.0.0-beta.18
+
4.0.0-beta.19
- documentation 4.0.0-beta.18 | Documentation + documentation 4.0.0-beta.19 | Documentation @@ -14,7 +14,7 @@

documentation

-
4.0.0-beta.18
+
4.0.0-beta.19
Date: Wed, 12 Apr 2017 12:22:50 -0400 Subject: [PATCH 026/555] test(description-tag): Confirm behavior of description tag with tests (#720) The `@description` tag allows people to specify a description of a node in any place in the JSDoc comment, instead of only at the beginning. Fixes https://github.com/documentationjs/documentation/issues/341 --- test/fixture/meta.input.js | 3 ++- test/fixture/meta.output.json | 25 +++++++++++++++---------- test/lib/parse.js | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/test/fixture/meta.input.js b/test/fixture/meta.input.js index 3ae757562..6a390e06c 100644 --- a/test/fixture/meta.input.js +++ b/test/fixture/meta.input.js @@ -1,6 +1,7 @@ /** - * This function returns the number one. + * This description is ignored because the method has a tagged description. * @returns {number} numberone + * @description This function returns the number one. * @see {@link http://github.com/|github} * @see TestCase * @see [markdown link](http://foo.com/) diff --git a/test/fixture/meta.output.json b/test/fixture/meta.output.json index 38acd1703..9eb923915 100644 --- a/test/fixture/meta.output.json +++ b/test/fixture/meta.output.json @@ -62,40 +62,45 @@ "name": "number" } }, + { + "title": "description", + "description": "This function returns the number one.", + "lineNumber": 3 + }, { "title": "see", "description": "{@link http://github.com/|github}", - "lineNumber": 3 + "lineNumber": 4 }, { "title": "see", "description": "TestCase", - "lineNumber": 4 + "lineNumber": 5 }, { "title": "see", "description": "[markdown link](http://foo.com/)", - "lineNumber": 5 + "lineNumber": 6 }, { "title": "version", "description": "1.0.0", - "lineNumber": 6 + "lineNumber": 7 }, { "title": "since", "description": "2.0.0", - "lineNumber": 7 + "lineNumber": 8 }, { "title": "copyright", "description": "Tom MacWright", - "lineNumber": 8 + "lineNumber": 9 }, { "title": "license", "description": "BSD", - "lineNumber": 9 + "lineNumber": 10 } ], "loc": { @@ -104,18 +109,18 @@ "column": 0 }, "end": { - "line": 11, + "line": 12, "column": 3 } }, "context": { "loc": { "start": { - "line": 12, + "line": 13, "column": 0 }, "end": { - "line": 15, + "line": 16, "column": 2 } } diff --git a/test/lib/parse.js b/test/lib/parse.js index 2e7518520..558979c2a 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -107,6 +107,21 @@ test('parse - @augments', function(t) { t.end(); }); +test('parse - @description', function(t) { + t.deepEqual( + evaluate(function() { + /** + * This is a free-form description + * @description This tagged description wins, and [is markdown](http://markdown.com). + */ + })[0].description, + remark().parse('This tagged description wins, and [is markdown](http://markdown.com).'), + 'description' + ); + + t.end(); +}); + /* * Dossier-style augments tag * https://github.com/google/closure-library/issues/746 From 191056edf4dea788f067b6fb5a357063b04e3852 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 12 Apr 2017 12:37:52 -0400 Subject: [PATCH 027/555] test(format_type): Test formatting of string enums (#721) Fixes #662 --- test/format_type.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/format_type.js b/test/format_type.js index 274e1df08..827a3dcca 100644 --- a/test/format_type.js +++ b/test/format_type.js @@ -34,6 +34,8 @@ test('formatType', function(t) { 'number!', '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)!' ], + ["('pre'|'post')", '(`"pre"` \\| `"post"`)'], + ["'pre'|'post'", '(`"pre"` \\| `"post"`)'], [ 'function(string, boolean)', 'function ([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String), [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean))' From 6961ee8c98d4efc88a1dd6280fc303cc632fa0fa Mon Sep 17 00:00:00 2001 From: Leon Pearce Date: Fri, 14 Apr 2017 02:53:32 +1000 Subject: [PATCH 028/555] fix(params): added code path for type RestElement * FIX: added code path for type RestElement * TEST: integration test for documenting RestElement node --- lib/infer/params.js | 2 + test/fixture/params.input.js | 13 ++ test/fixture/params.output.json | 309 +++++++++++++++++++++++++++++ test/fixture/params.output.md | 14 ++ test/fixture/params.output.md.json | 278 ++++++++++++++++++++++++++ 5 files changed, 616 insertions(+) diff --git a/lib/infer/params.js b/lib/infer/params.js index c65d5709e..ffa430034 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -96,6 +96,8 @@ function paramToDoc( return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); } else if (property.type === 'RestProperty') { return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); + } else if (property.type === 'RestElement') { + return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); } throw new Error(`Unknown property encountered: ${property.type}`); } diff --git a/test/fixture/params.input.js b/test/fixture/params.input.js index b57e213f2..cea9becdf 100644 --- a/test/fixture/params.input.js +++ b/test/fixture/params.input.js @@ -94,3 +94,16 @@ export const myfunc = (x = 123) => x; function foo(address) { return address; } + +/** + * This tests our support for iterator rest inside an + * iterator destructure (RestElement) + * + * @param {any} $0.x head of iterator + * @param {any[]} ...$0.xs body of iterator + * + * @returns {any[]} rotated such that the last element was the first + */ +export function rotate([x, ...xs]) { + return [...xs, x]; +} diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index a8aa42440..01241aec6 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -2461,5 +2461,314 @@ } ], "namespace": "foo" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 35, + "offset": 85 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 35, + "offset": 85 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 35, + "offset": 85 + } + } + }, + "tags": [ + { + "title": "param", + "description": "head of iterator", + "lineNumber": 4, + "type": { + "type": "NameExpression", + "name": "any" + }, + "name": "$0.x" + }, + { + "title": "param", + "description": "...$0.xs body of iterator", + "lineNumber": 5, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "any" + } + ] + }, + "name": null, + "errors": [ + "Missing or invalid tag name" + ] + }, + { + "title": "returns", + "description": "rotated such that the last element was the first", + "lineNumber": 7, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "any" + } + ] + } + } + ], + "loc": { + "start": { + "line": 98, + "column": 0 + }, + "end": { + "line": 106, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 107, + "column": 0 + }, + "end": { + "line": 109, + "column": 1 + } + } + }, + "augments": [], + "errors": [ + { + "message": "Missing or invalid tag name" + } + ], + "examples": [], + "params": [ + { + "title": "param", + "name": "$0", + "type": { + "type": "AllLiteral" + }, + "properties": [ + { + "title": "param", + "name": "$0.x", + "lineNumber": 4, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "head of iterator", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + } + } + }, + "type": { + "type": "NameExpression", + "name": "any" + } + }, + { + "title": "param", + "name": "$0.xs", + "lineNumber": 107, + "type": { + "type": "RestType" + } + } + ] + } + ], + "properties": [], + "returns": [ + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "rotated such that the last element was the first", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 49, + "offset": 48 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 49, + "offset": 48 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 49, + "offset": 48 + } + } + }, + "title": "returns", + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "any" + } + ] + } + } + ], + "sees": [], + "throws": [], + "todos": [], + "name": "rotate", + "kind": "function", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "rotate", + "kind": "function" + } + ], + "namespace": "rotate" } ] \ No newline at end of file diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md index aed20ddb1..c9df3621a 100644 --- a/test/fixture/params.output.md +++ b/test/fixture/params.output.md @@ -13,6 +13,7 @@ - [GeoJSONSource](#geojsonsource) - [myfunc](#myfunc) - [foo](#foo-1) +- [rotate](#rotate) ## addThem @@ -123,3 +124,16 @@ or any type information we could infer from annotations. **Parameters** - `address` An IPv6 address string + +## rotate + +This tests our support for iterator rest inside an +iterator destructure (RestElement) + +**Parameters** + +- `$0` **any** + - `$0.x` **any** head of iterator + - `$0.xs` **...any** + +Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<any>** rotated such that the last element was the first diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json index 69bff4d98..f8f56c216 100644 --- a/test/fixture/params.output.md.json +++ b/test/fixture/params.output.md.json @@ -2190,6 +2190,284 @@ ] } ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "rotate" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 35, + "offset": 85 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 35, + "offset": 85 + }, + "indent": [ + 1 + ] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "any" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.x" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "any" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "head of iterator", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "$0.xs" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "..." + }, + { + "type": "text", + "value": "any" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "type": "text", + "value": "any" + }, + { + "type": "text", + "value": ">" + } + ] + }, + { + "type": "text", + "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "rotated such that the last element was the first", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 49, + "offset": 48 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 49, + "offset": 48 + }, + "indent": [] + } + } + ] } ] } \ No newline at end of file From fc1cd13e5763f3a8b5709a22267f077fb3b4beb7 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 13 Apr 2017 12:54:11 -0400 Subject: [PATCH 029/555] chore(package): update flow-bin to version 0.44.0 (#723) https://greenkeeper.io/ --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 31ea7100b..ffbd555b4 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "chdir": "0.0.0", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", - "flow-bin": "^0.43.1", + "flow-bin": "^0.44.0", "fs-extra": "^2.1.2", "husky": "^0.13.3", "json-schema": "0.2.3", From d8ec5da121630c0c110dd09c9087946e8223cd6a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 14 Apr 2017 17:35:27 -0400 Subject: [PATCH 030/555] refactor(exported-extractor): Use Map object instead of Object.create(null) (#730) The map object provides a cleaner and more predictable way to deal with indexed data in JavaScript. I wrote something about that here http://www.macwright.org/2017/03/13/maps-not-strictly-better.html --- lib/extractors/exported.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js index b569a7441..c400e49e4 100644 --- a/lib/extractors/exported.js +++ b/lib/extractors/exported.js @@ -28,7 +28,7 @@ function walkExported( ) { var newResults = []; var filename = data.file; - var dataCache = Object.create(null); + var dataCache = new Map(); function addBlankComment(data, path, node) { return addComment(data, '', node.loc, path, node.loc, true); @@ -178,7 +178,7 @@ function getCachedData(dataCache, filePath) { path = require.resolve(path); } - var value = dataCache[path]; + var value = dataCache.get(path); if (!value) { var input = fs.readFileSync(path, 'utf-8'); var ast = parseToAst(input, path); @@ -189,7 +189,7 @@ function getCachedData(dataCache, filePath) { }, ast }; - dataCache[path] = value; + dataCache.set(path, value); } return value; } From 9eca36cdc3dd73e1c594481a086352012644396f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 15 Apr 2017 15:59:55 -0400 Subject: [PATCH 031/555] build(husky): Run git add on formatted updated files (#733) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ffbd555b4..105c69efc 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,8 @@ }, "lint-staged": { "*.js": [ - "prettier --write --single-quote" + "prettier --write --single-quote", + "git add" ] }, "greenkeeper": { From 73747306a0ebbab21ed8d6f44e58431928f85032 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 21 Apr 2017 17:28:53 -0400 Subject: [PATCH 032/555] refactor(nest): Better nesting implementation (#732) * refactor(nest): Better nesting implementation This nesting implementation uses a proper recursive tree algorithm Fixes https://github.com/documentationjs/documentation/issues/554 BREAKING CHANGE: referencing inferred destructure params without renaming them, like $0.x, from JSDoc comments will no longer work. To reference them, instead add a param tag to name the destructuring param, and then refer to members of that name. Before: ```js /** * @param {number} $0.x a member of x */ function a({ x }) {} ``` After: ```js /** * @param {Object} options * @param {number} options.x a member of x */ function a({ x }) {} ``` * Address review comments * Reduce testing node requirement back down to 4 * Don't output empty properties, reduce diff noise * Rearrange and document params * Simplify param inference, update test fixtures. This is focused around Array destructuring: documenting destructured array elements with indices instead of names, because the names are purely internal details * Use temporary fork to get through blocker --- declarations/comment.js | 75 +++-- default_theme/section._ | 4 +- index.js | 43 ++- lib/infer/params.js | 464 +++++++++++++++++------------ lib/nest.js | 115 ++++--- lib/output/markdown_ast.js | 1 + lib/output/util/format_type.js | 3 +- lib/output/util/formatters.js | 2 +- lib/parse.js | 2 +- package.json | 2 +- test/fixture/es6.output-toc.md | 18 +- test/fixture/es6.output.json | 44 ++- test/fixture/es6.output.md | 18 +- test/fixture/es6.output.md.json | 71 ++++- test/fixture/params.input.js | 8 +- test/fixture/params.output.json | 257 ++++++++++------ test/fixture/params.output.md | 20 +- test/fixture/params.output.md.json | 166 ++++++++--- test/format_type.js | 2 +- test/lib/infer/params.js | 313 +++++++++++++++++++ test/lib/nest.js | 176 ++++++----- test/lib/parse.js | 4 +- 22 files changed, 1240 insertions(+), 568 deletions(-) diff --git a/declarations/comment.js b/declarations/comment.js index a876bd6e0..ecfefe5ce 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -1,4 +1,4 @@ -declare type DocumentationConfig = { +type DocumentationConfig = { polyglot?: boolean, inferPrivate?: boolean, noPackage?: boolean, @@ -12,17 +12,17 @@ declare type DocumentationConfig = { parseExtension: Array }; -declare type InputsConfig = { +type InputsConfig = { inputs: Array, config: DocumentationConfig }; -declare type CommentError = { +type CommentError = { message: string, commentLineNumber?: number }; -declare type DoctrineType = { +type DoctrineType = { elements?: Array, expression?: DoctrineType, applications?: Array, @@ -30,7 +30,7 @@ declare type DoctrineType = { name?: string }; -declare type CommentLoc = { +type CommentLoc = { start: { line: number }, @@ -39,12 +39,12 @@ declare type CommentLoc = { } }; -declare type SourceFile = { +type SourceFile = { source?: string, file: string }; -declare type CommentContext = { +type CommentContext = { sortKey: string, file: string, ast: Object, @@ -53,12 +53,26 @@ declare type CommentContext = { github?: CommentContextGitHub }; -declare type CommentContextGitHub = { +type CommentContextGitHub = { path: string, url: string }; -declare type CommentTag = { +type CommentTagBase = { + title: string +}; + +type CommentTag = CommentTagBase & { + name?: string, + title: string, + description?: Object, + default?: any, + lineNumber?: number, + type?: DoctrineType, + properties?: Array +}; + +type CommentTagNamed = CommentTag & { name?: string, title: string, description?: Object, @@ -68,7 +82,7 @@ declare type CommentTag = { properties?: Array }; -declare type CommentMembers = { +type CommentMembers = { static: Array, instance: Array, events: Array, @@ -76,32 +90,33 @@ declare type CommentMembers = { inner: Array }; -declare type CommentExample = { +type CommentExample = { caption?: string, description?: Object }; -declare type Remark = { +type Remark = { type: string, children: Array }; -declare type Access = 'private' | 'public' | 'protected'; -declare type Scope = 'instance' | 'static' | 'inner' | 'global'; -declare type Kind = 'class' | - 'constant' | - 'event' | - 'external' | - 'file' | - 'function' | - 'member' | - 'mixin' | - 'module' | - 'namespace' | - 'typedef' | - 'interface'; - -declare type Comment = { +type Access = 'private' | 'public' | 'protected'; +type Scope = 'instance' | 'static' | 'inner' | 'global'; +type Kind = + | 'class' + | 'constant' + | 'event' + | 'external' + | 'file' + | 'function' + | 'member' + | 'mixin' + | 'module' + | 'namespace' + | 'typedef' + | 'interface'; + +type Comment = { errors: Array, tags: Array, @@ -148,8 +163,8 @@ declare type Comment = { }> }; -declare type ReducedComment = { +type ReducedComment = { name: string, kind: ?Kind, scope?: ?Scope -} +}; diff --git a/default_theme/section._ b/default_theme/section._ index 4ef057fee..a7158640f 100644 --- a/default_theme/section._ +++ b/default_theme/section._ @@ -52,7 +52,7 @@ = <%- param.default %><% } %>) <%= md(param.description, true) %> - <% if (param.properties) { %> + <% if (param.properties && param.properties.length) { %> @@ -93,7 +93,7 @@ <% } %><% if (property.description) { %>: <%= md(property.description, true) %><% } %> - <% if (property.properties) { %> + <% if (property.properties && property.properties.length) { %>
    <% property.properties.forEach(function(property) { %>
  • <%- property.name %> <%= formatType(property.type) %> diff --git a/index.js b/index.js index 6ae6d0987..0c91f4c86 100644 --- a/index.js +++ b/index.js @@ -45,13 +45,10 @@ function pipeline() { }; } - - -function configure(indexes, args)/*: Promise */ { +function configure(indexes, args) /*: Promise */ { let mergedConfig = mergeConfig(args); return mergedConfig.then(config => { - let expandedInputs = expandInputs(indexes, config); return expandedInputs.then(inputs => { @@ -71,8 +68,10 @@ function configure(indexes, args)/*: Promise */ { * @param {Object} config options * @returns {Promise>} promise with results */ -function expandInputs(indexes/*: string|Array */, - config /*: DocumentationConfig */) { +function expandInputs( + indexes /*: string|Array */, + config /*: DocumentationConfig */ +) { // Ensure that indexes is an array of strings indexes = [].concat(indexes); @@ -91,23 +90,24 @@ function buildInternal(inputsAndConfig) { config.access = ['public', 'undefined', 'protected']; } - var parseFn = (config.polyglot) ? polyglot : parseJavaScript; + var parseFn = config.polyglot ? polyglot : parseJavaScript; var buildPipeline = pipeline( inferName, inferAccess(config.inferPrivate), inferAugments, inferKind, + nest, inferParams, inferProperties, inferReturn, inferMembership(), inferType, - nest, config.github && github, - garbageCollect); + garbageCollect + ); - let extractedComments = _.flatMap(inputs, function (sourceFile) { + let extractedComments = _.flatMap(inputs, function(sourceFile) { if (!sourceFile.source) { sourceFile.source = fs.readFileSync(sourceFile.file, 'utf8'); } @@ -115,16 +115,17 @@ function buildInternal(inputsAndConfig) { return parseFn(sourceFile, config).map(buildPipeline); }).filter(Boolean); - return filterAccess(config.access, - hierarchy( - sort(extractedComments, config))); + return filterAccess( + config.access, + hierarchy(sort(extractedComments, config)) + ); } function lintInternal(inputsAndConfig) { let inputs = inputsAndConfig.inputs; let config = inputsAndConfig.config; - let parseFn = (config.polyglot) ? polyglot : parseJavaScript; + let parseFn = config.polyglot ? polyglot : parseJavaScript; let lintPipeline = pipeline( lintComments, @@ -137,7 +138,8 @@ function lintInternal(inputsAndConfig) { inferReturn, inferMembership(), inferType, - nest); + nest + ); let extractedComments = _.flatMap(inputs, sourceFile => { if (!sourceFile.source) { @@ -183,8 +185,7 @@ function lintInternal(inputsAndConfig) { * } * }); */ -let lint = (indexes, args) => configure(indexes, args) - .then(lintInternal); +let lint = (indexes, args) => configure(indexes, args).then(lintInternal); /** * Generate JavaScript documentation as a list of parsed JSDoc @@ -227,8 +228,7 @@ let lint = (indexes, args) => configure(indexes, args) * // any other kind of code data. * }); */ -let build = (indexes, args) => configure(indexes, args) - .then(buildInternal); +let build = (indexes, args) => configure(indexes, args).then(buildInternal); /** * Documentation's formats are modular methods that take comments @@ -240,9 +240,8 @@ let build = (indexes, args) => configure(indexes, args) var formats = { html: require('./lib/output/html'), md: require('./lib/output/markdown'), - remark: (comments/*: Array */, config/*: DocumentationConfig */) => - markdownAST(comments, config) - .then(res => JSON.stringify(res, null, 2)), + remark: (comments /*: Array */, config /*: DocumentationConfig */) => + markdownAST(comments, config).then(res => JSON.stringify(res, null, 2)), json: require('./lib/output/json') }; diff --git a/lib/infer/params.js b/lib/infer/params.js index ffa430034..2861bee70 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -1,59 +1,57 @@ 'use strict'; /* @flow */ -var t = require('babel-types'), - findTarget = require('./finders').findTarget, - flowDoctrine = require('../flow_doctrine'); - -function addPrefix(doc, prefix) { - if (!Array.isArray(doc) && doc.name) { - doc.name = prefix + doc.name; - } - return doc; -} +const t = require('babel-types'); +const generate = require('babel-generator').default; +const _ = require('lodash'); +const findTarget = require('./finders').findTarget; +const flowDoctrine = require('../flow_doctrine'); +const util = require('util'); +const debuglog = util.debuglog('infer'); /** - * Given a parameter like - * - * function a(b = 1) - * - * Format it as an optional parameter in JSDoc land + * Infers param tags by reading function parameter names * - * @param {Object} param ESTree node - * @returns {Object} JSDoc param + * @param {Object} comment parsed comment + * @returns {Object} comment with parameters */ -function paramWithDefaultToDoc( - param, - comment, - i -) /*: CommentTag | Array */ { - var newParam = paramToDoc(param.left, comment, i, ''); +function inferParams(comment /*: Comment */) { + var path = findTarget(comment.context.ast); - var defaultValue = comment.context.code.substring( - param.right.start, - param.right.end - ); + // In case of `/** */ var x = function () {}` findTarget returns + // the declarator. + if (t.isVariableDeclarator(path)) { + path = path.get('init'); + } - // this is a destructuring parameter with defaults - if (Array.isArray(newParam)) { - newParam[0].default = defaultValue; - return newParam; + if (!t.isFunction(path)) { + return comment; } - var optionalParam /*: CommentTag */ = { - title: 'param', - name: newParam.name, - default: defaultValue - }; + var inferredParams = path.node.params.map((param, i) => + paramToDoc(param, '', i)); - if (newParam.type) { - optionalParam.type = { - type: 'OptionalType', - expression: newParam.type - }; - } + var mergedParams = mergeTrees(inferredParams, comment.params); - return optionalParam; + // Then merge the trees. This is the hard part. + return _.assign(comment, { + params: mergedParams + }); +} + +// Utility methods ============================================================ +// +const PATH_SPLIT_CAPTURING = /(\[])?(\.)/g; + +/** + * Index tags by their `name` property into an ES6 map. + */ +function mapTags(tags) { + return new Map( + tags.map(tag => { + return [tag.name, tag]; + }) + ); } /** @@ -69,192 +67,262 @@ function paramWithDefaultToDoc( * * @private * @param {Object} param the abstract syntax tree of the parameter in JavaScript - * @param {Object} comment the full comment object * @param {number} i the number of this parameter, in argument order * @param {string} prefix of the comment, if it is nested, like in the case of destructuring * @returns {Object} parameter with inference. */ function paramToDoc( param, - comment /*: Comment */, - i /*: number */, - prefix /*: string */ -) /*: Array | CommentTag */ { - function destructuringPropertyToDoc( - property - ) /*: Array | CommentTag */ { - if (property.type === 'ObjectProperty') { - return paramToDoc( - property.value, - comment, - i, - prefix + '$' + String(i) + '.' - ); - } else if (property.type === 'Identifier') { - // if the destructuring type is an array, the elements - // in it are identifiers - return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); - } else if (property.type === 'RestProperty') { - return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); - } else if (property.type === 'RestElement') { - return paramToDoc(property, comment, i, prefix + '$' + String(i) + '.'); - } - throw new Error(`Unknown property encountered: ${property.type}`); - } + prefix /*: string */, + i /*: ?number */ +) /*: CommentTag|Array */ { + const autoName = '$' + String(i); + const prefixedName = prefix + '.' + param.name; - function destructuringObjectParamToDoc(param) /*: Array */ { - return [ - { - title: 'param', - name: '$' + String(i), - type: flowDoctrine(param) || { - type: 'NameExpression', - name: 'Object' - } + switch (param.type) { + case 'AssignmentPattern': // (a = b) + const newAssignmentParam = paramToDoc(param.left, '', i); + + if (Array.isArray(newAssignmentParam)) { + throw new Error('Encountered an unexpected parameter type'); } - ].concat(param.properties.map(destructuringPropertyToDoc)); - } - function destructuringArrayParamToDoc(param) /*: Array */ { - return [ - { - title: 'param', - name: '$' + String(i), - type: flowDoctrine(param) || { - type: 'NameExpression', - name: 'Array' + return _.assign(newAssignmentParam, { + default: generate(param.right, { + compact: true + }).code, + type: { + type: 'OptionalType', + expression: newAssignmentParam.type } + }); + // ObjectPattern + case 'ObjectPattern': // { a } + if (prefix === '') { + // If this is a root-level param, like f({ x }), then we need to name + // it, like $0 or $1, depending on its position. + return { + title: 'param', + name: autoName, + anonymous: true, + type: (param.typeAnnotation && flowDoctrine(param)) || { + type: 'NameExpression', + name: 'Object' + }, + properties: _.flatMap(param.properties, prop => { + return paramToDoc(prop, prefix + autoName); + }) + }; + } else if (param.indexed) { + // Likewise, if this object pattern sits inside of an ArrayPattern, + // like [{ foo }], it shouldn't just look like $0.foo, but like $0.0.foo, + // so make sure it isn't indexed first. + return { + title: 'param', + name: prefixedName, + anonymous: true, + type: (param.typeAnnotation && flowDoctrine(param)) || { + type: 'NameExpression', + name: 'Object' + }, + properties: _.flatMap(param.properties, prop => { + return paramToDoc(prop, prefixedName); + }) + }; } - ].concat(param.elements.map(destructuringPropertyToDoc)); - } - - function restParamToDoc(param) /*: CommentTag */ { - let type /*: DoctrineType */ = { - type: 'RestType' - }; - if (param.typeAnnotation) { - type.expression = flowDoctrine(param.typeAnnotation.typeAnnotation); - } - var newParam = { - title: 'param', - name: param.argument.name, - lineNumber: param.loc.start.line, - type - }; - return newParam; - } - - // ES6 default - if (param.type === 'AssignmentPattern') { - return addPrefix(paramWithDefaultToDoc(param, comment, i), prefix); - } + // If, otherwise, this is nested, we don't really represent it as + // a parameter in and of itself - we just want its children, and + // it will be the . in obj.prop + return _.flatMap(param.properties, prop => { + return paramToDoc(prop, prefix); + }); + // ArrayPattern + case 'ArrayPattern': // ([a, b, { c }]) + if (prefix === '') { + return { + title: 'param', + name: autoName, + anonymous: true, + type: (param.typeAnnotation && flowDoctrine(param)) || { + type: 'NameExpression', + name: 'Array' + }, + // Array destructuring lets you name the elements in the array, + // but those names don't really make sense within the JSDoc + // indexing tradition, or have any external meaning. So + // instead we're going to (immutably) rename the parameters to their + // indices + properties: _.flatMap(param.elements, (element, idx) => { + var indexedElement = _.assign({}, element, { + name: String(idx), + indexed: true + }); + return paramToDoc(indexedElement, autoName); + }) + }; + } + return _.flatMap(param.elements, (element, idx) => { + var indexedElement = _.assign({}, element, { + name: String(idx) + }); + return paramToDoc(indexedElement, prefix); + }); + case 'ObjectProperty': + return _.assign(paramToDoc(param.value, prefix + '.' + param.key.name), { + name: prefix + '.' + param.key.name + }); + case 'RestProperty': // (a, ...b) + case 'RestElement': + let type /*: DoctrineType */ = { + type: 'RestType' + }; + if (param.typeAnnotation) { + type.expression = flowDoctrine(param.typeAnnotation.typeAnnotation); + } + return { + title: 'param', + name: param.argument.name, + name: prefix ? `${prefix}.${param.argument.name}` : param.argument.name, + lineNumber: param.loc.start.line, + type + }; + default: + // (a) + var newParam /*: CommentTagNamed */ = { + title: 'param', + name: prefix ? prefixedName : param.name, + lineNumber: param.loc.start.line + }; - if (param.type === 'ObjectPattern') { - return destructuringObjectParamToDoc(param); - } + // Flow/TS annotations + if (param.typeAnnotation && param.typeAnnotation.typeAnnotation) { + newParam.type = flowDoctrine(param.typeAnnotation.typeAnnotation); + } - if (param.type === 'ArrayPattern') { - return destructuringArrayParamToDoc(param); + return newParam; } +} - if (param.type === 'RestProperty' || param.type === 'RestElement') { - return addPrefix(restParamToDoc(param), prefix); +/** + * Recurse through a potentially nested parameter tag, + * replacing the auto-generated name, like $0, with an explicit + * name provided from a JSDoc comment. For instance, if you have a code + * block like + * + * function f({ x }); + * + * It would by default be documented with a first param $0, with a member $0.x + * + * If you specify the name of the param, then it could be documented with, say, + * options and options.x. So we need to recursively rename not just $0 but + * also $0.x and maybe $0.x.y.z all to options.x and options.x.y.z + */ +function renameTree(node, explicitName) { + var parts = node.name.split(PATH_SPLIT_CAPTURING); + parts[0] = explicitName; + node.name = parts.join(''); + if (node.properties) { + node.properties.forEach(property => renameTree(property, explicitName)); } +} - var newParam /*: CommentTag */ = { - title: 'param', - name: param.name, - lineNumber: param.loc.start.line - }; +function mergeTrees(inferred, explicit) { + // The first order of business is ensuring that the root types are specified + // in the right order. For the order of arguments, the inferred reality + // is the ground-truth: a function like + // function addThem(a, b, c) {} + // Should always see (a, b, c) in that order - // Flow/TS annotations - if (param.typeAnnotation && param.typeAnnotation.typeAnnotation) { - newParam.type = flowDoctrine(param.typeAnnotation.typeAnnotation); + // First, if all parameters are specified, allow explicit names to apply + // to destructuring parameters, which do not have inferred names. This is + // _only_ enabled in the case in which all parameters are specified explicitly + if (inferred.length === explicit.length) { + for (var i = 0; i < inferred.length; i++) { + if (inferred[i].anonymous === true) { + renameTree(inferred[i], explicit[i].name); + } + } } - return addPrefix(newParam, prefix); + return mergeTopNodes(inferred, explicit); } -function insertBeforeDependents(comment, comments) { - var dependentNamePrefix = comment.name + '.'; - for ( - var insertionIndex = 0; - insertionIndex < comments.length; - insertionIndex++ - ) { - let commentName = comments[insertionIndex].name; - if (commentName && commentName.indexOf(dependentNamePrefix) === 0) { - break; - } +function mergeTopNodes(inferred, explicit) { + const mapExplicit = mapTags(explicit); + const inferredNames = new Set(inferred.map(tag => tag.name)); + const explicitTagsWithoutInference = explicit.filter( + tag => !inferredNames.has(tag.name) + ); + + if (explicitTagsWithoutInference.length) { + debuglog( + `${explicitTagsWithoutInference.length} tags were specified but didn't match ` + + `inferred information ${explicitTagsWithoutInference + .map(t => t.name) + .join(', ')}` + ); } - return comments - .slice(0, insertionIndex) - .concat(comment) - .concat(comments.slice(insertionIndex)); + + return inferred + .map(inferredTag => { + const explicitTag = mapExplicit.get(inferredTag.name); + return explicitTag ? combineTags(inferredTag, explicitTag) : inferredTag; + }) + .concat(explicitTagsWithoutInference); } -/** - * Infers param tags by reading function parameter names - * - * @param {Object} comment parsed comment - * @returns {Object} comment with parameters - */ -function inferParams(comment /*: Comment */) { - var path = findTarget(comment.context.ast); +// This method is used for _non-root_ properties only - we use mergeTopNodes +// for root properties, which strictly requires inferred only. In this case, +// we combine all tags: +// - inferred & explicit +// - explicit only +// - inferred only +function mergeNodes(inferred, explicit) { + const intersection = _.intersectionBy(inferred, explicit, tag => tag.name); + const explicitOnly = _.differenceBy(explicit, inferred, tag => tag.name); + const inferredOnly = _.differenceBy(inferred, explicit, tag => tag.name); + const mapExplicit = mapTags(explicit); - // In case of `/** */ var x = function () {}` findTarget returns - // the declarator. - if (t.isVariableDeclarator(path)) { - path = path.get('init'); - } + return intersection + .map(inferredTag => { + const explicitTag = mapExplicit.get(inferredTag.name); + return explicitTag ? combineTags(inferredTag, explicitTag) : inferredTag; + }) + .concat(explicitOnly) + .concat(inferredOnly); +} - if (!t.isFunction(path)) { - return comment; +function combineTags(inferredTag, explicitTag) { + let type = explicitTag.type; + var defaultValue; + if (!explicitTag.type) { + type = inferredTag.type; + } else if (explicitTag.type.type !== 'OptionalType' && inferredTag.default) { + type = { + type: 'OptionalType', + expression: explicitTag.type + }; + defaultValue = inferredTag.default; } - // Ensure that explicitly specified parameters are not overridden - // by inferred parameters - var existingParams = {}; - comment.params.forEach(function(param) { - if (typeof param.name === 'string') { - existingParams[param.name] = param; - } - }); - - var paramOrder = {}; - var i = 0; + const hasProperties = (inferredTag.properties && + inferredTag.properties.length) || + (explicitTag.properties && explicitTag.properties.length); - path.node.params - .reduce( - function(params, param, i) { - return params.concat(paramToDoc(param, comment, i, '')); - }, - [] - ) - .forEach(function(doc) { - if (!existingParams.hasOwnProperty(doc.name)) { - // This type is not explicitly documented - comment.params = insertBeforeDependents(doc, comment.params); - } else if (!existingParams[doc.name].type) { - // This param has a description, but potentially it can - // be have an inferred type. Infer its type without - // dropping the description. - if (doc.type) { - existingParams[doc.name].type = doc.type; + return _.assign( + explicitTag, + hasProperties + ? { + properties: mergeNodes( + inferredTag.properties || [], + explicitTag.properties || [] + ) } - } else if ( - existingParams[doc.name].type.type !== 'OptionalType' && doc.default - ) { - existingParams[doc.name].type = { - type: 'OptionalType', - expression: existingParams[doc.name].type, - default: doc.default - }; - } - paramOrder[doc.name] = i++; - }); - - return comment; + : {}, + { type }, + defaultValue ? { default: defaultValue } : {} + ); } module.exports = inferParams; +module.exports.mergeTrees = mergeTrees; diff --git a/lib/nest.js b/lib/nest.js index 753adf6e3..5dd91d317 100644 --- a/lib/nest.js +++ b/lib/nest.js @@ -1,9 +1,35 @@ /* @flow */ 'use strict'; +var _ = require('lodash'); + +const PATH_SPLIT = /(?:\[])?\./g; + +function removeUnnamedTags( + tags /*: Array */ +) /*: Array */ { + return tags.filter(tag => typeof tag.name === 'string'); +} + +var tagDepth = tag => tag.name.split(PATH_SPLIT).length; + /** * Nest nestable tags, like param and property, into nested * arrays that are suitable for output. + * Okay, so we're building a tree of comments, with the tag.name + * being the indexer. We sort by depth, so that we add each + * level of the tree incrementally, and throw if we run against + * a node that doesn't have a parent. + * + * foo.abe + * foo.bar.baz + * foo.bar.a + * foo.bar[].bax + * + * foo -> .abe + * \-> .bar -> .baz + * \-> .a + * \-> [].baz * * @private * @param {Object} comment a comment with tags @@ -11,52 +37,50 @@ * @param {string} target the tag to nest into * @returns {Object} nested comment */ -function nestTag( - comment /*: Comment */, - tagTitle /*: string */, - target /*: string */ -) { - if (!comment[target]) { - return comment; - } +var nestTag = ( + tags /*: Array */ + // Use lodash here both for brevity and also because, unlike JavaScript's + // sort, it's stable. +) => + _.sortBy(removeUnnamedTags(tags), tagDepth).reduce( + (memo, tag) => { + function insertTag(node, parts) { + // The 'done' case: we're at parts.length === 1, + // this is where the node should be placed. We reliably + // get to this case because the recursive method + // is always passed parts.slice(1) + if (parts.length === 1) { + _.assign(node, { + properties: (node.properties || []).concat(tag) + }); + } else { + // The recursive case: try to find the child that owns + // this tag. + let child = node.properties && + node.properties.find( + property => parts[0] === _.last(property.name.split(PATH_SPLIT)) + ); - var result = [], index = {}; + if (!child) { + if (tag.name.match(/^(\$\d+)/)) { + throw new Error( + `Parent of ${tag.name} not found. To document a destructuring\n` + + `type, add a @param tag in its position to specify the name of the\n` + + `destructured parameter` + ); + } + throw new Error(`Parent of ${tag.name} not found`); + } - comment[target].forEach(tag => { - var tagName = tag.name; - if (tagName) { - index[tagName] = tag; - var parts = tagName - .split(/(\[\])?\./) - .filter(part => part && part !== '[]'); - if (parts.length > 1) { - var parent = index[parts.slice(0, -1).join('.')]; - if (parent === undefined) { - comment.errors.push({ - message: '@' + - tagTitle + - ' ' + - tag.name + - "'s parent " + - parts[0] + - ' not found', - commentLineNumber: tag.lineNumber - }); - result.push(tag); - return; + insertTag(child, parts.slice(1)); } - parent.properties = parent.properties || []; - parent.properties.push(tag); - } else { - result.push(tag); } - } - }); - comment[target] = result; - - return comment; -} + insertTag(memo, tag.name.split(PATH_SPLIT)); + return memo; + }, + { properties: [] } + ).properties; /** * Nests @@ -70,8 +94,11 @@ function nestTag( * @param {Object} comment input comment * @return {Object} nested comment */ -function nest(comment /*: Comment*/) { - return nestTag(nestTag(comment, 'param', 'params'), 'property', 'properties'); -} +var nest = (comment /*: Comment*/) => + _.assign(comment, { + params: nestTag(comment.params), + properties: nestTag(comment.properties) + }); module.exports = nest; +module.exports.nestTag = nestTag; diff --git a/lib/output/markdown_ast.js b/lib/output/markdown_ast.js index 29e0537a3..2a7f10bec 100644 --- a/lib/output/markdown_ast.js +++ b/lib/output/markdown_ast.js @@ -72,6 +72,7 @@ function buildMarkdownAST( } function paramList(params /*: Array */) { + if (params.length === 0) return []; return u( 'list', { ordered: false }, diff --git a/lib/output/util/format_type.js b/lib/output/util/format_type.js index 072542866..37d79b8b4 100644 --- a/lib/output/util/format_type.js +++ b/lib/output/util/format_type.js @@ -1,6 +1,7 @@ /* @flow */ 'use strict'; -var Syntax = require('doctrine').Syntax, u = require('unist-builder'); +var Syntax = require('doctrine-temporary-fork').Syntax, + u = require('unist-builder'); /** * Shortcut to create a new text node diff --git a/lib/output/util/formatters.js b/lib/output/util/formatters.js index c368c3eb2..861df2114 100644 --- a/lib/output/util/formatters.js +++ b/lib/output/util/formatters.js @@ -2,7 +2,7 @@ 'use strict'; var remark = require('remark'), html = require('remark-html'), - Syntax = require('doctrine').Syntax, + Syntax = require('doctrine-temporary-fork').Syntax, u = require('unist-builder'), _rerouteLinks = require('./reroute_links'), highlighter = require('../highlighter'), diff --git a/lib/parse.js b/lib/parse.js index eccd60573..653a0a9a8 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1,7 +1,7 @@ 'use strict'; /* @flow */ -var doctrine = require('doctrine'); +var doctrine = require('doctrine-temporary-fork'); var parseMarkdown = require('./parse_markdown'); /** diff --git a/package.json b/package.json index 105c69efc..1b5c8ebfa 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "chokidar": "^1.2.0", "concat-stream": "^1.5.0", "disparity": "^2.0.0", - "doctrine": "^2.0.0", + "doctrine-temporary-fork": "2.0.0-alpha-allowarrayindex", "get-comments": "^1.0.1", "git-url-parse": "^6.0.1", "github-slugger": "1.1.1", diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md index 95a3c2c68..4060592c0 100644 --- a/test/fixture/es6.output-toc.md +++ b/test/fixture/es6.output-toc.md @@ -7,9 +7,9 @@ have any parameter descriptions. **Parameters** -- `$0` **any** (optional, default `{}`) - - `$0.phoneNumbers` (optional, default `[]`) - - `$0.emailAddresses` (optional, default `[]`) +- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) + - `$0.phoneNumbers` **any?** (optional, default `[]`) + - `$0.emailAddresses` **any?** (optional, default `[]`) - `$0.params` **...any** ## destructure @@ -18,10 +18,10 @@ Similar, but with an array **Parameters** -- `$0` **any** - - `$0.a` - - `$0.b` - - `$0.c` +- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** + - `$0.0` + - `$0.1` + - `$0.2` **Examples** @@ -113,7 +113,7 @@ This tests our support of optional parameters in ES6 **Parameters** -- `foo` (optional, default `'bar'`) +- `foo` **any?** (optional, default `'bar'`) ## iAmProtected @@ -135,6 +135,6 @@ Regression check for #498 - `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** - `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`) +- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 7ada1a342..2f66ac9b6 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -86,20 +86,32 @@ { "title": "param", "name": "$0", + "anonymous": true, "type": { - "type": "AllLiteral" + "type": "OptionalType", + "expression": { + "type": "NameExpression", + "name": "Object" + } }, - "default": "{}", "properties": [ { "title": "param", "name": "$0.phoneNumbers", - "default": "[]" + "lineNumber": 6, + "default": "[]", + "type": { + "type": "OptionalType" + } }, { "title": "param", "name": "$0.emailAddresses", - "default": "[]" + "lineNumber": 6, + "default": "[]", + "type": { + "type": "OptionalType" + } }, { "title": "param", @@ -109,7 +121,8 @@ "type": "RestType" } } - ] + ], + "default": "{}" } ], "properties": [], @@ -227,23 +240,25 @@ { "title": "param", "name": "$0", + "anonymous": true, "type": { - "type": "AllLiteral" + "type": "NameExpression", + "name": "Array" }, "properties": [ { "title": "param", - "name": "$0.a", + "name": "$0.0", "lineNumber": 14 }, { "title": "param", - "name": "$0.b", + "name": "$0.1", "lineNumber": 14 }, { "title": "param", - "name": "$0.c", + "name": "$0.2", "lineNumber": 14 } ] @@ -2299,7 +2314,11 @@ { "title": "param", "name": "foo", - "default": "'bar'" + "lineNumber": 114, + "default": "'bar'", + "type": { + "type": "OptionalType" + } } ], "properties": [], @@ -2761,7 +2780,7 @@ { "title": "param", "name": "compareFunction", - "default": "(a: T, b: T): boolean => a === b", + "lineNumber": 153, "type": { "type": "OptionalType", "expression": { @@ -2789,7 +2808,8 @@ "name": "boolean" } } - } + }, + "default": "(a:T,b:T):boolean=>a===b" } ], "properties": [], diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 985716788..416e00c6a 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -30,9 +30,9 @@ have any parameter descriptions. **Parameters** -- `$0` **any** (optional, default `{}`) - - `$0.phoneNumbers` (optional, default `[]`) - - `$0.emailAddresses` (optional, default `[]`) +- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) + - `$0.phoneNumbers` **any?** (optional, default `[]`) + - `$0.emailAddresses` **any?** (optional, default `[]`) - `$0.params` **...any** ## destructure @@ -41,10 +41,10 @@ Similar, but with an array **Parameters** -- `$0` **any** - - `$0.a` - - `$0.b` - - `$0.c` +- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** + - `$0.0` + - `$0.1` + - `$0.2` **Examples** @@ -136,7 +136,7 @@ This tests our support of optional parameters in ES6 **Parameters** -- `foo` (optional, default `'bar'`) +- `foo` **any?** (optional, default `'bar'`) ## iAmProtected @@ -158,6 +158,6 @@ Regression check for #498 - `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** - `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a: T, b: T): boolean => a === b`) +- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index 7826d97d5..3c6e7eb2b 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -84,9 +84,20 @@ { "type": "strong", "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "children": [ + { + "type": "text", + "value": "Object" + } + ] + }, { "type": "text", - "value": "any" + "value": "?" } ] }, @@ -131,6 +142,19 @@ "type": "text", "value": " " }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "any" + }, + { + "type": "text", + "value": "?" + } + ] + }, { "type": "text", "value": " " @@ -170,6 +194,19 @@ "type": "text", "value": " " }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "any" + }, + { + "type": "text", + "value": "?" + } + ] + }, { "type": "text", "value": " " @@ -312,8 +349,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "any" + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] } ] }, @@ -335,7 +379,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.a" + "value": "$0.0" }, { "type": "text", @@ -357,7 +401,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.b" + "value": "$0.1" }, { "type": "text", @@ -379,7 +423,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.c" + "value": "$0.2" }, { "type": "text", @@ -1773,6 +1817,19 @@ "type": "text", "value": " " }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "any" + }, + { + "type": "text", + "value": "?" + } + ] + }, { "type": "text", "value": " " @@ -2172,7 +2229,7 @@ }, { "type": "inlineCode", - "value": "(a: T, b: T): boolean => a === b" + "value": "(a:T,b:T):boolean=>a===b" }, { "type": "text", diff --git a/test/fixture/params.input.js b/test/fixture/params.input.js index cea9becdf..50e7b514e 100644 --- a/test/fixture/params.input.js +++ b/test/fixture/params.input.js @@ -8,7 +8,8 @@ function addThem(a, b, c, { d, e, f }) { /** * This method has partially inferred params - * @param {String} $0.fishes number of kinds of fish + * @param {Object} options + * @param {String} options.fishes number of kinds of fish */ function fishesAndFoxes({ fishes, foxes }) { return fishes + foxes; @@ -99,8 +100,9 @@ function foo(address) { * This tests our support for iterator rest inside an * iterator destructure (RestElement) * - * @param {any} $0.x head of iterator - * @param {any[]} ...$0.xs body of iterator + * @param {Array} input + * @param {any} input.0 head of iterator + * @param {...any} input.xs body of iterator * * @returns {any[]} rotated such that the last element was the first */ diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json index 01241aec6..129cc02b3 100644 --- a/test/fixture/params.output.json +++ b/test/fixture/params.output.json @@ -90,6 +90,11 @@ "errors": [], "examples": [], "params": [ + { + "title": "param", + "name": "a", + "lineNumber": 5 + }, { "title": "param", "name": "b", @@ -151,11 +156,6 @@ "name": "number" } }, - { - "title": "param", - "name": "a", - "lineNumber": 5 - }, { "title": "param", "name": "c", @@ -164,8 +164,10 @@ { "title": "param", "name": "$3", + "anonymous": true, "type": { - "type": "AllLiteral" + "type": "NameExpression", + "name": "Object" }, "properties": [ { @@ -264,13 +266,23 @@ "tags": [ { "title": "param", - "description": "number of kinds of fish", + "description": null, "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "Object" + }, + "name": "options" + }, + { + "title": "param", + "description": "number of kinds of fish", + "lineNumber": 3, "type": { "type": "NameExpression", "name": "String" }, - "name": "$0.fishes" + "name": "options.fishes" } ], "loc": { @@ -279,18 +291,18 @@ "column": 0 }, "end": { - "line": 12, + "line": 13, "column": 3 } }, "context": { "loc": { "start": { - "line": 13, + "line": 14, "column": 0 }, "end": { - "line": 15, + "line": 16, "column": 1 } } @@ -301,15 +313,17 @@ "params": [ { "title": "param", - "name": "$0", + "name": "options", + "lineNumber": 2, "type": { - "type": "AllLiteral" + "type": "NameExpression", + "name": "Object" }, "properties": [ { "title": "param", - "name": "$0.fishes", - "lineNumber": 2, + "name": "options.fishes", + "lineNumber": 3, "description": { "type": "root", "children": [ @@ -369,8 +383,8 @@ }, { "title": "param", - "name": "$0.foxes", - "lineNumber": 13 + "name": "options.foxes", + "lineNumber": 14 } ] } @@ -464,22 +478,22 @@ ], "loc": { "start": { - "line": 17, + "line": 18, "column": 0 }, "end": { - "line": 20, + "line": 21, "column": 3 } }, "context": { "loc": { "start": { - "line": 21, + "line": 22, "column": 0 }, "end": { - "line": 23, + "line": 24, "column": 1 } } @@ -497,9 +511,9 @@ "expression": { "type": "NameExpression", "name": "number" - }, - "default": "2" - } + } + }, + "default": "2" } ], "properties": [], @@ -580,22 +594,22 @@ "tags": [], "loc": { "start": { - "line": 25, + "line": 26, "column": 0 }, "end": { - "line": 27, + "line": 28, "column": 3 } }, "context": { "loc": { "start": { - "line": 28, + "line": 29, "column": 0 }, "end": { - "line": 34, + "line": 35, "column": 1 } } @@ -682,22 +696,22 @@ ], "loc": { "start": { - "line": 29, + "line": 30, "column": 2 }, "end": { - "line": 32, + "line": 33, "column": 5 } }, "context": { "loc": { "start": { - "line": 33, + "line": 34, "column": 2 }, "end": { - "line": 33, + "line": 34, "column": 14 } } @@ -865,22 +879,22 @@ "tags": [], "loc": { "start": { - "line": 36, + "line": 37, "column": 0 }, "end": { - "line": 38, + "line": 39, "column": 3 } }, "context": { "loc": { "start": { - "line": 39, + "line": 40, "column": 0 }, "end": { - "line": 46, + "line": 47, "column": 2 } } @@ -957,22 +971,22 @@ "tags": [], "loc": { "start": { - "line": 40, + "line": 41, "column": 2 }, "end": { - "line": 42, + "line": 43, "column": 5 } }, "context": { "loc": { "start": { - "line": 43, + "line": 44, "column": 2 }, "end": { - "line": 45, + "line": 46, "column": 3 } } @@ -984,7 +998,7 @@ { "title": "param", "name": "x", - "lineNumber": 43 + "lineNumber": 44 } ], "properties": [], @@ -1180,22 +1194,22 @@ ], "loc": { "start": { - "line": 48, + "line": 49, "column": 0 }, "end": { - "line": 59, + "line": 60, "column": 3 } }, "context": { "loc": { "start": { - "line": 60, + "line": 61, "column": 0 }, "end": { - "line": 60, + "line": 61, "column": 22 } } @@ -1658,22 +1672,22 @@ ], "loc": { "start": { - "line": 62, + "line": 63, "column": 0 }, "end": { - "line": 73, + "line": 74, "column": 3 } }, "context": { "loc": { "start": { - "line": 74, + "line": 75, "column": 0 }, "end": { - "line": 76, + "line": 77, "column": 1 } } @@ -2118,22 +2132,22 @@ ], "loc": { "start": { - "line": 78, + "line": 79, "column": 0 }, "end": { - "line": 85, + "line": 86, "column": 3 } }, "context": { "loc": { "start": { - "line": 86, + "line": 87, "column": 0 }, "end": { - "line": 86, + "line": 87, "column": 37 } } @@ -2203,9 +2217,9 @@ "expression": { "type": "NameExpression", "name": "number" - }, - "default": "123" - } + } + }, + "default": "123" } ], "properties": [], @@ -2358,22 +2372,22 @@ ], "loc": { "start": { - "line": 88, + "line": 89, "column": 0 }, "end": { - "line": 93, + "line": 94, "column": 3 } }, "context": { "loc": { "start": { - "line": 94, + "line": 95, "column": 0 }, "end": { - "line": 96, + "line": 97, "column": 1 } } @@ -2522,40 +2536,41 @@ "tags": [ { "title": "param", - "description": "head of iterator", + "description": null, "lineNumber": 4, "type": { "type": "NameExpression", - "name": "any" + "name": "Array" }, - "name": "$0.x" + "name": "input" }, { "title": "param", - "description": "...$0.xs body of iterator", + "description": "head of iterator", "lineNumber": 5, "type": { - "type": "TypeApplication", + "type": "NameExpression", + "name": "any" + }, + "name": "input.0" + }, + { + "title": "param", + "description": "body of iterator", + "lineNumber": 6, + "type": { + "type": "RestType", "expression": { "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "any" - } - ] + "name": "any" + } }, - "name": null, - "errors": [ - "Missing or invalid tag name" - ] + "name": "input.xs" }, { "title": "returns", "description": "rotated such that the last element was the first", - "lineNumber": 7, + "lineNumber": 8, "type": { "type": "TypeApplication", "expression": { @@ -2573,45 +2588,43 @@ ], "loc": { "start": { - "line": 98, + "line": 99, "column": 0 }, "end": { - "line": 106, + "line": 108, "column": 3 } }, "context": { "loc": { "start": { - "line": 107, + "line": 109, "column": 0 }, "end": { - "line": 109, + "line": 111, "column": 1 } } }, "augments": [], - "errors": [ - { - "message": "Missing or invalid tag name" - } - ], + "errors": [], "examples": [], "params": [ { "title": "param", - "name": "$0", + "name": "input", + "lineNumber": 4, "type": { - "type": "AllLiteral" + "type": "NameExpression", + "name": "Array" }, "properties": [ { "title": "param", - "name": "$0.x", - "lineNumber": 4, + "name": "input.0", + "lineNumber": 5, "description": { "type": "root", "children": [ @@ -2671,10 +2684,66 @@ }, { "title": "param", - "name": "$0.xs", - "lineNumber": 107, + "name": "input.xs", + "lineNumber": 6, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "body of iterator", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + } + } + }, "type": { - "type": "RestType" + "type": "RestType", + "expression": { + "type": "NameExpression", + "name": "any" + } } } ] diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md index c9df3621a..6413e14bf 100644 --- a/test/fixture/params.output.md +++ b/test/fixture/params.output.md @@ -21,10 +21,10 @@ This function returns the number one. **Parameters** -- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param - `a` +- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param - `c` -- `$3` **any** +- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - `$3.d` - `$3.e` - `$3.f` @@ -35,9 +35,9 @@ This method has partially inferred params **Parameters** -- `$0` **any** - - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - - `$0.foxes` +- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** + - `options.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish + - `options.foxes` ## withDefault @@ -45,7 +45,7 @@ This method has a type in the description and a default in the code **Parameters** -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?= 2** +- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** (optional, default `2`) ## Foo @@ -112,7 +112,7 @@ values specified in code. **Parameters** -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?= 123** an argument +- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** an argument (optional, default `123`) Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** some @@ -132,8 +132,8 @@ iterator destructure (RestElement) **Parameters** -- `$0` **any** - - `$0.x` **any** head of iterator - - `$0.xs` **...any** +- `input` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** + - `input.0` **any** head of iterator + - `input.xs` **...any** body of iterator Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<any>** rotated such that the last element was the first diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json index f8f56c216..69f263493 100644 --- a/test/fixture/params.output.md.json +++ b/test/fixture/params.output.md.json @@ -63,6 +63,28 @@ "ordered": false, "type": "list", "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "a" + }, + { + "type": "text", + "value": " " + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, { "type": "listItem", "children": [ @@ -136,28 +158,6 @@ } ] }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, { "type": "listItem", "children": [ @@ -198,8 +198,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "any" + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "children": [ + { + "type": "text", + "value": "Object" + } + ] } ] }, @@ -351,7 +358,7 @@ "children": [ { "type": "inlineCode", - "value": "$0" + "value": "options" }, { "type": "text", @@ -361,8 +368,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "any" + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "children": [ + { + "type": "text", + "value": "Object" + } + ] } ] }, @@ -384,7 +398,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.fishes" + "value": "options.fishes" }, { "type": "text", @@ -457,7 +471,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.foxes" + "value": "options.foxes" }, { "type": "text", @@ -566,16 +580,29 @@ { "type": "text", "value": "?" - }, - { - "type": "text", - "value": "= 2" } ] }, { "type": "text", "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "2" + }, + { + "type": "text", + "value": ")" + } + ] } ] } @@ -1954,10 +1981,6 @@ { "type": "text", "value": "?" - }, - { - "type": "text", - "value": "= 123" } ] }, @@ -1999,6 +2022,23 @@ }, "indent": [] } + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": " (optional, default " + }, + { + "type": "inlineCode", + "value": "123" + }, + { + "type": "text", + "value": ")" + } + ] } ] } @@ -2261,7 +2301,7 @@ "children": [ { "type": "inlineCode", - "value": "$0" + "value": "input" }, { "type": "text", @@ -2271,8 +2311,15 @@ "type": "strong", "children": [ { - "type": "text", - "value": "any" + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] } ] }, @@ -2294,7 +2341,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.x" + "value": "input.0" }, { "type": "text", @@ -2360,7 +2407,7 @@ "children": [ { "type": "inlineCode", - "value": "$0.xs" + "value": "input.xs" }, { "type": "text", @@ -2382,6 +2429,41 @@ { "type": "text", "value": " " + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "body of iterator", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 17, + "offset": 16 + }, + "indent": [] + } } ] } diff --git a/test/format_type.js b/test/format_type.js index 827a3dcca..667c7613d 100644 --- a/test/format_type.js +++ b/test/format_type.js @@ -4,7 +4,7 @@ var _formatType = require('../lib/output/util/format_type'), LinkerStack = require('../lib/output/util/linker_stack'), remark = require('remark'), - parse = require('doctrine').parse, + parse = require('doctrine-temporary-fork').parse, test = require('tap').test; function stringify(children) { diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js index 628f3b71a..8049ee6de 100644 --- a/test/lib/infer/params.js +++ b/test/lib/infer/params.js @@ -18,6 +18,101 @@ function evaluate(fn, file) { return inferParams(toComment(fn, file)); } +test('mergeTrees', function(t) { + t.deepEqual( + inferParams.mergeTrees( + [], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'string' + } + } + ] + ), + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'string' + } + } + ] + ); + + t.deepEqual( + inferParams.mergeTrees( + [ + { + title: 'param', + name: '$0', + anonymous: true, + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'object' + }, + properties: [ + { + title: 'param', + name: '$0.a', + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'string' + }, + properties: [] + } + ] + } + ], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'object' + } + } + ] + ), + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'object' + }, + properties: [ + { + title: 'param', + name: 'a.a', + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'string' + }, + properties: [] + } + ] + } + ] + ); + + t.end(); +}); + test('inferParams', function(t) { t.deepEqual( evaluate(function() { @@ -35,6 +130,119 @@ test('inferParams', function(t) { [{ lineNumber: 3, name: 'x', title: 'param' }] ); + t.deepEqual( + evaluate(`/** Test */function f({ x, ...xs }) {};`).params, + [ + { + title: 'param', + name: '$0', + anonymous: true, + type: { + type: 'NameExpression', + name: 'Object' + }, + properties: [ + { + title: 'param', + name: '$0.x', + lineNumber: 1 + }, + { + title: 'param', + name: '$0.xs', + lineNumber: 1, + type: { + type: 'RestType' + } + } + ] + } + ], + 'object spread property' + ); + + t.deepEqual( + evaluate( + ` + /** + * Test + * @param {Object} a renamed destructuring param + */ + var f = function({ x }) {}; + ` + ).params, + [ + { + description: { + children: [ + { + children: [ + { + position: { + end: { + column: 28, + line: 1, + offset: 27 + }, + indent: [], + start: { + column: 1, + line: 1, + offset: 0 + } + }, + type: 'text', + value: 'renamed destructuring param' + } + ], + position: { + end: { + column: 28, + line: 1, + offset: 27 + }, + indent: [], + start: { + column: 1, + line: 1, + offset: 0 + } + }, + type: 'paragraph' + } + ], + position: { + end: { + column: 28, + line: 1, + offset: 27 + }, + start: { + column: 1, + line: 1, + offset: 0 + } + }, + type: 'root' + }, + lineNumber: 2, + name: 'a', + properties: [ + { + lineNumber: 6, + name: 'a.x', + title: 'param' + } + ], + title: 'param', + type: { + name: 'Object', + type: 'NameExpression' + } + } + ] + ); + t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params, [ { lineNumber: 1, name: 'x', title: 'param' } ]); @@ -49,6 +257,111 @@ test('inferParams', function(t) { [{ lineNumber: 5, name: 'x', title: 'param' }] ); + t.deepEqual( + evaluate( + ` + /** Test */ + function f(x = 4) {} + ` + ).params, + [ + { + default: '4', + name: 'x', + title: 'param', + lineNumber: 3, + type: { + expression: null, + type: 'OptionalType' + } + } + ], + 'default params' + ); + + t.deepEqual( + evaluate( + ` + /** Test + * @param {number} x + */ + function f(x = 4) {} + ` + ).params, + [ + { + default: '4', + name: 'x', + title: 'param', + lineNumber: 1, + type: { + expression: { + type: 'NameExpression', + name: 'number' + }, + type: 'OptionalType' + } + } + ], + 'default params with type' + ); + + t.deepEqual( + evaluate( + ` + /** Test */ + function f({ x: y }) {} + ` + ).params, + [ + { + anonymous: true, + name: '$0', + properties: [ + { + lineNumber: 3, + name: '$0.x', + title: 'param' + } + ], + title: 'param', + type: { + name: 'Object', + type: 'NameExpression' + } + } + ], + 'renaming' + ); + + t.deepEqual( + evaluate( + ` + /** Test */ + function f({ x: { y: { z } } }) {} + ` + ).params, + [ + { + anonymous: true, + name: '$0', + properties: [ + { + lineNumber: 3, + name: '$0.x.y.z', + title: 'param' + } + ], + title: 'param', + type: { + name: 'Object', + type: 'NameExpression' + } + } + ], + 'renaming' + ); + t.deepEqual(evaluate('/** Test */ export function f(x) {}').params, [ { lineNumber: 1, name: 'x', title: 'param' } ]); diff --git a/test/lib/nest.js b/test/lib/nest.js index 8210ce45b..fb603cabd 100644 --- a/test/lib/nest.js +++ b/test/lib/nest.js @@ -1,101 +1,117 @@ 'use strict'; -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - nest = require('../../lib/nest'); +var test = require('tap').test; +var nestTag = require('../../lib/nest').nestTag; -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - ).map(nest); -} +// Print a tree of tags in a way that's easy to test. +var printTree = indent => + node => + `${new Array(indent + 1).join(' ')}- ${node.name}${node.properties ? '\n' : ''}${(node.properties || [ + ]) + .map(printTree(indent + 1)) + .join('\n')}`; -test('nest params - no params', function(t) { - t.deepEqual( - toComment(function() { - /** @name foo */ - })[0].params, - [], - 'no params' - ); - t.end(); -}); +var printNesting = params => + printTree(0)({ properties: nestTag(params), name: 'root' }); -test('nest params - no nesting', function(t) { - var result = toComment(function() { - /** @param {Object} foo */ - }); - t.equal(result[0].params.length, 1); - t.equal(result[0].params[0].name, 'foo'); - t.equal(result[0].params[0].properties, undefined); +test('nest params - basic', function(t) { + var params = [ + 'foo', + 'foo.bar', + 'foo.bar.third', + 'foo.third', + 'foo.third[].baz' + ].map(name => ({ name })); + t.equal( + printNesting(params), + `- root + - foo + - foo.bar + - foo.bar.third + - foo.third + - foo.third[].baz` + ); t.end(); }); -test('nest params - basic', function(t) { - var result = toComment(function() { - /** - * @param {Object} foo - * @param {string} foo.bar - * @param {string} foo.baz - */ - }); - t.equal(result[0].params.length, 1); - t.equal(result[0].params[0].name, 'foo'); - t.equal(result[0].params[0].properties.length, 2); - t.equal(result[0].params[0].properties[0].name, 'foo.bar'); - t.equal(result[0].params[0].properties[1].name, 'foo.baz'); +test('nest params - multiple roots', function(t) { + var params = ['a', 'b', 'c'].map(name => ({ name })); + t.equal( + printNesting(params), + `- root + - a + - b + - c` + ); t.end(); }); -test('nest properties - basic', function(t) { - var result = toComment(function() { - /** - * @property {Object} foo - * @property {string} foo.bar - * @property {string} foo.baz - */ +test('nest params - missing parent', function(t) { + var params = ['foo', 'foo.bar.third'].map(name => ({ name })); + t.throws(() => { + nestTag(params); }); - t.equal(result[0].properties.length, 1); - t.equal(result[0].properties[0].name, 'foo'); - t.equal(result[0].properties[0].properties.length, 2); - t.equal(result[0].properties[0].properties[0].name, 'foo.bar'); - t.equal(result[0].properties[0].properties[1].name, 'foo.baz'); t.end(); }); -test('nest params - array', function(t) { - var result = toComment(function() { - /** - * @param {Object[]} employees - The employees who are responsible for the project. - * @param {string} employees[].name - The name of an employee. - * @param {string} employees[].department - The employee's department. - */ - }); - t.equal(result[0].params.length, 1); - t.equal(result[0].params[0].name, 'employees'); - t.equal(result[0].params[0].properties.length, 2); - t.equal(result[0].params[0].properties[0].name, 'employees[].name'); - t.equal(result[0].params[0].properties[1].name, 'employees[].department'); +test('nest params - #658', function(t) { + var params = [ + 'state', + 'payload', + 'payload.input_meter_levels', + 'payload.input_meter_levels[].peak', + 'payload.input_meter_levels[].rms', + 'payload.output_meter_levels', + 'payload.output_meter_levels[].peak', + 'payload.output_meter_levels[].rms' + ].map(name => ({ name })); + t.equal( + printNesting(params), + `- root + - state + - payload + - payload.input_meter_levels + - payload.input_meter_levels[].peak + - payload.input_meter_levels[].rms + - payload.output_meter_levels + - payload.output_meter_levels[].peak + - payload.output_meter_levels[].rms` + ); t.end(); }); -test('nest params - missing parent', function(t) { - var result = toComment(function() { - /** @param {string} foo.bar */ - }); - t.equal(result[0].params.length, 1); - t.deepEqual( - result[0].errors[0], - { - message: "@param foo.bar's parent foo not found", - commentLineNumber: 0 - }, - 'correct error message' +test('nest params - #554', function(t) { + var params = [ + 'x', + 'yIn', + 'options', + 'options.sgOption', + 'options.minMaxRatio', + 'options.broadRatio', + 'options.noiseLevel', + 'options.maxCriteria', + 'options.smoothY', + 'options.realTopDetection', + 'options.heightFactor', + 'options.boundaries', + 'options.derivativeThreshold' + ].map(name => ({ name })); + t.equal( + printNesting(params), + `- root + - x + - yIn + - options + - options.sgOption + - options.minMaxRatio + - options.broadRatio + - options.noiseLevel + - options.maxCriteria + - options.smoothY + - options.realTopDetection + - options.heightFactor + - options.boundaries + - options.derivativeThreshold` ); - t.equal(result[0].params[0].name, 'foo.bar'); t.end(); }); diff --git a/test/lib/parse.js b/test/lib/parse.js index 558979c2a..ebc18d566 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -115,7 +115,9 @@ test('parse - @description', function(t) { * @description This tagged description wins, and [is markdown](http://markdown.com). */ })[0].description, - remark().parse('This tagged description wins, and [is markdown](http://markdown.com).'), + remark().parse( + 'This tagged description wins, and [is markdown](http://markdown.com).' + ), 'description' ); From a15b0716fe776e04ec6944a0c96bf8ef96816df6 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 21 Apr 2017 17:50:09 -0400 Subject: [PATCH 033/555] refactor: Move index.js to lib (#744) Fixes https://github.com/documentationjs/documentation/issues/736 --- declarations/comment.js | 3 +- index.js => lib/index.js | 67 +++++++++++++++++++++------------------- package.json | 4 +-- 3 files changed, 40 insertions(+), 34 deletions(-) rename index.js => lib/index.js (82%) diff --git a/declarations/comment.js b/declarations/comment.js index ecfefe5ce..c6747408e 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -1,9 +1,10 @@ type DocumentationConfig = { polyglot?: boolean, - inferPrivate?: boolean, + inferPrivate?: string, noPackage?: boolean, toc?: Array, paths?: { [key: string]: number }, + access?: Array, defaultGlobals?: boolean, defaultGlobalsEnvs?: Array, external?: Array, diff --git a/index.js b/lib/index.js similarity index 82% rename from index.js rename to lib/index.js index 0c91f4c86..db6c9b103 100644 --- a/index.js +++ b/lib/index.js @@ -2,29 +2,29 @@ var fs = require('fs'), _ = require('lodash'), - sort = require('./lib/sort'), - nest = require('./lib/nest'), - filterAccess = require('./lib/filter_access'), - dependency = require('./lib/input/dependency'), - shallow = require('./lib/input/shallow'), - parseJavaScript = require('./lib/parsers/javascript'), - polyglot = require('./lib/parsers/polyglot'), - github = require('./lib/github'), - hierarchy = require('./lib/hierarchy'), - inferName = require('./lib/infer/name'), - inferKind = require('./lib/infer/kind'), - inferAugments = require('./lib/infer/augments'), - inferParams = require('./lib/infer/params'), - inferProperties = require('./lib/infer/properties'), - inferMembership = require('./lib/infer/membership'), - inferReturn = require('./lib/infer/return'), - inferAccess = require('./lib/infer/access'), - inferType = require('./lib/infer/type'), - formatLint = require('./lib/lint').formatLint, - garbageCollect = require('./lib/garbage_collect'), - lintComments = require('./lib/lint').lintComments, - markdownAST = require('./lib/output/markdown_ast'), - mergeConfig = require('./lib/merge_config'); + sort = require('./sort'), + nest = require('./nest'), + filterAccess = require('./filter_access'), + dependency = require('./input/dependency'), + shallow = require('./input/shallow'), + parseJavaScript = require('./parsers/javascript'), + polyglot = require('./parsers/polyglot'), + github = require('./github'), + hierarchy = require('./hierarchy'), + inferName = require('./infer/name'), + inferKind = require('./infer/kind'), + inferAugments = require('./infer/augments'), + inferParams = require('./infer/params'), + inferProperties = require('./infer/properties'), + inferMembership = require('./infer/membership'), + inferReturn = require('./infer/return'), + inferAccess = require('./infer/access'), + inferType = require('./infer/type'), + formatLint = require('./lint').formatLint, + garbageCollect = require('./garbage_collect'), + lintComments = require('./lint').lintComments, + markdownAST = require('./output/markdown_ast'), + mergeConfig = require('./merge_config'); /** * Build a pipeline of comment handlers. @@ -45,7 +45,10 @@ function pipeline() { }; } -function configure(indexes, args) /*: Promise */ { +function configure( + indexes /*: Array */, + args /*: Object */ +) /*: Promise */ { let mergedConfig = mergeConfig(args); return mergedConfig.then(config => { @@ -185,7 +188,8 @@ function lintInternal(inputsAndConfig) { * } * }); */ -let lint = (indexes, args) => configure(indexes, args).then(lintInternal); +let lint = (indexes /*: Array */, args) => + configure(indexes, args).then(lintInternal); /** * Generate JavaScript documentation as a list of parsed JSDoc @@ -228,7 +232,8 @@ let lint = (indexes, args) => configure(indexes, args).then(lintInternal); * // any other kind of code data. * }); */ -let build = (indexes, args) => configure(indexes, args).then(buildInternal); +let build = (indexes /*: Array */, args /*: Object */) => + configure(indexes, args).then(buildInternal); /** * Documentation's formats are modular methods that take comments @@ -238,11 +243,11 @@ let build = (indexes, args) => configure(indexes, args).then(buildInternal); * @public */ var formats = { - html: require('./lib/output/html'), - md: require('./lib/output/markdown'), + html: require('./output/html'), + md: require('./output/markdown'), remark: (comments /*: Array */, config /*: DocumentationConfig */) => markdownAST(comments, config).then(res => JSON.stringify(res, null, 2)), - json: require('./lib/output/json') + json: require('./output/json') }; module.exports.lint = lint; @@ -251,6 +256,6 @@ module.exports.build = build; module.exports.formats = formats; module.exports.util = { - createFormatters: require('./lib/output/util/formatters'), - LinkerStack: require('./lib/output/util/linker_stack') + createFormatters: require('./output/util/formatters'), + LinkerStack: require('./output/util/linker_stack') }; diff --git a/package.json b/package.json index 1b5c8ebfa..043ed9112 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "website" ], "license": "ISC", - "main": "index.js", + "main": "lib/index.js", "repository": { "type": "git", "url": "git@github.com:documentationjs/documentation.git" @@ -90,7 +90,7 @@ "release": "standard-version", "precommit": "lint-staged --verbose", "format": "prettier --write '{lib,test}/**/*.js' --single-quote", - "doc": "./bin/documentation.js build index.js -f md --access=public > docs/NODE_API.md", + "doc": "./bin/documentation.js build lib/index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint", "test": "are-we-flow-yet lib && flow check && npm run self-lint && npm run test-tap", From 9554b2f117814dffc8c1f5194d27a4e8e7b35fa9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 21 Apr 2017 18:16:02 -0400 Subject: [PATCH 034/555] fix(html output): Fix github links in HTML output (#745) Fixes #738 --- default_theme/section._ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default_theme/section._ b/default_theme/section._ index a7158640f..8228331c7 100644 --- a/default_theme/section._ +++ b/default_theme/section._ @@ -8,8 +8,8 @@ <% } %> <% if (section.context && section.context.github) { %> - - <%= section.context.path %> + + <%= section.context.github.path %> <% } %> From e5ea56d2d3bcde118b6e04d64c5e983ee4bbc365 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 21 Apr 2017 18:53:48 -0400 Subject: [PATCH 035/555] build(yarn): Include yarn.lock (#746) https://yarnpkg.com/blog/2016/11/24/lockfiles-for-all/ --- yarn.lock | 4553 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4553 insertions(+) create mode 100644 yarn.lock diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..6b3836554 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,4553 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +JSONStream@^1.0.3, JSONStream@^1.0.4: + version "1.3.1" + resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a" + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + +abbrev@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + +acorn@^4.0.3: + version "4.0.11" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + +ajv@^4.9.1: + version "4.11.7" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +ansi-escapes@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-html@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.0.1, ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" + dependencies: + color-convert "^1.0.0" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + +app-root-path@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" + +append-transform@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" + dependencies: + default-require-extensions "^1.0.0" + +aproba@^1.0.3: + version "1.1.1" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + +are-we-flow-yet@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/are-we-flow-yet/-/are-we-flow-yet-1.0.0.tgz#951dd9ea78cc9e4f00b47b4cd1d53d7ddf220908" + dependencies: + glob "^6.0.1" + +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-ify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + +array-iterate@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.0.tgz#4f13148ffffa5f2756b50460e5eac8eed31a14e6" + dependencies: + has "^1.0.1" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0, arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +ast-types@0.8.18: + version "0.8.18" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af" + +ast-types@0.9.4: + version "0.9.4" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.4.tgz#410d1f81890aeb8e0a38621558ba5869ae53c91b" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@^1.4.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" + +babel-code-frame@6.22.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" + dependencies: + babel-code-frame "^6.22.0" + babel-generator "^6.24.1" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + convert-source-map "^1.1.0" + debug "^2.1.1" + json5 "^0.5.0" + lodash "^4.2.0" + minimatch "^3.0.2" + path-is-absolute "^1.0.0" + private "^0.1.6" + slash "^1.0.0" + source-map "^0.5.0" + +babel-generator@6.24.1, babel-generator@^6.18.0, babel-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-helper-bindify-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-builder-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.24.1.tgz#0ad7917e33c8d751e646daca4e77cc19377d2cbc" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + esutils "^2.0.0" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz#7a9747f258d8947d32d515f6aa1c7bd02204a080" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-explode-class@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz#7dc2a3910dee007056e1e31d640ced3d54eaa9eb" + dependencies: + babel-helper-bindify-decorators "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz#d36e22fab1008d79d88648e32116868128456ce8" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-async-generators@^6.5.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz#6bc963ebb16eccbae6b92b596eb7f35c342a8b9a" + +babel-plugin-syntax-class-constructor-call@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz#9cb9d39fe43c8600bec8146456ddcbd4e1a76416" + +babel-plugin-syntax-class-properties@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de" + +babel-plugin-syntax-decorators@^6.1.18, babel-plugin-syntax-decorators@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz#312563b4dbde3cc806cee3e416cceeaddd11ac0b" + +babel-plugin-syntax-do-expressions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz#5747756139aa26d390d09410b03744ba07e4796d" + +babel-plugin-syntax-dynamic-import@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-export-extensions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz#70a1484f0f9089a4e84ad44bac353c95b9b12721" + +babel-plugin-syntax-flow@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz#4c3ab20a2af26aa20cd25995c398c4eb70310c8d" + +babel-plugin-syntax-function-bind@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz#48c495f177bdf31a981e732f55adc0bdd2601f46" + +babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" + +babel-plugin-syntax-object-rest-spread@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-system-import-transformer@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-system-import-transformer/-/babel-plugin-system-import-transformer-3.1.0.tgz#d37f0cae8e61ef39060208331d931b5e630d7c5f" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + +babel-plugin-transform-async-generator-functions@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz#f058900145fd3e9907a6ddf28da59f215258a5db" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-generators "^6.5.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-class-constructor-call@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz#80dc285505ac067dcb8d6c65e2f6f11ab7765ef9" + dependencies: + babel-plugin-syntax-class-constructor-call "^6.18.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-class-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz#6a79763ea61d33d36f37b611aa9def81a81b46ac" + dependencies: + babel-helper-function-name "^6.24.1" + babel-plugin-syntax-class-properties "^6.8.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-decorators-legacy@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators-legacy/-/babel-plugin-transform-decorators-legacy-1.3.4.tgz#741b58f6c5bce9e6027e0882d9c994f04f366925" + dependencies: + babel-plugin-syntax-decorators "^6.1.18" + babel-runtime "^6.2.0" + babel-template "^6.3.0" + +babel-plugin-transform-decorators@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz#788013d8f8c6b5222bdf7b344390dfd77569e24d" + dependencies: + babel-helper-explode-class "^6.24.1" + babel-plugin-syntax-decorators "^6.13.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-do-expressions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz#28ccaf92812d949c2cd1281f690c8fdc468ae9bb" + dependencies: + babel-plugin-syntax-do-expressions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + lodash "^4.2.0" + +babel-plugin-transform-es2015-classes@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-export-extensions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz#53738b47e75e8218589eea946cbbd39109bbe653" + dependencies: + babel-plugin-syntax-export-extensions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-flow-strip-types@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz#84cb672935d43714fdc32bce84568d87441cf7cf" + dependencies: + babel-plugin-syntax-flow "^6.18.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-function-bind@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz#c6fb8e96ac296a310b8cf8ea401462407ddf6a97" + dependencies: + babel-plugin-syntax-function-bind "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-object-rest-spread@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" + dependencies: + babel-plugin-syntax-object-rest-spread "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-display-name@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.23.0.tgz#4398910c358441dc4cef18787264d0412ed36b37" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-self@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz#df6d80a9da2612a121e6ddd7558bcbecf06e636e" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx-source@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz#66ac12153f5cd2d17b3c19268f4bf0197f44ecd6" + dependencies: + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-react-jsx@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz#840a028e7df460dfc3a2d29f0c0d91f6376e66a3" + dependencies: + babel-helper-builder-react-jsx "^6.24.1" + babel-plugin-syntax-jsx "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418" + dependencies: + regenerator-transform "0.9.11" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-preset-es2015@^6.16.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-flow@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz#e71218887085ae9a24b5be4169affb599816c49d" + dependencies: + babel-plugin-transform-flow-strip-types "^6.22.0" + +babel-preset-react@^6.16.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" + dependencies: + babel-plugin-syntax-jsx "^6.3.13" + babel-plugin-transform-react-display-name "^6.23.0" + babel-plugin-transform-react-jsx "^6.24.1" + babel-plugin-transform-react-jsx-self "^6.22.0" + babel-plugin-transform-react-jsx-source "^6.22.0" + babel-preset-flow "^6.23.0" + +babel-preset-stage-0@^6.16.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz#5642d15042f91384d7e5af8bc88b1db95b039e6a" + dependencies: + babel-plugin-transform-do-expressions "^6.22.0" + babel-plugin-transform-function-bind "^6.22.0" + babel-preset-stage-1 "^6.24.1" + +babel-preset-stage-1@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz#7692cd7dcd6849907e6ae4a0a85589cfb9e2bfb0" + dependencies: + babel-plugin-transform-class-constructor-call "^6.24.1" + babel-plugin-transform-export-extensions "^6.22.0" + babel-preset-stage-2 "^6.24.1" + +babel-preset-stage-2@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz#d9e2960fb3d71187f0e64eec62bc07767219bdc1" + dependencies: + babel-plugin-syntax-dynamic-import "^6.18.0" + babel-plugin-transform-class-properties "^6.24.1" + babel-plugin-transform-decorators "^6.24.1" + babel-preset-stage-3 "^6.24.1" + +babel-preset-stage-3@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz#836ada0a9e7a7fa37cb138fb9326f87934a48395" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-generator-functions "^6.24.1" + babel-plugin-transform-async-to-generator "^6.24.1" + babel-plugin-transform-exponentiation-operator "^6.24.1" + babel-plugin-transform-object-rest-spread "^6.22.0" + +babel-register@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" + dependencies: + babel-core "^6.24.1" + babel-runtime "^6.22.0" + core-js "^2.4.0" + home-or-tmp "^2.0.0" + lodash "^4.2.0" + mkdirp "^0.5.1" + source-map-support "^0.4.2" + +babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.3.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + babylon "^6.11.0" + lodash "^4.2.0" + +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + babylon "^6.15.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babelify@^7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" + dependencies: + babel-core "^6.0.14" + object-assign "^4.0.0" + +babylon@6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" + +babylon@^6.11.0, babylon@^6.11.4, babylon@^6.13.0, babylon@^6.15.0: + version "6.17.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + +bail@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.1.tgz#912579de8b391aadf3c5fdf4cd2a0fc225df3bc2" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +bcrypt-pbkdf@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" + +bind-obj-methods@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-1.0.0.tgz#4f5979cac15793adf70e488161e463e209ca509c" + +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +bluebird@^3.3.1: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" + +body@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" + dependencies: + continuable-cache "^0.3.1" + error "^7.0.0" + raw-body "~1.1.0" + safe-json-parse "~1.0.1" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.0.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +browser-resolve@^1.7.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +buffer-shims@^1.0.0, buffer-shims@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +bytes@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" + +caching-transform@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" + dependencies: + md5-hex "^1.2.0" + mkdirp "^0.5.1" + write-file-atomic "^1.1.4" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + +caseless@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +ccount@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.1.tgz#665687945168c218ec77ff61a4155ae00227a96c" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +character-entities-html4@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.0.tgz#1ab08551d3ce1fa1df08d00fb9ca1defb147a06c" + +character-entities-legacy@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz#b18aad98f6b7bcc646c1e4c81f9f1956376a561a" + +character-entities@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.0.tgz#a683e2cf75dbe8b171963531364e58e18a1b155f" + +character-reference-invalid@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.0.tgz#dec9ad1dfb9f8d06b4fcdaa2adc3c4fd97af1e68" + +chdir@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/chdir/-/chdir-0.0.0.tgz#c29bdb85f391834c83ddbf090f18a11b0ed96bee" + +chokidar@^1.2.0: + version "1.6.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +ci-info@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + +clean-yaml-object@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz#63fb110dc2ce1a84dc21f6d9334876d010ae8b68" + +cli-cursor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone-buffer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + +clone-stats@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + +clone-stats@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + +clone@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +cloneable-readable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117" + dependencies: + inherits "^2.0.1" + process-nextick-args "^1.0.6" + through2 "^2.0.1" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.2.tgz#9c463fb9c6d190d2dcae21a356a01bcae9eeef6d" + +color-convert@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + +color-support@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.2.tgz#49cc99b89d1bdef1292e9d9323c66971a33eb89d" + +colors@>=0.6.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +comma-separated-tokens@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.3.tgz#6eb01f4730bde7a7fce5d5e2d943bdd637272801" + dependencies: + trim "0.0.1" + +commander@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + +compare-func@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + dependencies: + array-ify "^1.0.0" + dot-prop "^3.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.4.10, concat-stream@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +concat-stream@~1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" + dependencies: + inherits "~2.0.1" + readable-stream "~2.0.0" + typedarray "~0.0.5" + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + +continuable-cache@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" + +conventional-changelog-angular@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.3.4.tgz#7d7cdfbd358948312904d02229a61fd6075cf455" + dependencies: + compare-func "^1.3.1" + github-url-from-git "^1.4.0" + q "^1.4.1" + +conventional-changelog-atom@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.1.0.tgz#67a47c66a42b2f8909ef1587c9989ae1de730b92" + dependencies: + q "^1.4.1" + +conventional-changelog-codemirror@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.1.0.tgz#7577a591dbf9b538e7a150a7ee62f65a2872b334" + dependencies: + q "^1.4.1" + +conventional-changelog-core@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.0.tgz#de5dfbc091847656508d4a389e35c9a1bc49e7f4" + dependencies: + conventional-changelog-writer "^1.1.0" + conventional-commits-parser "^1.0.0" + dateformat "^1.0.12" + get-pkg-repo "^1.0.0" + git-raw-commits "^1.2.0" + git-remote-origin-url "^2.0.0" + git-semver-tags "^1.2.0" + lodash "^4.0.0" + normalize-package-data "^2.3.5" + q "^1.4.1" + read-pkg "^1.1.0" + read-pkg-up "^1.0.1" + through2 "^2.0.0" + +conventional-changelog-ember@^0.2.6: + version "0.2.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.2.6.tgz#8b7355419f5127493c4c562473ab2fc792f1c2b6" + dependencies: + q "^1.4.1" + +conventional-changelog-eslint@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-0.1.0.tgz#a52411e999e0501ce500b856b0a643d0330907e2" + dependencies: + q "^1.4.1" + +conventional-changelog-express@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.1.0.tgz#55c6c841c811962036c037bdbd964a54ae310fce" + dependencies: + q "^1.4.1" + +conventional-changelog-jquery@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz#0208397162e3846986e71273b6c79c5b5f80f510" + dependencies: + q "^1.4.1" + +conventional-changelog-jscs@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz#0479eb443cc7d72c58bf0bcf0ef1d444a92f0e5c" + dependencies: + q "^1.4.1" + +conventional-changelog-jshint@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.1.0.tgz#00cab8e9a3317487abd94c4d84671342918d2a07" + dependencies: + compare-func "^1.3.1" + q "^1.4.1" + +conventional-changelog-writer@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-1.4.1.tgz#3f4cb4d003ebb56989d30d345893b52a43639c8e" + dependencies: + compare-func "^1.3.1" + conventional-commits-filter "^1.0.0" + dateformat "^1.0.11" + handlebars "^4.0.2" + json-stringify-safe "^5.0.1" + lodash "^4.0.0" + meow "^3.3.0" + semver "^5.0.1" + split "^1.0.0" + through2 "^2.0.0" + +conventional-changelog@^1.1.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.4.tgz#108bc750c2a317e200e2f9b413caaa1f8c7efa3b" + dependencies: + conventional-changelog-angular "^1.3.4" + conventional-changelog-atom "^0.1.0" + conventional-changelog-codemirror "^0.1.0" + conventional-changelog-core "^1.9.0" + conventional-changelog-ember "^0.2.6" + conventional-changelog-eslint "^0.1.0" + conventional-changelog-express "^0.1.0" + conventional-changelog-jquery "^0.1.0" + conventional-changelog-jscs "^0.1.0" + conventional-changelog-jshint "^0.1.0" + +conventional-commit-types@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.1.0.tgz#45d860386c9a2e6537ee91d8a1b61bd0411b3d04" + +conventional-commits-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.0.0.tgz#6fc2a659372bc3f2339cf9ffff7e1b0344b93039" + dependencies: + is-subset "^0.1.1" + modify-values "^1.0.0" + +conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-1.3.0.tgz#e327b53194e1a7ad5dc63479ee9099a52b024865" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + +conventional-recommended-bump@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-0.3.0.tgz#e839de8f57cbb43445c8b4967401de0644c425d8" + dependencies: + concat-stream "^1.4.10" + conventional-commits-filter "^1.0.0" + conventional-commits-parser "^1.0.1" + git-latest-semver-tag "^1.0.0" + git-raw-commits "^1.0.0" + meow "^3.3.0" + object-assign "^4.0.1" + +convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.3.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cosmiconfig@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-1.1.0.tgz#0dea0f9804efdfb929fbb1b188e25553ea053d37" + dependencies: + graceful-fs "^4.1.2" + js-yaml "^3.4.3" + minimist "^1.2.0" + object-assign "^4.0.1" + os-homedir "^1.0.1" + parse-json "^2.2.0" + pinkie-promise "^2.0.0" + require-from-string "^1.1.0" + +coveralls@^2.11.2: + version "2.13.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.0.tgz#df933876e8c6f478efb04f4d3ab70dc96b7e5a8e" + dependencies: + js-yaml "3.6.1" + lcov-parse "0.0.10" + log-driver "1.2.5" + minimist "1.2.0" + request "2.79.0" + +cross-spawn@^4: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +cz-conventional-changelog@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.0.0.tgz#55a979afdfe95e7024879d2a0f5924630170b533" + dependencies: + conventional-commit-types "^2.0.0" + lodash.map "^4.5.1" + longest "^1.0.1" + pad-right "^0.2.2" + right-pad "^1.0.1" + word-wrap "^1.0.3" + +dargs@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + dependencies: + number-is-nan "^1.0.0" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + +date-fns@^1.27.2: + version "1.28.3" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.3.tgz#145d87adc3f5a82c6bda668de97eee1132c97ea1" + +dateformat@^1.0.11, dateformat@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" + dependencies: + get-stdin "^4.0.1" + meow "^3.3.0" + +debug-log@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" + +debug@^2.1.1, debug@^2.1.3, debug@^2.2.0: + version "2.6.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" + dependencies: + ms "0.7.3" + +debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +deep-extend@~0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + +deeper@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/deeper/-/deeper-2.1.0.tgz#bc564e5f73174fdf201e08b00030e8a14da74368" + +default-require-extensions@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" + dependencies: + strip-bom "^2.0.0" + +defined@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + +detab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.0.tgz#485bd7954d2348092e998f7ff1a79fd9869d9b50" + dependencies: + repeat-string "^1.5.4" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + dependencies: + repeating "^2.0.0" + +detective@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" + dependencies: + acorn "^4.0.3" + defined "^1.0.0" + +diff@^1.3.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" + +disparity@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/disparity/-/disparity-2.0.0.tgz#57ddacb47324ae5f58d2cc0da886db4ce9eeb718" + dependencies: + ansi-styles "^2.0.1" + diff "^1.3.2" + +doctrine-temporary-fork@2.0.0-alpha-allowarrayindex: + version "2.0.0-alpha-allowarrayindex" + resolved "https://registry.yarnpkg.com/doctrine-temporary-fork/-/doctrine-temporary-fork-2.0.0-alpha-allowarrayindex.tgz#40015a867eb27e75b26c828b71524f137f89f9f0" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +documentation-schema@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/documentation-schema/-/documentation-schema-0.0.1.tgz#6ee05b47b08a04d024132d75893d378a36572209" + +dot-prop@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + dependencies: + is-obj "^1.0.0" + +duplexer2@^0.1.2, duplexer2@~0.1.0: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + dependencies: + readable-stream "^2.0.2" + +duplexify@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" + dependencies: + end-of-stream "1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + +emoji-regex@^6.0.0: + version "6.4.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.4.2.tgz#a30b6fee353d406d96cfb9fa765bdc82897eff6e" + +end-of-stream@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" + dependencies: + once "~1.3.0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +error@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/error/-/error-7.0.2.tgz#a5f75fff4d9926126ddac0ea5dc38e689153cb02" + dependencies: + string-template "~0.2.1" + xtend "~4.0.0" + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esutils@2.0.2, esutils@^2.0.0, esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +events-to-array@^1.0.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.1.2.tgz#2d41f563e1fe400ed4962fe1a4d5c6a7539df7f6" + +execa@^0.6.0: + version "0.6.3" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend@^3.0.0, extend@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + +faye-websocket@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + dependencies: + websocket-driver ">=0.5.1" + +figures@^1.5.0, figures@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +filename-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +find-cache-dir@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" + dependencies: + commondir "^1.0.1" + mkdirp "^0.5.1" + pkg-dir "^1.0.0" + +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + +find-up@^1.0.0, find-up@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + +first-chunk-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" + +flow-bin@^0.44.0: + version "0.44.2" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.44.2.tgz#3893c7db5de043ed82674f327a04b1309db208b5" + +flow-parser@0.40.0: + version "0.40.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc" + dependencies: + ast-types "0.8.18" + colors ">=0.6.2" + minimist ">=0.2.0" + +for-in@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + dependencies: + for-in "^1.0.1" + +foreground-child@^1.3.3, foreground-child@^1.5.3: + version "1.5.6" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" + dependencies: + cross-spawn "^4" + signal-exit "^3.0.0" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + +fs-access@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" + dependencies: + null-check "^1.0.0" + +fs-exists-cached@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz#cf25554ca050dc49ae6656b41de42258989dcbce" + +fs-extra@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.1.2.tgz#046c70163cef9aad46b0e4a7fa467fb22d71de35" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.29" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +function-loop@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/function-loop/-/function-loop-1.0.1.tgz#8076bb305e8e6a3cceee2920765f330d190f340c" + +gauge@~2.7.1: + version "2.7.3" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + +get-comments@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-comments/-/get-comments-1.0.1.tgz#196759101bbbc4facf13060caaedd4870dee55be" + +get-pkg-repo@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.3.0.tgz#43c6b4c048b75dd604fc5388edecde557f6335df" + dependencies: + hosted-git-info "^2.1.4" + meow "^3.3.0" + normalize-package-data "^2.3.0" + parse-github-repo-url "^1.3.0" + through2 "^2.0.0" + +get-stdin@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + +getpass@^0.1.1: + version "0.1.6" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + dependencies: + assert-plus "^1.0.0" + +git-latest-semver-tag@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/git-latest-semver-tag/-/git-latest-semver-tag-1.0.2.tgz#061130cbf4274111cc6be4612b3ff3a6d93e2660" + dependencies: + git-semver-tags "^1.1.2" + meow "^3.3.0" + +git-raw-commits@^1.0.0, git-raw-commits@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.2.0.tgz#0f3a8bfd99ae0f2d8b9224d58892975e9a52d03c" + dependencies: + dargs "^4.0.1" + lodash.template "^4.0.2" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + +git-remote-origin-url@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" + dependencies: + gitconfiglocal "^1.0.0" + pify "^2.3.0" + +git-semver-tags@^1.1.2, git-semver-tags@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.0.tgz#b31fd02c8ab578bd6c9b5cacca5e1c64c1177ac1" + dependencies: + meow "^3.3.0" + semver "^5.0.1" + +git-up@^2.0.0: + version "2.0.8" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-2.0.8.tgz#24be049c9f0b193481d2df4e016a16530a5f4ef4" + dependencies: + is-ssh "^1.3.0" + parse-url "^1.3.0" + +git-url-parse@^6.0.1: + version "6.2.2" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-6.2.2.tgz#be49024e14b8487553436b4572b8b439532fa871" + dependencies: + git-up "^2.0.0" + +gitconfiglocal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" + dependencies: + ini "^1.3.2" + +github-slugger@1.1.1, github-slugger@^1.0.0, github-slugger@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.1.1.tgz#5444671f65e5a5a424cfa8ba3255cc1f7baf07ea" + dependencies: + emoji-regex "^6.0.0" + +github-url-from-git@^1.4.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/github-url-from-git/-/github-url-from-git-1.5.0.tgz#f985fedcc0a9aa579dc88d7aff068d55cc6251a0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob-parent@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob-stream@^5.3.2: + version "5.3.5" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22" + dependencies: + extend "^3.0.0" + glob "^5.0.3" + glob-parent "^3.0.0" + micromatch "^2.3.7" + ordered-read-streams "^0.3.0" + through2 "^0.6.0" + to-absolute-glob "^0.1.1" + unique-stream "^2.0.2" + +glob@7.1.1, glob@^7.0.0, glob@^7.0.5, glob@^7.0.6: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^5.0.3: + version "5.0.15" + resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^6.0.1: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals-docs@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.3.0.tgz#dca4088af196f7800f4eba783eaeff335cb6759c" + +globals@^9.0.0: + version "9.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +gulp-sourcemaps@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" + dependencies: + convert-source-map "^1.1.1" + graceful-fs "^4.1.2" + strip-bom "^2.0.0" + through2 "^2.0.0" + vinyl "^1.0.0" + +handlebars@^4.0.2, handlebars@^4.0.3: + version "4.0.6" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" + dependencies: + async "^1.4.0" + optimist "^0.6.1" + source-map "^0.4.4" + optionalDependencies: + uglify-js "^2.6" + +har-schema@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" + +har-validator@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" + dependencies: + chalk "^1.1.1" + commander "^2.9.0" + is-my-json-valid "^2.12.4" + pinkie-promise "^2.0.0" + +har-validator@~4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" + dependencies: + ajv "^4.9.1" + har-schema "^1.0.5" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +hast-util-is-element@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.0.tgz#3f7216978b2ae14d98749878782675f33be3ce00" + +hast-util-sanitize@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.1.0.tgz#9b4bc3731043fe92e1253a9a4ca7bcc4148d06f2" + dependencies: + has "^1.0.1" + xtend "^4.0.1" + +hast-util-to-html@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-3.0.0.tgz#19a257cd7af464777c1cccf4d2d53d33147466c1" + dependencies: + ccount "^1.0.0" + comma-separated-tokens "^1.0.1" + has "^1.0.1" + hast-util-is-element "^1.0.0" + hast-util-whitespace "^1.0.0" + html-void-elements "^1.0.0" + kebab-case "^1.0.0" + property-information "^3.1.0" + space-separated-tokens "^1.0.0" + stringify-entities "^1.0.1" + unist-util-is "^2.0.0" + xtend "^4.0.1" + +hast-util-whitespace@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.0.tgz#bd096919625d2936e1ff17bc4df7fd727f17ece9" + +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +highlight.js@^9.1.0: + version "9.11.0" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.11.0.tgz#47f98c7399918700db2caf230ded12cec41a84ae" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +hosted-git-info@^2.1.4: + version "2.4.2" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + +html-void-elements@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.1.tgz#f929bea267a19e3535950502ca12c159f1b559af" + +http-signature@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" + dependencies: + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +husky@^0.13.3: + version "0.13.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.3.tgz#bc2066080badc8b8fe3516e881f5bc68a57052ff" + dependencies: + chalk "^1.1.3" + find-parent-dir "^0.3.0" + is-ci "^1.0.9" + normalize-path "^1.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indent-string@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +ini@^1.3.2, ini@^1.3.3, ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +interpret@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +irregular-plurals@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.2.0.tgz#38f299834ba8c00c30be9c554e137269752ff3ac" + +is-absolute@^0.2.3: + version "0.2.6" + resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" + dependencies: + is-relative "^0.2.1" + is-windows "^0.2.0" + +is-alphabetical@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.0.tgz#e2544c13058255f2144cb757066cd3342a1c8c46" + +is-alphanumeric@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" + +is-alphanumerical@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.0.tgz#e06492e719c1bf15dec239e4f1af5f67b4d6e7bf" + dependencies: + is-alphabetical "^1.0.0" + is-decimal "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.0.2, is-buffer@^1.1.4: + version "1.1.5" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-ci@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-decimal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.0.tgz#940579b6ea63c628080a69e62bda88c8470b4fe0" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-extglob@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-hexadecimal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.0.tgz#5c459771d2af9a2e3952781fd54fcb1bcfe4113c" + +is-my-json-valid@^2.12.4: + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-obj@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-plain-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-relative@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-0.2.1.tgz#d27f4c7d516d175fb610db84bbeef23c3bc97aa5" + dependencies: + is-unc-path "^0.1.1" + +is-ssh@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.0.tgz#ebea1169a2614da392a63740366c3ce049d8dff6" + dependencies: + protocols "^1.1.0" + +is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + +is-text-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + dependencies: + text-extensions "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +is-unc-path@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-0.1.2.tgz#6ab053a72573c10250ff416a3814c35178af39b9" + dependencies: + unc-path-regex "^0.1.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +is-valid-glob@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" + +is-whitespace-character@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.0.tgz#bbf4a83764ead0d451bec2a55218e91961adc275" + +is-windows@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" + +is-word-character@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.0.tgz#a3a9e5ddad70c5c2ee36f4a9cfc9a53f44535247" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" + +isexe@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +istanbul-lib-coverage@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" + +istanbul-lib-hook@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" + dependencies: + append-transform "^0.4.0" + +istanbul-lib-instrument@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz#b8e0dc25709bb44e17336ab47b7bb5c97c23f659" + dependencies: + babel-generator "^6.18.0" + babel-template "^6.16.0" + babel-traverse "^6.18.0" + babel-types "^6.18.0" + babylon "^6.13.0" + istanbul-lib-coverage "^1.0.2" + semver "^5.3.0" + +istanbul-lib-report@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0.tgz#d83dac7f26566b521585569367fe84ccfc7aaecb" + dependencies: + istanbul-lib-coverage "^1.0.2" + mkdirp "^0.5.1" + path-parse "^1.0.5" + supports-color "^3.1.2" + +istanbul-lib-source-maps@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.1.tgz#f8c8c2e8f2160d1d91526d97e5bd63b2079af71c" + dependencies: + istanbul-lib-coverage "^1.0.2" + mkdirp "^0.5.1" + rimraf "^2.4.4" + source-map "^0.5.3" + +istanbul-reports@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" + dependencies: + handlebars "^4.0.3" + +jest-matcher-utils@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" + dependencies: + chalk "^1.1.3" + pretty-format "^19.0.0" + +jest-validate@19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-yaml@3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +js-yaml@^3.2.7, js-yaml@^3.3.1, js-yaml@^3.4.3: + version "3.8.3" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" + dependencies: + argparse "^1.0.7" + esprima "^3.1.1" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +json5@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + +jsonfile@^2.1.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonparse@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.0.tgz#85fc245b1d9259acc6941960b905adf64e7de0e8" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +jsprim@^1.2.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + dependencies: + assert-plus "1.0.0" + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kebab-case@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" + +kind-of@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" + dependencies: + is-buffer "^1.0.2" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lazystream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" + dependencies: + readable-stream "^2.0.5" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + +lcov-parse@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" + +leven@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + +lint-staged@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.4.0.tgz#52fa85dfc92bb1c6fe8ad0d0d98ca13924e03e4b" + dependencies: + app-root-path "^2.0.0" + cosmiconfig "^1.1.0" + execa "^0.6.0" + listr "^0.11.0" + minimatch "^3.0.0" + npm-which "^3.0.1" + staged-git-files "0.0.4" + +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.0.tgz#44dc01bb0c34a03c572154d4d08cde9b1dc5620f" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.11.0.tgz#5e778bc23806ac3ab984ed75564458151f39b03e" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.2.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + rxjs "^5.0.0-beta.11" + stream-to-observable "^0.1.0" + strip-ansi "^3.0.1" + +livereload-js@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.2.2.tgz#6c87257e648ab475bc24ea257457edcc1f8d0bc2" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +lodash._reinterpolate@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" + +lodash.isequal@^4.0.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + +lodash.map@^4.5.1: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" + +lodash.template@^4.0.2: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + dependencies: + lodash._reinterpolate "~3.0.0" + +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.2.0, lodash@^4.2.1: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +log-driver@1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" + +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + +longest-streak@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.1.tgz#42d291b5411e40365c00e63193497e2247316e35" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lru-cache@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + dependencies: + pseudomap "^1.0.1" + yallist "^2.0.0" + +map-cache@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +markdown-escapes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.0.tgz#c8ca19f1d94d682459e0a93c86db27a7ef716b23" + +markdown-table@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.0.tgz#1f5ae61659ced8808d882554c32e8b3f38dd1143" + +md5-hex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" + dependencies: + md5-o-matic "^0.1.1" + +md5-o-matic@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" + +mdast-util-compact@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.0.tgz#4c94dedfe35932d5457f29b650b330fdc73e994a" + dependencies: + unist-util-modify-children "^1.0.0" + unist-util-visit "^1.1.0" + +mdast-util-definitions@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.0.tgz#00f67b4289ed36bafc0977b558414ac0c5023b24" + dependencies: + has "^1.0.1" + unist-util-visit "^1.0.0" + +mdast-util-inject@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-inject/-/mdast-util-inject-1.1.0.tgz#db06b8b585be959a2dcd2f87f472ba9b756f3675" + dependencies: + mdast-util-to-string "^1.0.0" + +mdast-util-to-hast@^2.1.1: + version "2.4.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.4.0.tgz#63ce8e43c61d8e5728954a3515e0c936a3b26cea" + dependencies: + collapse-white-space "^1.0.0" + detab "^2.0.0" + has "^1.0.1" + mdast-util-definitions "^1.2.0" + normalize-uri "^1.0.0" + trim "0.0.1" + trim-lines "^1.0.0" + unist-builder "^1.0.1" + unist-util-generated "^1.1.0" + unist-util-position "^3.0.0" + unist-util-visit "^1.1.0" + xtend "^4.0.1" + +mdast-util-to-string@^1.0.0, mdast-util-to-string@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.0.2.tgz#dc996a24d2b521178d3fac3993680c03a683e1dd" + +mdast-util-toc@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-toc/-/mdast-util-toc-2.0.1.tgz#b1d2cb23bfb01f812fa7b55bffe8b0a8bedf6f21" + dependencies: + github-slugger "^1.1.1" + mdast-util-to-string "^1.0.2" + unist-util-visit "^1.1.0" + +meow@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +merge-source-map@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.3.tgz#da1415f2722a5119db07b14c4f973410863a2abf" + dependencies: + source-map "^0.5.3" + +merge-stream@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + dependencies: + readable-stream "^2.0.1" + +micromatch@^2.1.5, micromatch@^2.1.6, micromatch@^2.3.11, micromatch@^2.3.7: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +mime-db@~1.27.0: + version "1.27.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" + +mime-types@^2.1.12, mime-types@~2.1.7: + version "2.1.15" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + dependencies: + mime-db "~1.27.0" + +mime@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@0.0.8, minimist@~0.0.1: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +minimist@1.2.0, minimist@>=0.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mock-fs@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.2.0.tgz#ef53ae17b77e64f67816dd0467f29208a3b26e19" + +modify-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" + +module-deps-sortable@4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/module-deps-sortable/-/module-deps-sortable-4.0.6.tgz#1251a4ba2c44a92df6989bd029da121a4f2109b0" + dependencies: + JSONStream "^1.0.3" + browser-resolve "^1.7.0" + concat-stream "~1.5.0" + defined "^1.0.0" + detective "^4.0.0" + duplexer2 "^0.1.2" + inherits "^2.0.1" + parents "^1.0.0" + readable-stream "^2.0.2" + resolve "^1.1.3" + stream-combiner2 "^1.1.1" + subarg "^1.0.0" + through2 "^2.0.0" + xtend "^4.0.0" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +ms@0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" + +nan@^2.3.0: + version "2.6.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" + +node-pre-gyp@^0.6.29: + version "0.6.34" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" + dependencies: + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5: + version "2.3.8" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + +normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-uri@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/normalize-uri/-/normalize-uri-1.1.0.tgz#01fb440c7fd059b9d9be8645aac14341efd059dd" + +npm-path@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.3.tgz#15cff4e1c89a38da77f56f6055b24f975dfb2bbe" + dependencies: + which "^1.2.10" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + +npmlog@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.1" + set-blocking "~2.0.0" + +null-check@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +nyc@^10.0.0: + version "10.2.2" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.2.tgz#1b1c8ca4636d810cb3e281558dc9fcb08389f204" + dependencies: + archy "^1.0.0" + arrify "^1.0.1" + caching-transform "^1.0.0" + convert-source-map "^1.3.0" + debug-log "^1.0.1" + default-require-extensions "^1.0.0" + find-cache-dir "^0.1.1" + find-up "^1.1.2" + foreground-child "^1.5.3" + glob "^7.0.6" + istanbul-lib-coverage "^1.0.2" + istanbul-lib-hook "^1.0.5" + istanbul-lib-instrument "^1.7.0" + istanbul-lib-report "^1.0.0" + istanbul-lib-source-maps "^1.1.1" + istanbul-reports "^1.0.2" + md5-hex "^1.2.0" + merge-source-map "^1.0.2" + micromatch "^2.3.11" + mkdirp "^0.5.0" + resolve-from "^2.0.0" + rimraf "^2.5.4" + signal-exit "^3.0.1" + spawn-wrap "1.2.4" + test-exclude "^4.0.0" + yargs "^7.0.2" + yargs-parser "^4.0.2" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +once@^1.3.0, once@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +only-shallow@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/only-shallow/-/only-shallow-1.2.0.tgz#71cecedba9324bc0518aef10ec080d3249dc2465" + +opener@^1.4.1: + version "1.4.3" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +ora@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + object-assign "^4.0.1" + +ordered-read-streams@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" + dependencies: + is-stream "^1.0.1" + readable-stream "^2.0.1" + +os-homedir@1.0.1, os-homedir@^1.0.0, os-homedir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.1.tgz#0d62bdf44b916fd3bbdcf2cab191948fb094f007" + +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + dependencies: + lcid "^1.0.0" + +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +own-or-env@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/own-or-env/-/own-or-env-1.0.0.tgz#9ef920fc81e2e63cf59d41101258368cf4fca4fb" + +own-or@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/own-or/-/own-or-1.0.0.tgz#4e877fbeda9a2ec8000fbc0bcae39645ee8bf8dc" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + +pad-right@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" + dependencies: + repeat-string "^1.5.2" + +parents@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + dependencies: + path-platform "~0.11.15" + +parse-entities@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.0.tgz#4bc58f35fdc8e65dded35a12f2e40223ca24a3f7" + dependencies: + character-entities "^1.0.0" + character-entities-legacy "^1.0.0" + character-reference-invalid "^1.0.0" + has "^1.0.1" + is-alphanumerical "^1.0.0" + is-decimal "^1.0.0" + is-hexadecimal "^1.0.0" + +parse-filepath@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.1.tgz#159d6155d43904d16c10ef698911da1e91969b73" + dependencies: + is-absolute "^0.2.3" + map-cache "^0.2.0" + path-root "^0.1.1" + +parse-git-config@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-0.2.0.tgz#272833fdd15fea146fb75d336d236b963b6ff706" + dependencies: + ini "^1.3.3" + +parse-github-repo-url@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.0.tgz#286c53e2c9962e0641649ee3ac9508fca4dd959c" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +parse-url@^1.3.0: + version "1.3.7" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.7.tgz#636cb6e32b88255c704e30ab4349676703267af8" + dependencies: + is-ssh "^1.3.0" + protocols "^1.4.0" + +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-platform@~0.11.15: + version "0.11.15" + resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + +path-root-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + +path-root@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + dependencies: + path-root-regex "^0.1.0" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + +performance-now@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + +plur@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" + dependencies: + irregular-plurals "^1.0.0" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + +prettier@^0.22.0: + version "0.22.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-0.22.0.tgz#7b37c4480d0858180407e5a8e13f0f47da7385d2" + dependencies: + ast-types "0.9.4" + babel-code-frame "6.22.0" + babylon "6.15.0" + chalk "1.1.3" + esutils "2.0.2" + flow-parser "0.40.0" + get-stdin "5.0.1" + glob "7.1.1" + jest-validate "19.0.0" + minimist "1.2.0" + +pretty-format@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" + dependencies: + ansi-styles "^3.0.0" + +private@^0.1.6: + version "0.1.7" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + +process-nextick-args@^1.0.6, process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +property-information@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.1.0.tgz#1581bf8a445dfbfef759775a86700e8dda18b4a1" + +protocols@^1.1.0, protocols@^1.4.0: + version "1.4.5" + resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.5.tgz#21de1f441c4ef7094408ed9f1c94f7a114b87557" + +pseudomap@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +punycode@^1.3.2, punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +q@^1.4.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" + +qs@^6.2.0, qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + +qs@~6.3.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" + +randomatic@^1.1.3: + version "1.1.6" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + +raw-body@~1.1.0: + version "1.1.7" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.7.tgz#1d027c2bfa116acc6623bca8f00016572a87d425" + dependencies: + bytes "1" + string_decoder "0.10" + +rc@^1.1.7: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^1.0.0, read-pkg@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +"readable-stream@>=1.0.33-1 <1.1.0-0": + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: + version "2.2.9" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" + dependencies: + buffer-shims "~1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~1.0.0" + util-deprecate "~1.0.1" + +readable-stream@~2.0.0: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readable-stream@~2.1.0: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +regenerate@^1.2.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" + +regenerator-runtime@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" + +regenerator-transform@0.9.11: + version "0.9.11" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remark-html@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.0.tgz#ade7d94b60e452158f28615218450682601dbfc1" + dependencies: + hast-util-sanitize "^1.0.0" + hast-util-to-html "^3.0.0" + mdast-util-to-hast "^2.1.1" + xtend "^4.0.1" + +remark-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-3.0.0.tgz#f078c8c9976efb0f2afd011c79f30708354593b1" + 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" + +remark-slug@^4.0.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-4.2.2.tgz#3cfaa02e2e24d98405b296072f2ebbdfad279eb6" + dependencies: + github-slugger "^1.0.0" + mdast-util-to-string "^1.0.0" + unist-util-visit "^1.0.0" + +remark-stringify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-3.0.0.tgz#f1720893a3e7c845824d95bb573d628d1346ba2a" + 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" + +remark-toc@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-toc/-/remark-toc-4.0.0.tgz#1e99867a1bee1caebb8fa1d9f5f7605fdf7d8c56" + dependencies: + mdast-util-toc "^2.0.0" + remark-slug "^4.0.0" + +remark@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-7.0.0.tgz#ce9c788c390d98d9a67cb7738e98246732e79144" + dependencies: + remark-parse "^3.0.0" + remark-stringify "^3.0.0" + unified "^6.0.0" + +remote-origin-url@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/remote-origin-url/-/remote-origin-url-0.4.0.tgz#4d3e2902f34e2d37d1c263d87710b77eb4086a30" + dependencies: + parse-git-config "^0.2.0" + +remove-trailing-separator@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +replace-ext@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + +replace-ext@1.0.0, replace-ext@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + +request@2.79.0: + version "2.79.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + uuid "^3.0.0" + +request@^2.81.0: + version "2.81.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~4.2.1" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + oauth-sign "~0.8.1" + performance-now "^0.2.0" + qs "~6.4.0" + safe-buffer "^5.0.1" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "^0.6.0" + uuid "^3.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +resolve-from@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.3, resolve@^1.1.6: + version "1.3.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + dependencies: + path-parse "^1.0.5" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +right-pad@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" + +rimraf@2, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +rxjs@^5.0.0-beta.11: + version "5.3.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d" + dependencies: + symbol-observable "^1.0.1" + +safe-buffer@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + +safe-json-parse@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" + +"semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +shelljs@^0.7.5: + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +signal-exit@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-2.1.2.tgz#375879b1f92ebc3b334480d038dc546a6d558564" + +signal-exit@^3.0.0, signal-exit@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + +source-map-support@^0.4.2, source-map-support@^0.4.3: + version "0.4.14" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" + dependencies: + source-map "^0.5.6" + +source-map@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +space-separated-tokens@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.0.tgz#9e8c60407aa527742cd9eaee2541dec639f1269b" + dependencies: + trim "0.0.1" + +spawn-wrap@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40" + dependencies: + foreground-child "^1.3.3" + mkdirp "^0.5.0" + os-homedir "^1.0.1" + rimraf "^2.3.3" + signal-exit "^2.0.0" + which "^1.2.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +split2@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/split2/-/split2-2.1.1.tgz#7a1f551e176a90ecd3345f7246a0cfe175ef4fd0" + dependencies: + through2 "^2.0.2" + +split@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.0.tgz#c4395ce683abcd254bc28fe1dabb6e5c27dcffae" + dependencies: + through "2" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +stack-utils@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" + +staged-git-files@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" + +standard-version@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.0.0.tgz#e578cefd43ab7b02944bd7569525052eac1b9787" + dependencies: + chalk "^1.1.3" + conventional-changelog "^1.1.0" + conventional-recommended-bump "^0.3.0" + figures "^1.5.0" + fs-access "^1.0.0" + object-assign "^4.1.0" + semver "^5.1.0" + yargs "^6.0.0" + +state-toggle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" + +stream-array@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/stream-array/-/stream-array-1.1.2.tgz#9e5f7345f2137c30ee3b498b9114e80b52bb7eb5" + dependencies: + readable-stream "~2.1.0" + +stream-combiner2@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + dependencies: + duplexer2 "~0.1.0" + readable-stream "^2.0.2" + +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + +stream-to-observable@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" + +string-template@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" + +string-width@^1.0.0, string-width@^1.0.1, string-width@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string_decoder@0.10, string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" + dependencies: + buffer-shims "~1.0.0" + +stringify-entities@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.0.tgz#2244a516c4f1e8e01b73dad01023016776abd917" + dependencies: + character-entities-html4 "^1.0.0" + character-entities-legacy "^1.0.0" + has "^1.0.1" + is-alphanumerical "^1.0.0" + is-hexadecimal "^1.0.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" + dependencies: + first-chunk-stream "^1.0.0" + strip-bom "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +subarg@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + dependencies: + minimist "^1.1.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^3.1.2: + version "3.2.3" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" + dependencies: + has-flag "^1.0.0" + +symbol-observable@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + +tap-mocha-reporter@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/tap-mocha-reporter/-/tap-mocha-reporter-3.0.3.tgz#e5917fad3d9a70957f9b7c736e793beb87d7daf1" + dependencies: + color-support "^1.1.0" + debug "^2.1.3" + diff "^1.3.2" + escape-string-regexp "^1.0.3" + glob "^7.0.5" + js-yaml "^3.3.1" + tap-parser "^5.1.0" + unicode-length "^1.0.0" + optionalDependencies: + readable-stream "^2.1.5" + +tap-parser@^5.1.0, tap-parser@^5.3.1: + version "5.3.3" + resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-5.3.3.tgz#53ec8a90f275d6fff43f169e56a679502a741185" + dependencies: + events-to-array "^1.0.1" + js-yaml "^3.2.7" + optionalDependencies: + readable-stream "^2" + +tap@^10.3.2: + version "10.3.2" + resolved "https://registry.yarnpkg.com/tap/-/tap-10.3.2.tgz#77982f08368d8b1803a3b0ab5fc300e1817f31e7" + dependencies: + bind-obj-methods "^1.0.0" + bluebird "^3.3.1" + clean-yaml-object "^0.1.0" + color-support "^1.1.0" + coveralls "^2.11.2" + deeper "^2.1.0" + foreground-child "^1.3.3" + fs-exists-cached "^1.0.0" + function-loop "^1.0.1" + glob "^7.0.0" + isexe "^1.0.0" + js-yaml "^3.3.1" + nyc "^10.0.0" + only-shallow "^1.0.2" + opener "^1.4.1" + os-homedir "1.0.1" + own-or "^1.0.0" + own-or-env "^1.0.0" + readable-stream "^2.0.2" + signal-exit "^3.0.0" + source-map-support "^0.4.3" + stack-utils "^1.0.0" + tap-mocha-reporter "^3.0.1" + tap-parser "^5.3.1" + tmatch "^3.0.0" + trivial-deferred "^1.0.1" + yapool "^1.0.0" + +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + +test-exclude@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" + dependencies: + arrify "^1.0.1" + micromatch "^2.3.11" + object-assign "^4.1.0" + read-pkg-up "^1.0.1" + require-main-filename "^1.0.1" + +text-extensions@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.4.0.tgz#c385d2e80879fe6ef97893e1709d88d9453726e9" + +through2-filter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" + dependencies: + through2 "~2.0.0" + xtend "~4.0.0" + +through2@^0.6.0: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@~2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + +through@2, "through@>=2.2.7 <3": + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tiny-lr@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.0.3.tgz#386731170ce521263a9d337f769ee8f11e88eb04" + dependencies: + body "^5.1.0" + debug "~2.2.0" + faye-websocket "~0.10.0" + livereload-js "^2.2.2" + object-assign "^4.1.0" + qs "^6.2.0" + +tmatch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tmatch/-/tmatch-3.0.0.tgz#7d2071dedbbc587f194acda3067bd0747b670991" + +tmp@^0.0.31: + version "0.0.31" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" + dependencies: + os-tmpdir "~1.0.1" + +to-absolute-glob@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" + dependencies: + extend-shallow "^2.0.1" + +to-fast-properties@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + +tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +trim-lines@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.0.tgz#9926d03ede13ba18f7d42222631fb04c79ff26fe" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +trim-off-newlines@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + +trim-trailing-lines@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/trim-trailing-lines/-/trim-trailing-lines-1.1.0.tgz#7aefbb7808df9d669f6da2e438cac8c46ada7684" + +trim@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" + +trivial-deferred@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" + +trough@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + dependencies: + safe-buffer "^5.0.1" + +tunnel-agent@~0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +typedarray@^0.0.6, typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@^2.6: + version "2.8.22" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + +unc-path-regex@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + +unherit@^1.0.4: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unherit/-/unherit-1.1.0.tgz#6b9aaedfbf73df1756ad9e316dd981885840cd7d" + dependencies: + inherits "^2.0.1" + xtend "^4.0.1" + +unicode-length@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/unicode-length/-/unicode-length-1.0.3.tgz#5ada7a7fed51841a418a328cf149478ac8358abb" + dependencies: + punycode "^1.3.2" + strip-ansi "^3.0.1" + +unified@^6.0.0: + version "6.1.2" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.2.tgz#b3904c3254ffbea7ff6d806c5d5b6248838cecb6" + dependencies: + bail "^1.0.0" + extend "^3.0.0" + has "^1.0.1" + is-plain-obj "^1.1.0" + isarray "^2.0.1" + trough "^1.0.0" + vfile "^2.0.0" + x-is-function "^1.0.4" + x-is-string "^0.1.0" + +unique-stream@^2.0.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" + dependencies: + json-stable-stringify "^1.0.0" + through2-filter "^2.0.0" + +unist-builder@^1.0.0, unist-builder@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-1.0.2.tgz#8c3b9903ef64bcfb117dd7cf6a5d98fc1b3b27b6" + dependencies: + object-assign "^4.1.0" + +unist-util-generated@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.0.tgz#8c95657ff12b32eaffe0731fbb37da6995fae01b" + +unist-util-is@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.0.0.tgz#e536472c4f78739e164d0859fc3201b97cf46e7c" + +unist-util-modify-children@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.0.tgz#559203ae85d7a76283277be1abfbaf595a177ead" + dependencies: + array-iterate "^1.0.0" + +unist-util-position@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.0.0.tgz#e6e1e03eeeb81c5e1afe553e8d4adfbd7c0d8f82" + +unist-util-remove-position@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.0.tgz#2444fedc344bc5f540dab6353e013b6d78101dc2" + dependencies: + unist-util-visit "^1.1.0" + +unist-util-stringify-position@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.0.tgz#e8ba9d6b6af891b5f8336b3a31c63a9dc85c2af0" + dependencies: + has "^1.0.1" + +unist-util-visit@^1.0.0, unist-util-visit@^1.0.1, unist-util-visit@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.1.tgz#e917a3b137658b335cb4420c7da2e74d928e4e94" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" + +vali-date@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + +vfile-location@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.1.tgz#0bf8816f732b0f8bd902a56fda4c62c8e935dc52" + +vfile-reporter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-3.0.0.tgz#fe50714e373e0d2940510038a99bd609bdc8209f" + dependencies: + chalk "^1.1.0" + log-symbols "^1.0.2" + plur "^2.0.0" + repeat-string "^1.5.0" + string-width "^1.0.0" + strip-ansi "^3.0.1" + trim "0.0.1" + unist-util-stringify-position "^1.0.0" + +vfile-sort@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.0.0.tgz#7279458d111a9ba3b18effd9f8a0169bb7c5112b" + +vfile@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.0.1.tgz#bd48e68e8a2322dff0d162a37f45e70d9bb30466" + dependencies: + has "^1.0.1" + is-buffer "^1.1.4" + replace-ext "1.0.0" + unist-util-stringify-position "^1.0.0" + x-is-string "^0.1.0" + +vinyl-fs@^2.3.1: + version "2.4.4" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239" + dependencies: + duplexify "^3.2.0" + glob-stream "^5.3.2" + graceful-fs "^4.0.0" + gulp-sourcemaps "1.6.0" + is-valid-glob "^0.3.0" + lazystream "^1.0.0" + lodash.isequal "^4.0.0" + merge-stream "^1.0.0" + mkdirp "^0.5.0" + object-assign "^4.0.0" + readable-stream "^2.0.4" + strip-bom "^2.0.0" + strip-bom-stream "^1.0.0" + through2 "^2.0.0" + through2-filter "^2.0.0" + vali-date "^1.0.0" + vinyl "^1.0.0" + +vinyl@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" + dependencies: + clone "^1.0.0" + clone-stats "^0.0.1" + replace-ext "0.0.1" + +vinyl@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.0.2.tgz#0a3713d8d4e9221c58f10ca16c0116c9e25eda7c" + dependencies: + clone "^1.0.0" + clone-buffer "^1.0.0" + clone-stats "^1.0.0" + cloneable-readable "^1.0.0" + is-stream "^1.1.0" + remove-trailing-separator "^1.0.1" + replace-ext "^1.0.0" + +websocket-driver@>=0.5.1: + version "0.6.5" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36" + dependencies: + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" + +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + +which@^1.2.10, which@^1.2.4, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + dependencies: + string-width "^1.0.1" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +word-wrap@^1.0.3: + version "1.2.1" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.1.tgz#248f459b465d179a17bc407c854d3151d07e45d8" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^1.1.4: + version "1.3.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.2.tgz#f80ac5e06d3a38996ab51b5d310db57102deb902" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +x-is-function@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/x-is-function/-/x-is-function-1.0.4.tgz#5d294dc3d268cbdd062580e0c5df77a391d1fa1e" + +x-is-string@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" + +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yallist@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + +yapool@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yapool/-/yapool-1.0.0.tgz#f693f29a315b50d9a9da2646a7a6645c96985b6a" + +yargs-parser@^4.0.2, yargs-parser@^4.2.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" + dependencies: + camelcase "^3.0.0" + +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs@^6.0.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^4.2.0" + +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" From b595c8f33fc0aede9305339e8cd2225945a02c8f Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Fri, 21 Apr 2017 19:01:10 -0400 Subject: [PATCH 036/555] chore(release): 4.0.0-rc.0 --- CHANGELOG.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb7968e29..40527bcf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,61 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [4.0.0-rc.0](https://github.com/documentationjs/documentation/compare/v4.0.0-beta.19...v4.0.0-rc.0) (2017-04-21) + + +### Bug Fixes + +* **html output:** Fix github links in HTML output ([#745](https://github.com/documentationjs/documentation/issues/745)) ([9554b2f](https://github.com/documentationjs/documentation/commit/9554b2f)), closes [#738](https://github.com/documentationjs/documentation/issues/738) +* **params:** added code path for type RestElement ([6961ee8](https://github.com/documentationjs/documentation/commit/6961ee8)) + + +### Code Refactoring + +* **nest:** Better nesting implementation ([#732](https://github.com/documentationjs/documentation/issues/732)) ([7374730](https://github.com/documentationjs/documentation/commit/7374730)) + + +### BREAKING CHANGES + +* **nest:** referencing inferred destructure params without +renaming them, like $0.x, from JSDoc comments will no longer +work. To reference them, instead add a param tag to name the +destructuring param, and then refer to members of that name. + +Before: + +```js +/** + * @param {number} $0.x a member of x + */ +function a({ x }) {} +``` + +After: + +```js +/** + * @param {Object} options + * @param {number} options.x a member of x + */ +function a({ x }) {} +``` + +* Address review comments + +* Reduce testing node requirement back down to 4 + +* Don't output empty properties, reduce diff noise + +* Rearrange and document params + +* Simplify param inference, update test fixtures. This is focused around Array destructuring: documenting destructured array elements with indices instead of names, because the names are purely internal details + +* Use temporary fork to get through blocker + + + # [4.0.0-beta.19](https://github.com/documentationjs/documentation/compare/v4.0.0-beta.18...v4.0.0-beta.19) (2017-04-10) diff --git a/package.json b/package.json index 043ed9112..67fa2e17c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "4.0.0-beta.19", + "version": "4.0.0-rc.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 7f7ea0837cdd562d24b6647480ea4b30a3a345e6 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 21 Apr 2017 19:04:11 -0400 Subject: [PATCH 037/555] style(prettier): Include declarations, bin, and default_theme in prettier scope (#747) This ensures all our formatting everywhere is consistent --- bin/documentation.js | 20 ++-- default_theme/assets/anchor.js | 87 ++++++++------- default_theme/assets/site.js | 78 ++++++------- default_theme/index.js | 77 ++++++++----- default_theme/test/format_markdown.js | 142 +++++++++++++++--------- default_theme/test/format_parameters.js | 9 +- default_theme/test/index.js | 16 +-- package.json | 2 +- 8 files changed, 251 insertions(+), 180 deletions(-) diff --git a/bin/documentation.js b/bin/documentation.js index 5bd322670..9ecd0ff16 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -4,15 +4,14 @@ 'use strict'; -var yargs = require('yargs'), - commands = require('../lib/commands'); +var yargs = require('yargs'), commands = require('../lib/commands'); var argv = yargs .command(commands.serve) .command(commands.build) .command(commands.lint) .command(commands.readme) - .fail(function (msg, error) { + .fail(function(msg, error) { if (error) { throw error; } else { @@ -21,10 +20,11 @@ var argv = yargs return yargs.exit(1); } }) - .version(function () { + .version(function() { return require('../package').version; }) - .usage(`Usage: + .usage( + `Usage: # generate markdown docs for index.js and files it references $0 build index.js -f md @@ -46,13 +46,15 @@ var argv = yargs # build docs for all values exported by index.js $0 build --document-exported index.js -`) +` + ) .recommendCommands() - .help() - .argv; + .help().argv; if (argv.private) { - console.error('--private is deprecated, please use the --access (or -a) option instead'); + console.error( + '--private is deprecated, please use the --access (or -a) option instead' + ); console.error('for example: -a public -a private -a protected -a undefined'); } diff --git a/default_theme/assets/anchor.js b/default_theme/assets/anchor.js index 47d871ad4..476a8f9ab 100644 --- a/default_theme/assets/anchor.js +++ b/default_theme/assets/anchor.js @@ -6,13 +6,18 @@ function AnchorJS(options) { 'use strict'; - this.options = options || {}; this._applyRemainingDefaultOptions = function(opts) { - this.options.icon = this.options.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. - this.options.visible = this.options.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' - this.options.placement = this.options.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left' + this.options.icon = this.options.hasOwnProperty('icon') + ? opts.icon + : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. + this.options.visible = this.options.hasOwnProperty('visible') + ? opts.visible + : 'hover'; // Also accepts 'always' + this.options.placement = this.options.hasOwnProperty('placement') + ? opts.placement + : 'right'; // Also accepts 'left' this.options.class = this.options.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name. }; @@ -20,17 +25,17 @@ function AnchorJS(options) { this.add = function(selector) { var elements, - elsWithIds, - idList, - elementID, - i, - roughText, - tidyText, - index, - count, - newTidyText, - readableID, - anchor; + elsWithIds, + idList, + elementID, + i, + roughText, + tidyText, + index, + count, + newTidyText, + readableID, + anchor; this._applyRemainingDefaultOptions(this.options); @@ -55,7 +60,6 @@ function AnchorJS(options) { }); for (i = 0; i < elements.length; i++) { - if (elements[i].hasAttribute('id')) { elementID = elements[i].getAttribute('id'); } else { @@ -65,12 +69,13 @@ function AnchorJS(options) { // spaces with hyphens, truncate to 32 characters, and make toLowerCase. // // Example string: // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.' - tidyText = roughText.replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment' - .replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment' - .replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment' - .substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' - .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' - .toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url' + tidyText = roughText + .replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment' + .replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment' + .replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment' + .substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' + .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' + .toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url' // Compare our generated ID to existing IDs (and increment it if needed) // before we add it to the page. @@ -121,7 +126,8 @@ function AnchorJS(options) { anchor.style.marginLeft = '-1em'; anchor.style.paddingRight = '0.5em'; elements[i].insertBefore(anchor, elements[i].firstChild); - } else { // if the option provided is `right` (or anything else). + } else { + // if the option provided is `right` (or anything else). anchor.style.paddingLeft = '0.375em'; elements[i].appendChild(anchor); } @@ -131,8 +137,7 @@ function AnchorJS(options) { }; this.remove = function(selector) { - var domAnchor, - elements = document.querySelectorAll(selector); + var domAnchor, elements = document.querySelectorAll(selector); for (var i = 0; i < elements.length; i++) { domAnchor = elements[i].querySelector('.anchorjs-link'); if (domAnchor) { @@ -149,30 +154,26 @@ function AnchorJS(options) { } var style = document.createElement('style'), - linkRule = - ' .anchorjs-link {' + - ' opacity: 0;' + - ' text-decoration: none;' + + linkRule = ' .anchorjs-link {' + + ' opacity: 0;' + + ' text-decoration: none;' + ' -webkit-font-smoothing: antialiased;' + - ' -moz-osx-font-smoothing: grayscale;' + + ' -moz-osx-font-smoothing: grayscale;' + ' }', - hoverRule = - ' *:hover > .anchorjs-link,' + - ' .anchorjs-link:focus {' + - ' opacity: 1;' + + hoverRule = ' *:hover > .anchorjs-link,' + + ' .anchorjs-link:focus {' + + ' opacity: 1;' + ' }', - anchorjsLinkFontFace = - ' @font-face {' + - ' font-family: "anchorjs-icons";' + - ' font-style: normal;' + - ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above + anchorjsLinkFontFace = ' @font-face {' + + ' font-family: "anchorjs-icons";' + + ' font-style: normal;' + + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + ' }', - pseudoElContent = - ' [data-anchorjs-icon]::after {' + - ' content: attr(data-anchorjs-icon);' + + pseudoElContent = ' [data-anchorjs-icon]::after {' + + ' content: attr(data-anchorjs-icon);' + ' }', - firstStyleEl; + firstStyleEl; style.className = 'anchorjs'; style.appendChild(document.createTextNode('')); // Necessary for Webkit. diff --git a/default_theme/assets/site.js b/default_theme/assets/site.js index 559c65e5f..55ada036f 100644 --- a/default_theme/assets/site.js +++ b/default_theme/assets/site.js @@ -5,48 +5,45 @@ anchors.options.placement = 'left'; anchors.add('h3'); // Filter UI -var tocElements = document.getElementById('toc') - .getElementsByTagName('li'); - -document.getElementById('filter-input') - .addEventListener('keyup', function (e) { - - var i, element, children; - - // enter key - if (e.keyCode === 13) { - // go to the first displayed item in the toc - for (i = 0; i < tocElements.length; i++) { - element = tocElements[i]; - if (!element.classList.contains('display-none')) { - location.replace(element.firstChild.href); - return e.preventDefault(); - } +var tocElements = document.getElementById('toc').getElementsByTagName('li'); + +document.getElementById('filter-input').addEventListener('keyup', function(e) { + var i, element, children; + + // enter key + if (e.keyCode === 13) { + // go to the first displayed item in the toc + for (i = 0; i < tocElements.length; i++) { + element = tocElements[i]; + if (!element.classList.contains('display-none')) { + location.replace(element.firstChild.href); + return e.preventDefault(); } } + } - var match = function () { - return true; - }; + var match = function() { + return true; + }; - var value = this.value.toLowerCase(); + var value = this.value.toLowerCase(); - if (!value.match(/^\s*$/)) { - match = function (element) { - return element.firstChild.innerHTML.toLowerCase().indexOf(value) !== -1; - }; - } + if (!value.match(/^\s*$/)) { + match = function(element) { + return element.firstChild.innerHTML.toLowerCase().indexOf(value) !== -1; + }; + } - for (i = 0; i < tocElements.length; i++) { - element = tocElements[i]; - children = Array.from(element.getElementsByTagName('li')); - if (match(element) || children.some(match)) { - element.classList.remove('display-none'); - } else { - element.classList.add('display-none'); - } + for (i = 0; i < tocElements.length; i++) { + element = tocElements[i]; + children = Array.from(element.getElementsByTagName('li')); + if (match(element) || children.some(match)) { + element.classList.remove('display-none'); + } else { + element.classList.add('display-none'); } - }); + } +}); var toggles = document.getElementsByClassName('toggle-step-sibling'); for (var i = 0; i < toggles.length; i++) { @@ -54,7 +51,9 @@ for (var i = 0; i < toggles.length; i++) { } function toggleStepSibling() { - var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName('toggle-target')[0]; + var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName( + 'toggle-target' + )[0]; var klass = 'display-none'; if (stepSibling.classList.contains(klass)) { stepSibling.classList.remove(klass); @@ -86,8 +85,11 @@ function toggleSibling() { function showHashTarget(targetId) { var hashTarget = document.getElementById(targetId); // new target is hidden - if (hashTarget && hashTarget.offsetHeight === 0 && - hashTarget.parentNode.parentNode.classList.contains('display-none')) { + if ( + hashTarget && + hashTarget.offsetHeight === 0 && + hashTarget.parentNode.parentNode.classList.contains('display-none') + ) { hashTarget.parentNode.parentNode.classList.remove('display-none'); } } diff --git a/default_theme/index.js b/default_theme/index.js index 537b80d20..1c5347215 100644 --- a/default_theme/index.js +++ b/default_theme/index.js @@ -11,13 +11,16 @@ var fs = require('fs'), LinkerStack = require('../').util.LinkerStack, hljs = require('highlight.js'); -module.exports = function (comments/*: Array */, config/*: DocumentationConfig */) { - - var linkerStack = new LinkerStack(config) - .namespaceResolver(comments, function (namespace) { - var slugger = new GithubSlugger(); - return '#' + slugger.slug(namespace); - }); +module.exports = function( + comments /*: Array */, + config /*: DocumentationConfig */ +) { + var linkerStack = new LinkerStack( + config + ).namespaceResolver(comments, function(namespace) { + var slugger = new GithubSlugger(); + return '#' + slugger.slug(namespace); + }); var formatters = createFormatters(linkerStack.link); @@ -47,13 +50,17 @@ module.exports = function (comments/*: Array */, config/*: Documentatio return section.name; } if (section.returns.length) { - returns = ': ' + - formatters.type(section.returns[0].type); + returns = ': ' + formatters.type(section.returns[0].type); } return prefix + section.name + formatters.parameters(section) + returns; }, md(ast, inline) { - if (inline && ast && ast.children.length && ast.children[0].type === 'paragraph') { + if ( + inline && + ast && + ast.children.length && + ast.children[0].type === 'paragraph' + ) { ast = { type: 'root', children: ast.children[0].children.concat(ast.children.slice(1)) @@ -71,24 +78,44 @@ module.exports = function (comments/*: Array */, config/*: Documentatio } } }; - - sharedImports.imports.renderSectionList = _.template(fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), sharedImports); - sharedImports.imports.renderSection = _.template(fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), sharedImports); - sharedImports.imports.renderNote = _.template(fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), sharedImports); - var pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports); + sharedImports.imports.renderSectionList = _.template( + fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'), + sharedImports + ); + sharedImports.imports.renderSection = _.template( + fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'), + sharedImports + ); + sharedImports.imports.renderNote = _.template( + fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), + sharedImports + ); + + var pageTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), + sharedImports + ); // push assets into the pipeline as well. return new Promise(resolve => { - vfs.src([__dirname + '/assets/**'], { base: __dirname }) - .pipe(concat(function (files) { - resolve(files.concat(new File({ - path: 'index.html', - contents: new Buffer(pageTemplate({ - docs: comments, - config: config - }), 'utf8') - }))); - })); + vfs.src([__dirname + '/assets/**'], { base: __dirname }).pipe( + concat(function(files) { + resolve( + files.concat( + new File({ + path: 'index.html', + contents: new Buffer( + pageTemplate({ + docs: comments, + config: config + }), + 'utf8' + ) + }) + ) + ); + }) + ); }); }; diff --git a/default_theme/test/format_markdown.js b/default_theme/test/format_markdown.js index 403188cc1..d50b71ce0 100644 --- a/default_theme/test/format_markdown.js +++ b/default_theme/test/format_markdown.js @@ -2,85 +2,117 @@ var test = require('tap').test; var remark = require('remark'); var formatMarkdown = require('../lib/format_markdown'); -test('main', function (t) { - t.deepEqual(formatMarkdown(remark().parse('Converts from `Result` to `?Error`')), - '

    Converts from Result<T> to ?Error

    \n'); +test('main', function(t) { + t.deepEqual( + formatMarkdown(remark().parse('Converts from `Result` to `?Error`')), + '

    Converts from Result<T> to ?Error

    \n' + ); t.done(); }); -test('type', function (t) { +test('type', function(t) { var formatType = formatMarkdown.type; t.deepEqual(formatType(undefined), ''); - t.deepEqual(formatType({ - type: 'NameExpression', - name: 'Foo' - }), 'Foo'); - - t.deepEqual(formatType({ - type: 'NameExpression', - name: 'Foo' - }, ['Foo']), 'Foo'); + t.deepEqual( + formatType({ + type: 'NameExpression', + name: 'Foo' + }), + 'Foo' + ); - t.deepEqual(formatType({ - type: 'UnionType', - elements: [ + t.deepEqual( + formatType( { type: 'NameExpression', name: 'Foo' }, - { - type: 'NameExpression', - name: 'Bar' - } - ] - }), '(Foo | Bar)'); + ['Foo'] + ), + 'Foo' + ); - t.deepEqual(formatType({ - type: 'AllLiteral' - }), 'Any'); + t.deepEqual( + formatType({ + type: 'UnionType', + elements: [ + { + type: 'NameExpression', + name: 'Foo' + }, + { + type: 'NameExpression', + name: 'Bar' + } + ] + }), + '(Foo | Bar)' + ); - t.deepEqual(formatType({ - type: 'RestType' - }), '...'); + t.deepEqual( + formatType({ + type: 'AllLiteral' + }), + 'Any' + ); - t.deepEqual(formatType({ - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'Foo' - } - }), '[Foo]'); + t.deepEqual( + formatType({ + type: 'RestType' + }), + '...' + ); - t.deepEqual(formatType({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Foo' - }, - applications: [{ - type: 'NameExpression', - name: 'Bar' - }] - }), 'Foo<Bar>'); + t.deepEqual( + formatType({ + type: 'OptionalType', + expression: { + type: 'NameExpression', + name: 'Foo' + } + }), + '[Foo]' + ); + + t.deepEqual( + formatType({ + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: 'Foo' + }, + applications: [ + { + type: 'NameExpression', + name: 'Bar' + } + ] + }), + 'Foo<Bar>' + ); - t.deepEqual(formatType({ - type: 'UndefinedLiteral' - }), 'undefined'); + t.deepEqual( + formatType({ + type: 'UndefinedLiteral' + }), + 'undefined' + ); t.done(); }); -test('autolink', function (t) { +test('autolink', function(t) { var autolink = formatMarkdown.link; t.equal(autolink([], 'Foo'), 'Foo'); - t.equal(autolink(['Foo'], 'Foo'), - 'Foo'); - t.equal(autolink([], 'Array'), - 'Array'); + t.equal(autolink(['Foo'], 'Foo'), 'Foo'); + t.equal( + autolink([], 'Array'), + 'Array' + ); t.equal(autolink([], 'C&O'), 'C&O'); t.done(); diff --git a/default_theme/test/format_parameters.js b/default_theme/test/format_parameters.js index 2c2597532..e59ca5937 100644 --- a/default_theme/test/format_parameters.js +++ b/default_theme/test/format_parameters.js @@ -1,10 +1,15 @@ var test = require('tap').test; var formatParameters = require('../lib/format_parameters'); -test('main', function (t) { +test('main', function(t) { t.deepEqual(formatParameters({}), ''); t.deepEqual(formatParameters({ params: [] }), '()'); t.deepEqual(formatParameters({ params: [{ name: 'foo' }] }), '(foo: )'); - t.deepEqual(formatParameters({ params: [{ name: 'foo', type: { type: 'OptionalType' } }] }), '(foo: [])'); + t.deepEqual( + formatParameters({ + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }), + '(foo: [])' + ); t.done(); }); diff --git a/default_theme/test/index.js b/default_theme/test/index.js index fa10c2184..a613069b4 100644 --- a/default_theme/test/index.js +++ b/default_theme/test/index.js @@ -2,7 +2,7 @@ var test = require('tap').test; var remark = require('remark'); var theme = require('..'); -test('main', function (t) { +test('main', function(t) { var comments = [ { path: [], @@ -12,16 +12,18 @@ test('main', function (t) { static: [], instance: [] }, - returns: [{ - type: { - type: 'NameExpression', - name: 'Foo' + returns: [ + { + type: { + type: 'NameExpression', + name: 'Foo' + } } - }] + ] } ]; - theme(comments, {}, function (err) { + theme(comments, {}, function(err) { t.ifError(err); t.done(); }); diff --git a/package.json b/package.json index 67fa2e17c..d5a124967 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "scripts": { "release": "standard-version", "precommit": "lint-staged --verbose", - "format": "prettier --write '{lib,test}/**/*.js' --single-quote", + "format": "prettier --write '{lib,test,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "./bin/documentation.js build lib/index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint", From cfaaf214cc42ef3b42192800f45acf4ad1a6d380 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 24 Apr 2017 12:29:18 -0400 Subject: [PATCH 038/555] test(fixtures): Update test fixtures for rc.0 (#750) --- test/fixture/html/nested.config-output.html | 4 ++-- test/fixture/html/nested.output.files | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index b5feef73f..cce7ee832 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -2,7 +2,7 @@ - documentation 4.0.0-beta.19 | Documentation + documentation 4.0.0-rc.0 | Documentation @@ -14,7 +14,7 @@

    documentation

    -
    4.0.0-beta.19
    +
    4.0.0-rc.0
    - documentation 4.0.0-beta.19 | Documentation + documentation 4.0.0-rc.0 | Documentation @@ -14,7 +14,7 @@

    documentation

    -
    4.0.0-beta.19
    +
    4.0.0-rc.0
    Date: Mon, 24 Apr 2017 14:04:32 -0400 Subject: [PATCH 039/555] fix(flow): Fix inference of Flow types with properties (#751) Previously we naively thought that id.name would be a string for all types, which is not the case. Instead, we use babel-generator to safely generate string representations of types. Fixes #749 --- lib/flow_doctrine.js | 50 +++++++------ test/fixture/es6.input.js | 5 ++ test/fixture/es6.output-toc.md | 10 +++ test/fixture/es6.output.json | 120 ++++++++++++++++++++++++++++++++ test/fixture/es6.output.md | 11 +++ test/fixture/es6.output.md.json | 120 ++++++++++++++++++++++++++++++++ test/format_type.js | 1 + test/lib/flow_doctrine.js | 99 ++++++++++++++++++++++++++ 8 files changed, 396 insertions(+), 20 deletions(-) diff --git a/lib/flow_doctrine.js b/lib/flow_doctrine.js index b0b75f153..dd1d7b004 100644 --- a/lib/flow_doctrine.js +++ b/lib/flow_doctrine.js @@ -1,6 +1,8 @@ 'use strict'; /* @flow */ +const generate = require('babel-generator').default; + var namedTypes = { NumberTypeAnnotation: 'number', BooleanTypeAnnotation: 'boolean', @@ -14,12 +16,6 @@ var oneToOne = { VoidTypeAnnotation: 'VoidLiteral' }; -var literalTypes = { - BooleanLiteralTypeAnnotation: 'BooleanLiteralType', - NumericLiteralTypeAnnotation: 'NumericLiteralType', - StringLiteralTypeAnnotation: 'StringLiteralType' -}; - function propertyToField(property) { var type = flowDoctrine(property.value); if (property.optional) { @@ -116,7 +112,9 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { type: 'TypeApplication', expression: { type: 'NameExpression', - name: type.id.name + name: generate(type.id, { + compact: true + }).code }, applications: type.typeParameters.params.map(flowDoctrine) }; @@ -124,7 +122,9 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { return { type: 'NameExpression', - name: type.id.name + name: generate(type.id, { + compact: true + }).code }; case 'ObjectTypeAnnotation': @@ -137,20 +137,30 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { return { type: 'NameExpression', - name: type.id.name + name: generate(type.id, { + compact: true + }).code + }; + case 'BooleanLiteralTypeAnnotation': + return { + type: 'BooleanLiteralType', + value: type.value + }; + case 'NumericLiteralTypeAnnotation': + return { + type: 'NumericLiteralType', + value: type.value + }; + case 'StringLiteralTypeAnnotation': + return { + type: 'StringLiteralType', + value: type.value + }; + default: + return { + type: 'AllLiteral' }; } - - if (type.type in literalTypes) { - return { - type: literalTypes[type.type], - value: type.value - }; - } - - return { - type: 'AllLiteral' - }; } module.exports = flowDoctrine; diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index 8ee1ff346..8381a946f 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -154,3 +154,8 @@ export function isArrayEqualWith( ): boolean { return true; } + +/** Regression check for #749 */ +export function paramWithMemberType(a: atype.property): boolean { + return true; +} diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md index 4060592c0..4a058bf09 100644 --- a/test/fixture/es6.output-toc.md +++ b/test/fixture/es6.output-toc.md @@ -138,3 +138,13 @@ Regression check for #498 - `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** + +## paramWithMemberType + +Regression check for #749 + +**Parameters** + +- `a` **atype.property** + +Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 2f66ac9b6..c9c1e99d6 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -2841,5 +2841,125 @@ } ], "namespace": "isArrayEqualWith" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Regression check for #749", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 158, + "column": 0 + }, + "end": { + "line": 158, + "column": 32 + } + }, + "context": { + "loc": { + "start": { + "line": 159, + "column": 0 + }, + "end": { + "line": 161, + "column": 1 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "a", + "lineNumber": 159, + "type": { + "type": "NameExpression", + "name": "atype.property" + } + } + ], + "properties": [], + "returns": [ + { + "title": "returns", + "type": { + "type": "NameExpression", + "name": "boolean" + } + } + ], + "sees": [], + "throws": [], + "todos": [], + "name": "paramWithMemberType", + "kind": "function", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "paramWithMemberType", + "kind": "function" + } + ], + "namespace": "paramWithMemberType" } ] \ No newline at end of file diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 416e00c6a..8cd7b6b91 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -22,6 +22,7 @@ - [iAmPublic](#iampublic) - [execute](#execute) - [isArrayEqualWith](#isarrayequalwith) +- [paramWithMemberType](#paramwithmembertype) ## destructure @@ -161,3 +162,13 @@ Regression check for #498 - `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** + +## paramWithMemberType + +Regression check for #749 + +**Parameters** + +- `a` **atype.property** + +Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index 3c6e7eb2b..4cfaddb81 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -2243,6 +2243,126 @@ } ] }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Returns " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "children": [ + { + "type": "text", + "value": "boolean" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "paramWithMemberType" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Regression check for #749", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 26, + "offset": 25 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "a" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "atype.property" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, { "type": "paragraph", "children": [ diff --git a/test/format_type.js b/test/format_type.js index 667c7613d..6bb3c7279 100644 --- a/test/format_type.js +++ b/test/format_type.js @@ -22,6 +22,7 @@ test('formatType', function(t) { ['null', 'null'], ['null', 'null'], ['*', 'any'], + ['namedType.typeProperty', 'namedType.typeProperty'], [ 'Array|undefined', '([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\| [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))' diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js index 5b36b7fc1..da9d62bb7 100644 --- a/test/lib/flow_doctrine.js +++ b/test/lib/flow_doctrine.js @@ -117,6 +117,105 @@ test('flowDoctrine', function(t) { 'object' ); + t.deepEqual( + toDoctrineType('namedType.propertyOfType'), + { + type: 'NameExpression', + name: 'namedType.propertyOfType' + }, + 'named type with property' + ); + + t.deepEqual( + toDoctrineType('Array'), + { + applications: [ + { + type: 'NameExpression', + name: 'namedType.propertyOfType' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }, + 'typeapplication of named type with property' + ); + + t.deepEqual( + toDoctrineType('Array>'), + { + applications: [ + { + applications: [ + { + name: 'boolean', + type: 'NameExpression' + } + ], + expression: { + type: 'NameExpression', + name: 'namedType.propertyOfType' + }, + type: 'TypeApplication' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }, + 'nested type application' + ); + + t.deepEqual( + toDoctrineType('{ a: foo.bar }'), + { + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ], + type: 'RecordType' + }, + 'object type expression with subtype' + ); + + t.deepEqual( + toDoctrineType('{ a: { b: foo.bar } }'), + { + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + type: 'RecordType', + fields: [ + { + key: 'b', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ] + } + } + ], + type: 'RecordType' + }, + 'nested fieldtype' + ); + t.deepEqual( toDoctrineType('{ a: 1 }'), { From 355038d03e1ee4e078e045e459296cf100c69462 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 24 Apr 2017 18:51:51 -0400 Subject: [PATCH 040/555] fix: Infer parameters for classes from constructors Fixes #689 --- docs/RECIPES.md | 39 ++ lib/infer/params.js | 20 +- lib/parsers/javascript.js | 10 + test/fixture/es6-class.input.js | 20 +- test/fixture/es6-class.output.json | 301 ++++++++-------- test/fixture/es6-class.output.md | 15 +- test/fixture/es6-class.output.md.json | 200 ++++++++--- test/fixture/es6.input.js | 16 +- test/fixture/es6.output-toc.md | 12 +- test/fixture/es6.output.json | 498 ++++++++++++-------------- test/fixture/es6.output.md | 13 +- test/fixture/es6.output.md.json | 288 +++++++-------- 12 files changed, 780 insertions(+), 652 deletions(-) diff --git a/docs/RECIPES.md b/docs/RECIPES.md index 3403f634b..c747a7749 100644 --- a/docs/RECIPES.md +++ b/docs/RECIPES.md @@ -1,3 +1,42 @@ +## Classes + +ES6 has a nice, formal way of declaring classes. documentation.js handles it well: +here are tips for dealing with them. + +**Document constructor parameters with the class, not the constructor method.** + +Do: + +```js +/** + * A table object + * @param {number} width + * @param {number} height + */ +class Table { + constructor(width, height) { + this.width = width; + this.height = height; + } +} +``` + +Don't: + +```js +/** A table object */ +class Table { + /* + * @param {number} width + * @param {number} height + */ + constructor(width, height) { + this.width = width; + this.height = height; + } +} +``` + ## Destructuring Parameters In ES6, you can use [destructuring assignment in functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment): diff --git a/lib/infer/params.js b/lib/infer/params.js index 2861bee70..dd92bad1b 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -7,7 +7,7 @@ const _ = require('lodash'); const findTarget = require('./finders').findTarget; const flowDoctrine = require('../flow_doctrine'); const util = require('util'); -const debuglog = util.debuglog('infer'); +const debuglog = util.debuglog('documentation'); /** * Infers param tags by reading function parameter names @@ -24,13 +24,27 @@ function inferParams(comment /*: Comment */) { path = path.get('init'); } + // If this is an ES6 class with a constructor method, infer + // parameters from that constructor method. + if (t.isClassDeclaration(path)) { + let constructor = path.node.body.body.find(item => { + // https://github.com/babel/babylon/blob/master/ast/spec.md#classbody + return t.isClassMethod(item) && item.kind === 'constructor'; + }); + if (constructor) { + return inferAndCombineParams(constructor.params, comment); + } + } + if (!t.isFunction(path)) { return comment; } - var inferredParams = path.node.params.map((param, i) => - paramToDoc(param, '', i)); + return inferAndCombineParams(path.node.params, comment); +} +function inferAndCombineParams(params, comment) { + var inferredParams = params.map((param, i) => paramToDoc(param, '', i)); var mergedParams = mergeTrees(inferredParams, comment.params); // Then merge the trees. This is the hard part. diff --git a/lib/parsers/javascript.js b/lib/parsers/javascript.js index 17d4f8121..f584cafc3 100644 --- a/lib/parsers/javascript.js +++ b/lib/parsers/javascript.js @@ -2,9 +2,12 @@ /* @flow */ var _ = require('lodash'), + t = require('babel-types'), parse = require('../../lib/parse'), walkComments = require('../extractors/comments'), walkExported = require('../extractors/exported'), + util = require('util'), + debuglog = util.debuglog('documentation'), parseToAst = require('./parse_to_ast'); /** @@ -89,6 +92,13 @@ function _addComment( value: path }); + // #689 + if (t.isClassMethod(path) && path.node.kind === 'constructor') { + debuglog( + 'A constructor was documented explicitly: document along with the class instead' + ); + } + if (path.parentPath && path.parentPath.node) { var parentNode = path.parentPath.node; context.code = data.source.substring(parentNode.start, parentNode.end); diff --git a/test/fixture/es6-class.input.js b/test/fixture/es6-class.input.js index 10cf6c7c8..e8e57d12a 100644 --- a/test/fixture/es6-class.input.js +++ b/test/fixture/es6-class.input.js @@ -5,17 +5,21 @@ class Foo extends React.Component {} /** * Does nothing. This is from issue #556 + * @param {string} str */ -export default class Bar { - /** - * Creates a new instance - * @param {string} str - */ +export class Bar { constructor(str) { /** - * A useless property - * @type {string} - */ + * A useless property + * @type {string} + */ this.bar = ''; } } + +/** + * This class has fully inferred constructor parameters. + */ +export class Baz { + constructor(n: number, l: Array) {} +} diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json index 78ce308f3..946da68c4 100644 --- a/test/fixture/es6-class.output.json +++ b/test/fixture/es6-class.output.json @@ -159,25 +159,36 @@ } } }, - "tags": [], + "tags": [ + { + "title": "param", + "description": null, + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "string" + }, + "name": "str" + } + ], "loc": { "start": { "line": 6, "column": 0 }, "end": { - "line": 8, + "line": 9, "column": 3 } }, "context": { "loc": { "start": { - "line": 9, + "line": 10, "column": 0 }, "end": { - "line": 21, + "line": 18, "column": 1 } } @@ -185,7 +196,17 @@ "augments": [], "errors": [], "examples": [], - "params": [], + "params": [ + { + "title": "param", + "name": "str", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], "properties": [], "returns": [], "sees": [], @@ -197,136 +218,6 @@ "global": [], "inner": [], "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Creates a new instance", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "str" - } - ], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 13, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 20, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "str", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "constructor", - "kind": "function", - "memberof": "Bar", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Bar", - "kind": "class" - }, - { - "name": "constructor", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Bar#constructor" - }, { "description": { "type": "root", @@ -393,22 +284,22 @@ ], "loc": { "start": { - "line": 15, + "line": 12, "column": 4 }, "end": { - "line": 18, - "column": 11 + "line": 15, + "column": 7 } }, "context": { "loc": { "start": { - "line": 19, + "line": 16, "column": 4 }, "end": { - "line": 19, + "line": 16, "column": 18 } } @@ -455,5 +346,135 @@ } ], "namespace": "Bar" + }, + { + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This class has fully inferred constructor parameters.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 54, + "offset": 53 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 54, + "offset": 53 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 54, + "offset": 53 + } + } + }, + "tags": [], + "loc": { + "start": { + "line": 20, + "column": 0 + }, + "end": { + "line": 22, + "column": 3 + } + }, + "context": { + "loc": { + "start": { + "line": 23, + "column": 0 + }, + "end": { + "line": 25, + "column": 1 + } + } + }, + "augments": [], + "errors": [], + "examples": [], + "params": [ + { + "title": "param", + "name": "n", + "lineNumber": 24, + "type": { + "type": "NameExpression", + "name": "number" + } + }, + { + "title": "param", + "name": "l", + "lineNumber": 24, + "type": { + "type": "TypeApplication", + "expression": { + "type": "NameExpression", + "name": "Array" + }, + "applications": [ + { + "type": "NameExpression", + "name": "string" + } + ] + } + } + ], + "properties": [], + "returns": [], + "sees": [], + "throws": [], + "todos": [], + "name": "Baz", + "kind": "class", + "members": { + "global": [], + "inner": [], + "instance": [], + "events": [], + "static": [] + }, + "path": [ + { + "name": "Baz", + "kind": "class" + } + ], + "namespace": "Baz" } ] \ No newline at end of file diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md index e19e05243..2d128e772 100644 --- a/test/fixture/es6-class.output.md +++ b/test/fixture/es6-class.output.md @@ -4,8 +4,8 @@ - [Foo](#foo) - [Bar](#bar) - - [constructor](#constructor) - [bar](#bar-1) +- [Baz](#baz) ## Foo @@ -17,10 +17,6 @@ This is my component. This is from issue #458 Does nothing. This is from issue #556 -### constructor - -Creates a new instance - **Parameters** - `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** @@ -28,3 +24,12 @@ Creates a new instance ### bar A useless property + +## Baz + +This class has fully inferred constructor parameters. + +**Parameters** + +- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** +- `l` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json index be9e2c03f..7b9f040a4 100644 --- a/test/fixture/es6-class.output.md.json +++ b/test/fixture/es6-class.output.md.json @@ -113,51 +113,6 @@ "indent": [] } }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Creates a new instance", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, { "type": "strong", "children": [ @@ -255,6 +210,161 @@ }, "indent": [] } + }, + { + "depth": 2, + "type": "heading", + "children": [ + { + "type": "text", + "value": "Baz" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This class has fully inferred constructor parameters.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 54, + "offset": 53 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 54, + "offset": 53 + }, + "indent": [] + } + }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "n" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "children": [ + { + "type": "text", + "value": "number" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + }, + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "l" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "children": [ + { + "type": "text", + "value": "Array" + } + ] + }, + { + "type": "text", + "value": "<" + }, + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + }, + { + "type": "text", + "value": ">" + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] } ] } \ No newline at end of file diff --git a/test/fixture/es6.input.js b/test/fixture/es6.input.js index 8381a946f..ea5f1a6ed 100644 --- a/test/fixture/es6.input.js +++ b/test/fixture/es6.input.js @@ -22,8 +22,15 @@ var multiply = (a, b) => a * b; /** * This is a sink + * @param {number} height the height of the thing + * @param {number} width the width of the thing */ class Sink { + constructor(height, width) { + this.height = height; + this.width = width; + } + /** * This is a property of the sink. */ @@ -50,15 +57,6 @@ class Sink { get aGetter() { return 42; } - - /** - * @param {number} height the height of the thing - * @param {number} width the width of the thing - */ - constructor(height, width) { - this.height = height; - this.width = width; - } } /** diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md index 4a058bf09..7f7abc73f 100644 --- a/test/fixture/es6.output-toc.md +++ b/test/fixture/es6.output-toc.md @@ -44,6 +44,11 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer This is a sink +**Parameters** + +- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing +- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing + ### staticProp This is a property of the sink. @@ -57,13 +62,6 @@ Is it empty This is a getter method: it should be documented as a property. -### constructor - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - ### hello This method says hello diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index c9c1e99d6..52d58f881 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -606,25 +606,46 @@ } } }, - "tags": [], + "tags": [ + { + "title": "param", + "description": "the height of the thing", + "lineNumber": 2, + "type": { + "type": "NameExpression", + "name": "number" + }, + "name": "height" + }, + { + "title": "param", + "description": "the width of the thing", + "lineNumber": 3, + "type": { + "type": "NameExpression", + "name": "number" + }, + "name": "width" + } + ], "loc": { "start": { "line": 23, "column": 0 }, "end": { - "line": 25, + "line": 27, "column": 3 } }, "context": { "loc": { "start": { - "line": 26, + "line": 28, "column": 0 }, "end": { - "line": 62, + "line": 60, "column": 1 } } @@ -632,7 +653,130 @@ "augments": [], "errors": [], "examples": [], - "params": [], + "params": [ + { + "title": "param", + "name": "height", + "lineNumber": 2, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the height of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 24, + "offset": 23 + } + } + }, + "type": { + "type": "NameExpression", + "name": "number" + } + }, + { + "title": "param", + "name": "width", + "lineNumber": 3, + "description": { + "type": "root", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "the width of the thing", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 23, + "offset": 22 + } + } + }, + "type": { + "type": "NameExpression", + "name": "number" + } + } + ], "properties": [], "returns": [], "sees": [], @@ -700,22 +844,22 @@ "tags": [], "loc": { "start": { - "line": 27, + "line": 34, "column": 2 }, "end": { - "line": 29, + "line": 36, "column": 5 } }, "context": { "loc": { "start": { - "line": 30, + "line": 37, "column": 2 }, "end": { - "line": 30, + "line": 37, "column": 18 } } @@ -809,22 +953,22 @@ "tags": [], "loc": { "start": { - "line": 32, + "line": 39, "column": 2 }, "end": { - "line": 34, + "line": 41, "column": 5 } }, "context": { "loc": { "start": { - "line": 35, + "line": 42, "column": 2 }, "end": { - "line": 37, + "line": 44, "column": 3 } } @@ -922,22 +1066,22 @@ "tags": [], "loc": { "start": { - "line": 46, + "line": 53, "column": 2 }, "end": { - "line": 49, + "line": 56, "column": 5 } }, "context": { "loc": { "start": { - "line": 50, + "line": 57, "column": 2 }, "end": { - "line": 52, + "line": 59, "column": 3 } } @@ -974,208 +1118,6 @@ } ], "namespace": "Sink#aGetter" - }, - { - "description": "", - "tags": [ - { - "title": "param", - "description": "the height of the thing", - "lineNumber": 1, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "height" - }, - { - "title": "param", - "description": "the width of the thing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "width" - } - ], - "loc": { - "start": { - "line": 54, - "column": 2 - }, - "end": { - "line": 57, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 61, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "height", - "lineNumber": 1, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "width", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "constructor", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "constructor", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#constructor" } ], "events": [], @@ -1236,22 +1178,22 @@ "tags": [], "loc": { "start": { - "line": 39, + "line": 46, "column": 2 }, "end": { - "line": 41, + "line": 48, "column": 5 } }, "context": { "loc": { "start": { - "line": 42, + "line": 49, "column": 2 }, "end": { - "line": 44, + "line": 51, "column": 3 } } @@ -1365,22 +1307,22 @@ ], "loc": { "start": { - "line": 64, + "line": 62, "column": 0 }, "end": { - "line": 68, + "line": 66, "column": 3 } }, "context": { "loc": { "start": { - "line": 69, + "line": 67, "column": 0 }, "end": { - "line": 69, + "line": 67, "column": 25 } } @@ -1625,22 +1567,22 @@ ], "loc": { "start": { - "line": 71, + "line": 69, "column": 0 }, "end": { - "line": 76, + "line": 74, "column": 3 } }, "context": { "loc": { "start": { - "line": 77, + "line": 75, "column": 0 }, "end": { - "line": 77, + "line": 75, "column": 23 } } @@ -1787,22 +1729,22 @@ "tags": [], "loc": { "start": { - "line": 79, + "line": 77, "column": 0 }, "end": { - "line": 81, + "line": 79, "column": 3 } }, "context": { "loc": { "start": { - "line": 82, + "line": 80, "column": 0 }, "end": { - "line": 82, + "line": 80, "column": 43 } } @@ -1814,7 +1756,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 82, + "lineNumber": 80, "type": { "type": "RestType" } @@ -1898,22 +1840,22 @@ "tags": [], "loc": { "start": { - "line": 84, + "line": 82, "column": 0 }, "end": { - "line": 86, + "line": 84, "column": 3 } }, "context": { "loc": { "start": { - "line": 87, + "line": 85, "column": 0 }, "end": { - "line": 94, + "line": 92, "column": 1 } } @@ -1925,7 +1867,7 @@ { "title": "param", "name": "someParams", - "lineNumber": 87, + "lineNumber": 85, "type": { "type": "RestType", "expression": { @@ -2013,22 +1955,22 @@ "tags": [], "loc": { "start": { - "line": 98, + "line": 96, "column": 0 }, "end": { - "line": 100, + "line": 98, "column": 3 } }, "context": { "loc": { "start": { - "line": 101, + "line": 99, "column": 0 }, "end": { - "line": 101, + "line": 99, "column": 23 } } @@ -2125,22 +2067,22 @@ ], "loc": { "start": { - "line": 105, + "line": 103, "column": 0 }, "end": { - "line": 108, + "line": 106, "column": 3 } }, "context": { "loc": { "start": { - "line": 109, + "line": 107, "column": 0 }, "end": { - "line": 109, + "line": 107, "column": 36 } } @@ -2287,22 +2229,22 @@ "tags": [], "loc": { "start": { - "line": 111, + "line": 109, "column": 0 }, "end": { - "line": 113, + "line": 111, "column": 3 } }, "context": { "loc": { "start": { - "line": 114, + "line": 112, "column": 0 }, "end": { - "line": 116, + "line": 114, "column": 1 } } @@ -2314,7 +2256,7 @@ { "title": "param", "name": "foo", - "lineNumber": 114, + "lineNumber": 112, "default": "'bar'", "type": { "type": "OptionalType" @@ -2405,22 +2347,22 @@ ], "loc": { "start": { - "line": 126, + "line": 124, "column": 0 }, "end": { - "line": 129, + "line": 127, "column": 3 } }, "context": { "loc": { "start": { - "line": 130, + "line": 128, "column": 0 }, "end": { - "line": 130, + "line": 128, "column": 26 } } @@ -2514,22 +2456,22 @@ ], "loc": { "start": { - "line": 132, + "line": 130, "column": 0 }, "end": { - "line": 135, + "line": 133, "column": 3 } }, "context": { "loc": { "start": { - "line": 136, + "line": 134, "column": 0 }, "end": { - "line": 136, + "line": 134, "column": 23 } } @@ -2617,22 +2559,22 @@ "tags": [], "loc": { "start": { - "line": 144, + "line": 142, "column": 0 }, "end": { - "line": 146, + "line": 144, "column": 3 } }, "context": { "loc": { "start": { - "line": 147, + "line": 145, "column": 0 }, "end": { - "line": 147, + "line": 145, "column": 42 } } @@ -2717,22 +2659,22 @@ "tags": [], "loc": { "start": { - "line": 149, + "line": 147, "column": 0 }, "end": { - "line": 149, + "line": 147, "column": 32 } }, "context": { "loc": { "start": { - "line": 150, + "line": 148, "column": 0 }, "end": { - "line": 156, + "line": 154, "column": 1 } } @@ -2744,7 +2686,7 @@ { "title": "param", "name": "array1", - "lineNumber": 151, + "lineNumber": 149, "type": { "type": "TypeApplication", "expression": { @@ -2762,7 +2704,7 @@ { "title": "param", "name": "array2", - "lineNumber": 152, + "lineNumber": 150, "type": { "type": "TypeApplication", "expression": { @@ -2780,7 +2722,7 @@ { "title": "param", "name": "compareFunction", - "lineNumber": 153, + "lineNumber": 151, "type": { "type": "OptionalType", "expression": { @@ -2898,22 +2840,22 @@ "tags": [], "loc": { "start": { - "line": 158, + "line": 156, "column": 0 }, "end": { - "line": 158, + "line": 156, "column": 32 } }, "context": { "loc": { "start": { - "line": 159, + "line": 157, "column": 0 }, "end": { - "line": 161, + "line": 159, "column": 1 } } @@ -2925,7 +2867,7 @@ { "title": "param", "name": "a", - "lineNumber": 159, + "lineNumber": 157, "type": { "type": "NameExpression", "name": "atype.property" diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 8cd7b6b91..09b3af17c 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -9,7 +9,6 @@ - [staticProp](#staticprop) - [empty](#empty) - [aGetter](#agetter) - - [constructor](#constructor) - [hello](#hello) - [makeABasket](#makeabasket) - [makeASink](#makeasink) @@ -68,6 +67,11 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer This is a sink +**Parameters** + +- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing +- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing + ### staticProp This is a property of the sink. @@ -81,13 +85,6 @@ Is it empty This is a getter method: it should be documented as a property. -### constructor - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - ### hello This method says hello diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index 4cfaddb81..a90a28b30 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -740,155 +740,6 @@ "indent": [] } }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticProp" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "empty" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "aGetter" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "constructor" - } - ] - }, { "type": "strong", "children": [ @@ -1050,6 +901,145 @@ } ] }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "staticProp" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a property of the sink.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 32, + "offset": 31 + }, + "indent": [] + } + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "empty" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "Is it empty", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 1, + "column": 12, + "offset": 11 + }, + "indent": [] + } + }, + { + "depth": 3, + "type": "heading", + "children": [ + { + "type": "text", + "value": "aGetter" + } + ] + }, + { + "type": "paragraph", + "children": [ + { + "type": "text", + "value": "This is a getter method: it should be documented\nas a property.", + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + } + ], + "position": { + "start": { + "line": 1, + "column": 1, + "offset": 0 + }, + "end": { + "line": 2, + "column": 15, + "offset": 63 + }, + "indent": [ + 1 + ] + } + }, { "depth": 3, "type": "heading", From 96a6d139c887032e3af34493d727815ad5b527f9 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 24 Apr 2017 19:11:23 -0400 Subject: [PATCH 041/555] fix(document-exported): Ensure that document-exported does not document constructors separately --- lib/extractors/exported.js | 6 +- test/fixture/document-exported.input.js | 1 + test/fixture/document-exported.output.json | 210 +++++++++--------- test/fixture/document-exported.output.md | 4 + test/fixture/document-exported.output.md.json | 53 +++++ 5 files changed, 173 insertions(+), 101 deletions(-) diff --git a/lib/extractors/exported.js b/lib/extractors/exported.js index c400e49e4..8e00ae917 100644 --- a/lib/extractors/exported.js +++ b/lib/extractors/exported.js @@ -165,7 +165,11 @@ function traverseExportedSubtree(path, data, addComments, overrideName) { path.skip(); }, Method(path) { - addComments(data, path); + // Don't explicitly document constructor methods: their + // parameters are output as part of the class itself. + if (path.node.kind !== 'constructor') { + addComments(data, path); + } path.skip(); } }); diff --git a/test/fixture/document-exported.input.js b/test/fixture/document-exported.input.js index 4d4ab6ea0..3c2c1e0dc 100644 --- a/test/fixture/document-exported.input.js +++ b/test/fixture/document-exported.input.js @@ -1,6 +1,7 @@ // Options: {"documentExported": true} export class Class { + constructor(a: string) {} classMethod() {} get classGetter() {} set classSetter(v) {} diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json index bbe960428..a5fbd453b 100644 --- a/test/fixture/document-exported.output.json +++ b/test/fixture/document-exported.output.json @@ -175,7 +175,7 @@ "column": 0 }, "end": { - "line": 10, + "line": 11, "column": 1 } }, @@ -186,7 +186,7 @@ "column": 0 }, "end": { - "line": 10, + "line": 11, "column": 1 } } @@ -194,7 +194,17 @@ "augments": [], "errors": [], "examples": [], - "params": [], + "params": [ + { + "title": "param", + "name": "a", + "lineNumber": 4, + "type": { + "type": "NameExpression", + "name": "string" + } + } + ], "properties": [], "returns": [], "sees": [], @@ -211,22 +221,22 @@ "tags": [], "loc": { "start": { - "line": 4, + "line": 5, "column": 2 }, "end": { - "line": 4, + "line": 5, "column": 18 } }, "context": { "loc": { "start": { - "line": 4, + "line": 5, "column": 2 }, "end": { - "line": 4, + "line": 5, "column": 18 } } @@ -269,22 +279,22 @@ "tags": [], "loc": { "start": { - "line": 5, + "line": 6, "column": 2 }, "end": { - "line": 5, + "line": 6, "column": 22 } }, "context": { "loc": { "start": { - "line": 5, + "line": 6, "column": 2 }, "end": { - "line": 5, + "line": 6, "column": 22 } } @@ -327,22 +337,22 @@ "tags": [], "loc": { "start": { - "line": 6, + "line": 7, "column": 2 }, "end": { - "line": 6, + "line": 7, "column": 23 } }, "context": { "loc": { "start": { - "line": 6, + "line": 7, "column": 2 }, "end": { - "line": 6, + "line": 7, "column": 23 } } @@ -354,7 +364,7 @@ { "title": "param", "name": "v", - "lineNumber": 6 + "lineNumber": 7 } ], "properties": [], @@ -394,22 +404,22 @@ "tags": [], "loc": { "start": { - "line": 7, + "line": 8, "column": 2 }, "end": { - "line": 7, + "line": 8, "column": 26 } }, "context": { "loc": { "start": { - "line": 7, + "line": 8, "column": 2 }, "end": { - "line": 7, + "line": 8, "column": 26 } } @@ -452,22 +462,22 @@ "tags": [], "loc": { "start": { - "line": 8, + "line": 9, "column": 2 }, "end": { - "line": 8, + "line": 9, "column": 30 } }, "context": { "loc": { "start": { - "line": 8, + "line": 9, "column": 2 }, "end": { - "line": 8, + "line": 9, "column": 30 } } @@ -510,22 +520,22 @@ "tags": [], "loc": { "start": { - "line": 9, + "line": 10, "column": 2 }, "end": { - "line": 9, + "line": 10, "column": 31 } }, "context": { "loc": { "start": { - "line": 9, + "line": 10, "column": 2 }, "end": { - "line": 9, + "line": 10, "column": 31 } } @@ -537,7 +547,7 @@ { "title": "param", "name": "v", - "lineNumber": 9 + "lineNumber": 10 } ], "properties": [], @@ -807,22 +817,22 @@ "tags": [], "loc": { "start": { - "line": 12, + "line": 13, "column": 0 }, "end": { - "line": 18, + "line": 19, "column": 2 } }, "context": { "loc": { "start": { - "line": 12, + "line": 13, "column": 0 }, "end": { - "line": 18, + "line": 19, "column": 2 } } @@ -848,22 +858,22 @@ "tags": [], "loc": { "start": { - "line": 13, + "line": 14, "column": 2 }, "end": { - "line": 13, + "line": 14, "column": 13 } }, "context": { "loc": { "start": { - "line": 13, + "line": 14, "column": 2 }, "end": { - "line": 13, + "line": 14, "column": 13 } } @@ -905,22 +915,22 @@ "tags": [], "loc": { "start": { - "line": 14, + "line": 15, "column": 2 }, "end": { - "line": 14, + "line": 15, "column": 17 } }, "context": { "loc": { "start": { - "line": 14, + "line": 15, "column": 2 }, "end": { - "line": 14, + "line": 15, "column": 17 } } @@ -962,22 +972,22 @@ "tags": [], "loc": { "start": { - "line": 15, + "line": 16, "column": 2 }, "end": { - "line": 15, + "line": 16, "column": 18 } }, "context": { "loc": { "start": { - "line": 15, + "line": 16, "column": 2 }, "end": { - "line": 15, + "line": 16, "column": 18 } } @@ -989,7 +999,7 @@ { "title": "param", "name": "v", - "lineNumber": 15 + "lineNumber": 16 } ], "properties": [], @@ -1025,22 +1035,22 @@ "tags": [], "loc": { "start": { - "line": 16, + "line": 17, "column": 2 }, "end": { - "line": 16, + "line": 17, "column": 10 } }, "context": { "loc": { "start": { - "line": 16, + "line": 17, "column": 2 }, "end": { - "line": 16, + "line": 17, "column": 10 } } @@ -1080,22 +1090,22 @@ "tags": [], "loc": { "start": { - "line": 17, + "line": 18, "column": 2 }, "end": { - "line": 17, + "line": 18, "column": 21 } }, "context": { "loc": { "start": { - "line": 17, + "line": 18, "column": 2 }, "end": { - "line": 17, + "line": 18, "column": 21 } } @@ -1146,22 +1156,22 @@ "tags": [], "loc": { "start": { - "line": 54, + "line": 55, "column": 0 }, "end": { - "line": 54, + "line": 55, "column": 16 } }, "context": { "loc": { "start": { - "line": 54, + "line": 55, "column": 0 }, "end": { - "line": 54, + "line": 55, "column": 16 } } @@ -1197,22 +1207,22 @@ "tags": [], "loc": { "start": { - "line": 55, + "line": 56, "column": 0 }, "end": { - "line": 55, + "line": 56, "column": 16 } }, "context": { "loc": { "start": { - "line": 55, + "line": 56, "column": 0 }, "end": { - "line": 55, + "line": 56, "column": 16 } } @@ -1248,22 +1258,22 @@ "tags": [], "loc": { "start": { - "line": 59, + "line": 60, "column": 0 }, "end": { - "line": 59, + "line": 60, "column": 23 } }, "context": { "loc": { "start": { - "line": 59, + "line": 60, "column": 0 }, "end": { - "line": 59, + "line": 60, "column": 23 } } @@ -1303,22 +1313,22 @@ "tags": [], "loc": { "start": { - "line": 60, + "line": 61, "column": 0 }, "end": { - "line": 60, + "line": 61, "column": 17 } }, "context": { "loc": { "start": { - "line": 60, + "line": 61, "column": 0 }, "end": { - "line": 60, + "line": 61, "column": 17 } } @@ -1358,22 +1368,22 @@ "tags": [], "loc": { "start": { - "line": 61, + "line": 62, "column": 0 }, "end": { - "line": 61, + "line": 62, "column": 17 } }, "context": { "loc": { "start": { - "line": 61, + "line": 62, "column": 0 }, "end": { - "line": 61, + "line": 62, "column": 17 } } @@ -1413,22 +1423,22 @@ "tags": [], "loc": { "start": { - "line": 67, + "line": 68, "column": 0 }, "end": { - "line": 67, + "line": 68, "column": 34 } }, "context": { "loc": { "start": { - "line": 67, + "line": 68, "column": 0 }, "end": { - "line": 67, + "line": 68, "column": 34 } } @@ -1440,7 +1450,7 @@ { "title": "param", "name": "x", - "lineNumber": 67, + "lineNumber": 68, "type": { "type": "NameExpression", "name": "X" @@ -1474,22 +1484,22 @@ "tags": [], "loc": { "start": { - "line": 71, + "line": 72, "column": 0 }, "end": { - "line": 73, + "line": 74, "column": 2 } }, "context": { "loc": { "start": { - "line": 71, + "line": 72, "column": 0 }, "end": { - "line": 73, + "line": 74, "column": 2 } } @@ -1515,22 +1525,22 @@ "tags": [], "loc": { "start": { - "line": 72, + "line": 73, "column": 2 }, "end": { - "line": 72, + "line": 73, "column": 10 } }, "context": { "loc": { "start": { - "line": 72, + "line": 73, "column": 2 }, "end": { - "line": 72, + "line": 73, "column": 10 } } @@ -1632,22 +1642,22 @@ "tags": [], "loc": { "start": { - "line": 75, + "line": 76, "column": 0 }, "end": { - "line": 75, + "line": 76, "column": 17 } }, "context": { "loc": { "start": { - "line": 76, + "line": 77, "column": 0 }, "end": { - "line": 79, + "line": 80, "column": 4 } } @@ -1659,7 +1669,7 @@ { "title": "param", "name": "y", - "lineNumber": 76, + "lineNumber": 77, "type": { "type": "NameExpression", "name": "Y" @@ -1693,22 +1703,22 @@ "tags": [], "loc": { "start": { - "line": 77, + "line": 78, "column": 2 }, "end": { - "line": 79, + "line": 80, "column": 3 } }, "context": { "loc": { "start": { - "line": 77, + "line": 78, "column": 2 }, "end": { - "line": 79, + "line": 80, "column": 3 } } @@ -1734,22 +1744,22 @@ "tags": [], "loc": { "start": { - "line": 78, + "line": 79, "column": 4 }, "end": { - "line": 78, + "line": 79, "column": 12 } }, "context": { "loc": { "start": { - "line": 78, + "line": 79, "column": 4 }, "end": { - "line": 78, + "line": 79, "column": 12 } } diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md index 67a06f971..a75a60be3 100644 --- a/test/fixture/document-exported.output.md +++ b/test/fixture/document-exported.output.md @@ -45,6 +45,10 @@ ## Class +**Parameters** + +- `a` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** + ### classMethod ### classGetter diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json index c694294c2..f2c9224c7 100644 --- a/test/fixture/document-exported.output.md.json +++ b/test/fixture/document-exported.output.md.json @@ -82,6 +82,59 @@ } ] }, + { + "type": "strong", + "children": [ + { + "type": "text", + "value": "Parameters" + } + ] + }, + { + "ordered": false, + "type": "list", + "children": [ + { + "type": "listItem", + "children": [ + { + "type": "paragraph", + "children": [ + { + "type": "inlineCode", + "value": "a" + }, + { + "type": "text", + "value": " " + }, + { + "type": "strong", + "children": [ + { + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "children": [ + { + "type": "text", + "value": "string" + } + ] + } + ] + }, + { + "type": "text", + "value": " " + } + ] + } + ] + } + ] + }, { "depth": 3, "type": "heading", From a2f13d67bd0877a937e95634800d718184f294f7 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 24 Apr 2017 19:17:28 -0400 Subject: [PATCH 042/555] refactor: Remove orphaned should_skip_inference Fixes #752 --- lib/infer/should_skip_inference.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 lib/infer/should_skip_inference.js diff --git a/lib/infer/should_skip_inference.js b/lib/infer/should_skip_inference.js deleted file mode 100644 index 2dc8485dc..000000000 --- a/lib/infer/should_skip_inference.js +++ /dev/null @@ -1,12 +0,0 @@ -/* @flow */ -'use strict'; - -/** - * Decide whether a comment should go through the AST inference - * stage based on whether it has an explicit `@name` tag. - */ -function shouldSkipInference(comment /*: Comment */) /*: boolean */ { - return comment.tags.some(tag => tag.title === 'name'); -} - -module.exports = shouldSkipInference; From 2c19809f073fcf22178c77348a0a1abe35fc3ad4 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Tue, 25 Apr 2017 11:02:18 -0400 Subject: [PATCH 043/555] docs(lends): Document the usage of the lends tag This tag is useful for documenting class factories in libraries and frameworks Refs #412 --- docs/RECIPES.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/RECIPES.md b/docs/RECIPES.md index c747a7749..644bdbbc2 100644 --- a/docs/RECIPES.md +++ b/docs/RECIPES.md @@ -37,6 +37,44 @@ class Table { } ``` +## Class factories: using `@lends` + +Many libraries and frameworks have special 'class constructor methods' that +accept an object as an input and return a class with that object's properties +as prototype properties. For instance, Dojo has `define`, React has `React.createClass`, +Ext has `Ext.define`. + +documentation.js can't assume that a method receiving an object will return a class, +since many methods don't. Luckily, you can indicate this to the tool with the `@lends` +tag. + +For instance in a Dojo-style instantiation: + +```js +/** + * This is the documentation for the created class, a SelectionEngine + */ +const SelectionEngine = declare( + null, + /** @lends SelectionEngine */ { + /** + * This method will be parsed as SelectionEngine.expandColsTo + * because the object that contains it has a @lends tag indicating + * that it will be lended to the SelectionEngine prototype. + */ + expandColsTo: function(foo, bar, baz) {} + } +); +``` + +The mechanics are: + +* If you're creating a kind of class with a helper function +* And you provide an object of properties that will be mixed in to the class + as one of the arguments to that function +* Add a tag like `/** @lends ClassName */` before that object, and the properties + in the object will be correctly assigned to the class's prototype. + ## Destructuring Parameters In ES6, you can use [destructuring assignment in functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment): From 3cc4426bdee815dc1757865d5bc37f858a85984b Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 24 Apr 2017 21:22:18 -0400 Subject: [PATCH 044/555] fix(params): Parameters with default use = not ? Fixes #737 --- lib/infer/params.js | 11 +--- lib/parse.js | 3 + test/fixture/es6.output-toc.md | 10 ++-- test/fixture/es6.output.json | 65 ++++++++------------- test/fixture/es6.output.md | 10 ++-- test/fixture/es6.output.md.json | 47 --------------- test/fixture/html/nested.config-output.html | 6 +- test/fixture/html/nested.output.files | 6 +- test/fixture/nest_params.output.json | 7 +-- test/fixture/nest_params.output.md | 2 +- test/fixture/nest_params.output.md.json | 4 -- test/fixture/params.output.json | 35 ++++------- test/fixture/params.output.md | 10 ++-- test/fixture/params.output.md.json | 20 ------- test/lib/infer/params.js | 12 +--- 15 files changed, 67 insertions(+), 181 deletions(-) diff --git a/lib/infer/params.js b/lib/infer/params.js index dd92bad1b..9a9a2b492 100644 --- a/lib/infer/params.js +++ b/lib/infer/params.js @@ -105,10 +105,7 @@ function paramToDoc( default: generate(param.right, { compact: true }).code, - type: { - type: 'OptionalType', - expression: newAssignmentParam.type - } + type: newAssignmentParam.type }); // ObjectPattern case 'ObjectPattern': // { a } @@ -311,11 +308,7 @@ function combineTags(inferredTag, explicitTag) { var defaultValue; if (!explicitTag.type) { type = inferredTag.type; - } else if (explicitTag.type.type !== 'OptionalType' && inferredTag.default) { - type = { - type: 'OptionalType', - expression: explicitTag.type - }; + } else if (!explicitTag.default && inferredTag.default) { defaultValue = inferredTag.default; } diff --git a/lib/parse.js b/lib/parse.js index 653a0a9a8..60203fca6 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -252,6 +252,9 @@ var flatteners = { if (tag.default) { param.default = tag.default; + if (param.type && param.type.type === 'OptionalType') { + param.type = param.type.expression; + } } result.params.push(param); diff --git a/test/fixture/es6.output-toc.md b/test/fixture/es6.output-toc.md index 7f7abc73f..3a8dc9a99 100644 --- a/test/fixture/es6.output-toc.md +++ b/test/fixture/es6.output-toc.md @@ -7,9 +7,9 @@ have any parameter descriptions. **Parameters** -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) - - `$0.phoneNumbers` **any?** (optional, default `[]`) - - `$0.emailAddresses` **any?** (optional, default `[]`) +- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) + - `$0.phoneNumbers` (optional, default `[]`) + - `$0.emailAddresses` (optional, default `[]`) - `$0.params` **...any** ## destructure @@ -111,7 +111,7 @@ This tests our support of optional parameters in ES6 **Parameters** -- `foo` **any?** (optional, default `'bar'`) +- `foo` (optional, default `'bar'`) ## iAmProtected @@ -133,7 +133,7 @@ Regression check for #498 - `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** - `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) +- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json index 52d58f881..d90207223 100644 --- a/test/fixture/es6.output.json +++ b/test/fixture/es6.output.json @@ -88,30 +88,21 @@ "name": "$0", "anonymous": true, "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } + "type": "NameExpression", + "name": "Object" }, "properties": [ { "title": "param", "name": "$0.phoneNumbers", "lineNumber": 6, - "default": "[]", - "type": { - "type": "OptionalType" - } + "default": "[]" }, { "title": "param", "name": "$0.emailAddresses", "lineNumber": 6, - "default": "[]", - "type": { - "type": "OptionalType" - } + "default": "[]" }, { "title": "param", @@ -2257,10 +2248,7 @@ "title": "param", "name": "foo", "lineNumber": 112, - "default": "'bar'", - "type": { - "type": "OptionalType" - } + "default": "'bar'" } ], "properties": [], @@ -2724,31 +2712,28 @@ "name": "compareFunction", "lineNumber": 151, "type": { - "type": "OptionalType", - "expression": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - }, - { - "type": "ParameterType", - "name": "b", - "expression": { - "type": "NameExpression", - "name": "T" - } + "type": "FunctionType", + "params": [ + { + "type": "ParameterType", + "name": "a", + "expression": { + "type": "NameExpression", + "name": "T" + } + }, + { + "type": "ParameterType", + "name": "b", + "expression": { + "type": "NameExpression", + "name": "T" } - ], - "result": { - "type": "NameExpression", - "name": "boolean" } + ], + "result": { + "type": "NameExpression", + "name": "boolean" } }, "default": "(a:T,b:T):boolean=>a===b" diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md index 09b3af17c..f43d25dd4 100644 --- a/test/fixture/es6.output.md +++ b/test/fixture/es6.output.md @@ -30,9 +30,9 @@ have any parameter descriptions. **Parameters** -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** (optional, default `{}`) - - `$0.phoneNumbers` **any?** (optional, default `[]`) - - `$0.emailAddresses` **any?** (optional, default `[]`) +- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) + - `$0.phoneNumbers` (optional, default `[]`) + - `$0.emailAddresses` (optional, default `[]`) - `$0.params` **...any** ## destructure @@ -134,7 +134,7 @@ This tests our support of optional parameters in ES6 **Parameters** -- `foo` **any?** (optional, default `'bar'`) +- `foo` (optional, default `'bar'`) ## iAmProtected @@ -156,7 +156,7 @@ Regression check for #498 - `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** - `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** (optional, default `(a:T,b:T):boolean=>a===b`) +- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `(a:T,b:T):boolean=>a===b`) Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json index a90a28b30..da94047e3 100644 --- a/test/fixture/es6.output.md.json +++ b/test/fixture/es6.output.md.json @@ -94,10 +94,6 @@ "value": "Object" } ] - }, - { - "type": "text", - "value": "?" } ] }, @@ -142,19 +138,6 @@ "type": "text", "value": " " }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "any" - }, - { - "type": "text", - "value": "?" - } - ] - }, { "type": "text", "value": " " @@ -194,19 +177,6 @@ "type": "text", "value": " " }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "any" - }, - { - "type": "text", - "value": "?" - } - ] - }, { "type": "text", "value": " " @@ -1807,19 +1777,6 @@ "type": "text", "value": " " }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "any" - }, - { - "type": "text", - "value": "?" - } - ] - }, { "type": "text", "value": " " @@ -2199,10 +2156,6 @@ "value": "boolean" } ] - }, - { - "type": "text", - "value": "?" } ] }, diff --git a/test/fixture/html/nested.config-output.html b/test/fixture/html/nested.config-output.html index cce7ee832..e08471d15 100644 --- a/test/fixture/html/nested.config-output.html +++ b/test/fixture/html/nested.config-output.html @@ -457,7 +457,7 @@

    - isBuffer(buf, size = 0) + isBuffer(buf, size)

+ + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
options.foo string +
options.bar number +
+ + + +
+
+ otherOptions (number?) + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Events
+
+ +
+
+
+ + event +
+
+
+
+ + + +

Klass event

+ + +
event
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + + +
+ + +
+ +

+ CustomError +

+ + +
+ + +

a typedef with nested properties

+ + +
CustomError(other: any, also: any)
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (any) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+ + + +
Properties
+
+ +
+ error (object) + : An error + + +
    + +
  • error.code string + +

    The error's code

    +
  • + +
  • error.description string + +

    The error's description

    +
  • + +
+ +
+ +
+ + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass

+ + +
bar(): Klass
+ + + + + + + + + + + + + + + + +
Returns
+ Klass: + that class + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Rest property function

+ + +
bar(toys: ...Number): undefined
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ toys (...Number) + +
+ +
+ +
+ + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass. This needs a number input.

+ + +
bar(): undefined
+ + + + + + + + + + + + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ Foo +

+ + +
+ + +

This is Foo

+ + +
new Foo()
+ + + + + + + + + + + + + + + + + + + + + + + +
Instance Members
+
+ +
+
+
+ + bar +
+
+
+
+ + + +

This is bar

+ + +
bar
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + + + +
+ + +
+ +

+ customStreams +

+ + +
+ + +

I am the container of stream types

+ + +
customStreams
+ + + + + + + + + + + + + + + + + + + + + +
Static Members
+
+ +
+
+
+ + new passthrough() +
+
+
+
+ + + +

I am a passthrough stream that belongs to customStreams

+ + +
new passthrough()
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + + + + + + + + + +" +`; + +exports[`accepts config file 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 11, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Bananas are yellow", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bananas", + "namespace": "bananas", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "bananas", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 20, + }, + "start": Object { + "column": 0, + "line": 18, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Carrots are awesome", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 17, + }, + "start": Object { + "column": 0, + "line": 15, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "carrots", + "namespace": "carrots", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "carrots", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Apples are red", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "apples", + "namespace": "apples", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "apples", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`build --document-exported 1`] = ` +" + +### Table of Contents + +- [z](#z) + - [zMethod](#zmethod) +- [x](#x) +- [Class](#class) + - [classMethod](#classmethod) + - [classGetter](#classgetter) + - [classSetter](#classsetter) + - [staticMethod](#staticmethod) + - [staticGetter](#staticgetter) + - [staticSetter](#staticsetter) +- [T5](#t5) +- [y2Default](#y2default) +- [y4](#y4) +- [object](#object) + - [method](#method) + - [getter](#getter) + - [setter](#setter) + - [prop](#prop) + - [func](#func) +- [f1](#f1) +- [f3](#f3) +- [T](#t) +- [T2](#t2) +- [T4](#t4) +- [f4](#f4) +- [o1](#o1) + - [om1](#om1) +- [f5](#f5) +- [o2](#o2) + - [om2](#om2) + +## z + +### zMethod + +## x + +**Parameters** + +- \`yparam\` + +## Class + +**Parameters** + +- \`a\` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** + +### classMethod + +### classGetter + +### classSetter + +**Parameters** + +- \`v\` + +### staticMethod + +### staticGetter + +### staticSetter + +**Parameters** + +- \`v\` + +## T5 + +Type: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) + +## y2Default + +## y4 + +Description of y3 + +**Parameters** + +- \`p\` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** + +Returns **void** + +## object + +### method + +### getter + +### setter + +**Parameters** + +- \`v\` + +### prop + +### func + +## f1 + +## f3 + +## T + +Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + +## T2 + +Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## T4 + +Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## f4 + +**Parameters** + +- \`x\` **X** + +## o1 + +### om1 + +## f5 + +f5 comment + +**Parameters** + +- \`y\` **Y** + +## o2 + +### om2 +" +`; + +exports[`lint command generates lint output 1`] = `""`; + +exports[`polyglot mode 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 3, + "line": 40, + }, + "start": Object { + "column": 1, + "line": 35, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method moves a hex to a color", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 40, + }, + "start": Object { + "column": 1, + "line": 35, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "hexToUInt32Color", + "namespace": "hexToUInt32Color", + "params": Array [ + Object { + "lineNumber": 3, + "name": "hex", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "name": "hexToUInt32Color", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "color", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "hexToUInt32Color", + "title": "name", + }, + Object { + "description": null, + "lineNumber": 3, + "name": "hex", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "color", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap new file mode 100644 index 000000000..e32dfb8c0 --- /dev/null +++ b/__tests__/__snapshots__/test.js.snap @@ -0,0 +1,1176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`config 1`] = ` +" + +## MyClass + +This is my class, a demo thing. + +**Properties** + +- \`howMany\` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains + +### getFoo + +Get the number 42 + +**Parameters** + +- \`getIt\` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two + +### getUndefined + +Get undefined + +Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. + +## Hello + +World + +" +`; + +exports[`external modules option 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 1, + "line": 12, + }, + "start": Position { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 9, + }, + "start": Position { + "column": 0, + "line": 7, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 10, + }, + "start": Position { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 6, + }, + "start": Position { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "main", + "namespace": "main", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "main", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "index", + "namespace": "index", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "index", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "return", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`git option 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "github": "[github]", + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`git option 2`] = ` +" + +## simple.input + +[undefined:5-8](<> \\"Source code on GitHub\\") + +This function returns the number one. + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone +" +`; + +exports[`highlightAuto md output 1`] = ` +" + +## multilanguage.input + +**Extends Foo, Bar** + +This function returns the number one. + +**Examples** + +\`\`\`js +var myFoo = new Foo('[data-foo]'); +myFoo.foo(42); +\`\`\` + +\`\`\`html +

Data-Foo Element in the dom

+\`\`\` + +\`\`\`css +[data-foo] { + background-color: red; +} +\`\`\` + +- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if you give it something +- Throws **[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** if you give it something else + +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone +" +`; + +exports[`multi-file input 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 1, + "line": 13, + }, + "start": Position { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number plus two.", + }, + ], + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "description": "var result = returnTwo(4); +// result is 6", + }, + ], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 9, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "returnTwo", + "namespace": "returnTwo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the number", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "returnTwo", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numbertwo", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the number", + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "numbertwo", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "var result = returnTwo(4); +// result is 6", + "lineNumber": 5, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; diff --git a/__tests__/bin-readme.js b/__tests__/bin-readme.js new file mode 100644 index 000000000..052f4e393 --- /dev/null +++ b/__tests__/bin-readme.js @@ -0,0 +1,125 @@ +var path = require('path'), + os = require('os'), + exec = require('child_process').exec, + tmp = require('tmp'), + fs = require('fs-extra'); + +function documentation(args, options, parseJSON) { + return new Promise((resolve, reject) => { + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + + args.unshift( + 'node ' + path.join(__dirname, '..', 'bin', 'documentation.js') + ); + + exec(args.join(' '), options, (err, res) => { + resolve(res); + }); + }); +} + +describe('readme command', function() { + var fixtures = path.join(__dirname, 'fixture/readme'); + var sourceFile = path.join(fixtures, 'index.js'); + var d; + var removeCallback; + + beforeEach(() => { + var dirEntry = tmp.dirSync({ unsafeCleanup: true }); + d = dirEntry.name; + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'README.md') + ); + fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js')); + }); + + // run tests after setting up temp dir + + test('--diff-only: changes needed', async function() { + var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); + try { + await documentation(['readme index.js --diff-only -s API'], { + cwd: d + }); + } catch (err) { + var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); + expect(err).toBeTruthy(); + expect(err.code).not.toBe(0); + expect(after).toEqual(before); + } + }); + + test('updates README.md', async function() { + await documentation(['readme index.js -s API'], { cwd: d }); + var outputPath = path.join(d, 'README.md'); + expect(fs.readFileSync(outputPath, 'utf-8')).toMatchSnapshot(); + }); + + test('--readme-file', async function() { + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'other.md') + ); + await documentation(['readme index.js -s API --readme-file other.md'], { + cwd: d + }); + var actual = fs.readFileSync(path.join(d, 'other.md'), 'utf8'); + expect(actual).toMatchSnapshot(); + }); + + test('--diff-only: changes NOT needed', function() { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + return documentation( + ['readme index.js --diff-only -s API --readme-file uptodate.md'], + { cwd: d } + ).then(stdout => { + // t.match(stdout, 'is up to date.'); + }); + }); + + test('-s: not found', async function() { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + try { + await documentation( + ['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], + { cwd: d } + ); + } catch (err) { + expect(err).toBeTruthy(); + } + }); + + test('requires -s option', async function() { + try { + await documentation(['readme index.js'], { cwd: d }); + } catch (err) { + expect(err).toBeTruthy(); + expect(err.code !== 0).toBeTruthy(); + expect(err.stderr.match(/Missing required argument/)).toBeTruthy(); + } + }); + + var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input'); + test('errors on invalid syntax', async function() { + try { + await documentation( + ['readme ' + badFixturePath + ' -s API --parseExtension input'], + { cwd: d } + ); + } catch (err) { + expect(err).toBeTruthy(); + expect(err.code !== 0).toBeTruthy(); + } + }); +}); diff --git a/__tests__/bin-watch-serve.js b/__tests__/bin-watch-serve.js new file mode 100644 index 000000000..33c2e401f --- /dev/null +++ b/__tests__/bin-watch-serve.js @@ -0,0 +1,161 @@ +var path = require('path'); +var os = require('os'); +var get = require('./utils').get; +var spawn = require('child_process').spawn; +var fs = require('fs'); +var pEvent = require('p-event'); + +function documentation(args, options) { + if (!options) { + options = {}; + } + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); + + return spawn('node', args, options); +} + +function normalize(result) { + result.forEach(function(item) { + item.context.file = '[path]'; + }); + return result; +} + +const timeout = 20000; + +test('harness', function() { + var docProcess = documentation(['serve', 'fixture/simple.input.js']); + expect(docProcess).toBeTruthy(); + docProcess.kill(); +}); + +test( + 'provides index.html', + function() { + var docProcess = documentation(['serve', 'fixture/simple.input.js']); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(//)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); + +test( + 'accepts port argument', + function() { + var docProcess = documentation([ + 'serve', + 'fixture/simple.input.js', + '--port=4004' + ]); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(//)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); + +test( + '--watch', + function(done) { + var tmpFile = path.join(os.tmpdir(), '/simple.js'); + fs.writeFileSync(tmpFile, '/** a function */function apples() {}'); + var docProcess = documentation(['serve', tmpFile, '--watch']); + pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/apples/)).toBeTruthy(); + fs.writeFileSync(tmpFile, '/** a function */function bananas() {}'); + function doGet() { + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + if (text.match(/bananas/)) { + docProcess.kill(); + done(); + } else { + setTimeout(doGet, 100); + } + }); + } + doGet(); + }); + }); + }, + timeout +); + +test( + '--watch', + function(done) { + var tmpDir = os.tmpdir(); + var a = path.join(tmpDir, '/simple.js'); + var b = path.join(tmpDir, '/required.js'); + fs.writeFileSync(a, 'require("./required")'); + fs.writeFileSync(b, '/** soup */function soup() {}'); + var docProcess = documentation(['serve', a, '--watch']); + docProcess.stdout.once('data', function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/soup/)).toBeTruthy(); + fs.writeFileSync(b, '/** nuts */function nuts() {}'); + function doGet() { + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + if (text.match(/nuts/)) { + docProcess.kill(); + done(); + } else { + setTimeout(doGet, 100); + } + }); + } + doGet(); + }); + }); + }, + timeout +); + +test( + 'error page', + function() { + var tmpDir = os.tmpdir(); + var a = path.join(tmpDir, '/simple.js'); + fs.writeFileSync(a, '**'); + var docProcess = documentation(['serve', a, '--watch']); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/Unexpected token/)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); diff --git a/__tests__/bin.js b/__tests__/bin.js new file mode 100644 index 000000000..dcb43e8c6 --- /dev/null +++ b/__tests__/bin.js @@ -0,0 +1,407 @@ +/* global jasmine */ + +var path = require('path'), + os = require('os'), + exec = require('child_process').exec, + tmp = require('tmp'), + fs = require('fs-extra'); + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + +function documentation(args, options, parseJSON) { + if (!options) { + options = {}; + } + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + + args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); + + return new Promise((resolve, reject) => { + exec(args.join(' '), options, function(err, stdout, stderr) { + if (err) { + err.stderr = stderr; + return reject(err); + } + if (parseJSON === false) { + resolve(stdout); + } else { + try { + resolve(JSON.parse(stdout)); + } catch (e) { + reject(e); + } + } + }); + }); +} + +function normalize(result) { + result.forEach(function(item) { + item.context.file = '[path]'; + }); + return result; +} + +test('documentation binary', async function() { + const data = await documentation(['build fixture/simple.input.js'], {}); + expect(data.length).toBe(1); +}); + +test('defaults to parsing package.json main', async function() { + const data = await documentation(['build'], { + cwd: path.join(__dirname, '..') + }); + expect(data.length).toBeTruthy(); +}); + +test('polyglot mode', async function() { + const data = await documentation([ + 'build fixture/polyglot/blend.cpp --polyglot' + ]); + expect(normalize(data)).toMatchSnapshot(); +}); + +test('accepts config file', async function() { + const data = await documentation([ + 'build fixture/sorting/input.js -c fixture/config.json' + ]); + expect(normalize(data)).toMatchSnapshot(); +}); + +test('accepts config file - reports failures', async function() { + try { + await documentation( + ['build fixture/sorting/input.js -c fixture/config-bad.yml'], + {}, + false + ); + } catch (stderr) { + expect(stderr).toMatchSnapshot(); + } +}); + +test('accepts config file - reports parse failures', async function() { + try { + await documentation( + ['build fixture/sorting/input.js -c fixture/config-malformed.json'], + {}, + false + ); + } catch (stderr) { + expect(stderr.stderr.match(/SyntaxError/g)).toBeTruthy(); + } +}); + +test('--shallow option', async function() { + const data = await documentation([ + 'build --shallow fixture/internal.input.js' + ]); + expect(data.length).toBe(0); +}); + +test('external modules option', async function() { + const data = await documentation([ + 'build fixture/external.input.js ' + + '--external=external --external=external/node_modules' + ]); + expect(data.length).toBe(2); +}); + +test('when a file is specified both in a glob and explicitly, it is only documented once', async function() { + const data = await documentation([ + 'build fixture/simple.input.js fixture/simple.input.*' + ]); + expect(data.length).toBe(1); +}); + +test('extension option', async function() { + const data = await documentation([ + 'build fixture/extension/index.otherextension ' + + '--requireExtension=otherextension --parseExtension=otherextension' + ]); + expect(data.length).toBe(1); +}); + +/* + * This tests that parseExtension adds extensions to smartGlob's + * look through directories. + */ +test('polyglot + parseExtension + smartGlob', async function() { + const data = await documentation([ + 'build fixture/polyglot ' + '--polyglot --parseExtension=cpp' + ]); + expect(data.length).toBe(1); +}); + +test('extension option', function() { + return documentation(['build fixture/extension.jsx']); +}); + +test('invalid arguments', function() { + test('bad -f option', async function() { + try { + await documentation( + ['build -f DOES-NOT-EXIST fixture/internal.input.js'], + {}, + false + ); + } catch (err) { + expect(err).toBeTruthy(); + } + }); + + test('html with no destination', function() { + return documentation(['build -f html fixture/internal.input.js'], function( + err + ) { + expect( + err + .toString() + .match( + /The HTML output mode requires a destination directory set with -o/ + ) + ).toBeTruthy(); + }); + }); + + test('bad command', async function() { + try { + await documentation(['-f html fixture/internal.input.js'], {}, false); + } catch (err) { + expect(err.code).toBeTruthy(); + } + }); +}); + +test('--config', async function() { + var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dst); + var outputIndex = path.join(dst, 'index.html'); + var expectedOutputPath = path.join( + __dirname, + 'fixture/html/nested.config-output.html' + ); + const data = await documentation( + [ + 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + + dst + ], + {}, + false + ); + var output = fs.readFileSync(outputIndex, 'utf8'); + expect(output).toMatchSnapshot(); +}); + +test('--version', async function() { + const output = await documentation(['--version'], {}, false); + expect(output).toBeTruthy(); +}); + +describe('lint command', function() { + test('generates lint output', async function() { + try { + await documentation(['lint fixture/lint/lint.input.js'], {}, false); + } catch (err) { + var data = err.stderr.toString().split('\n').slice(2).join('\n'); + expect(data).toMatchSnapshot(); + } + }); + + test('generates no output on a good file', async function() { + const data = await documentation( + ['lint fixture/simple.input.js'], + {}, + false + ); + expect(data).toBe(''); + }); + + test('exposes syntax error on a bad file', async function() { + try { + await documentation( + ['lint fixture/bad/syntax.input', '--parseExtension input'], + {}, + false + ); + } catch (err) { + expect(err.code > 0).toBeTruthy(); + } + }); + + test('lint with no inputs', async function() { + try { + await documentation( + ['lint'], + { + cwd: path.join(__dirname, 'fixture/bad') + }, + false + ); + } catch (err) { + expect(err.code > 0).toBeTruthy(); + } + }); +}); + +test('given no files', async function() { + try { + await documentation(['build']); + } catch (err) { + expect( + err + .toString() + .match( + /documentation was given no files and was not run in a module directory/ + ) + ).toBeTruthy(); + } +}); + +test('with an invalid command', async function() { + try { + await documentation(['invalid'], {}, false); + } catch (err) { + expect(err).toBeTruthy(); + } +}); + +test('--access flag', async function() { + const data = await documentation( + ['build --shallow fixture/internal.input.js -a public'], + {}, + false + ); + expect(data).toBe('[]'); +}); + +test('--private flag', async function() { + const data = await documentation( + ['build fixture/internal.input.js --private'], + {}, + false + ); + expect(data.length > 2).toBeTruthy(); +}); + +test('--infer-private flag', async function() { + const data = await documentation( + ['build fixture/infer-private.input.js --infer-private ^_'], + {}, + false + ); + // This uses JSON.parse with a reviver used as a visitor. + JSON.parse(data, function(n, v) { + // Make sure we do not see any names that match `^_`. + if (n === 'name') { + expect(typeof v).toBe('string'); + expect(!/_$/.test(v)).toBeTruthy(); + } + return v; + }); +}); + +test('write to file', async function() { + var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + + const data = await documentation( + ['build --shallow fixture/internal.input.js -o ' + dst], + {}, + false + ); + expect(data).toBe(''); + expect(fs.existsSync(dst)).toBeTruthy(); +}); + +test('write to html', async function() { + var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dstDir); + + const data = await documentation( + ['build --shallow fixture/internal.input.js -f html -o ' + dstDir], + {}, + false + ); + expect(data).toBe(''); + expect(fs.existsSync(path.join(dstDir, 'index.html'))).toBeTruthy(); +}); + +test('write to html with custom theme', async function() { + var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dstDir); + + const data = await documentation( + [ + 'build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + + dstDir + ], + {}, + false + ); + expect(data).toBe(''); + expect(fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8')).toBeTruthy(); +}); + +test('write to html, highlightAuto', function() { + var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js', + config = 'fixture/auto_lang_hljs/config.yml', + dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + + fs.mkdirSync(dstDir); + + return documentation( + ['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], + {}, + false + ).then(() => { + var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'); + expect( + result.indexOf('42') > 0 + ).toBeTruthy(); + expect( + result.indexOf('[data-foo]') > 0 + ).toBeTruthy(); + expect( + result.indexOf('data-foo') > 0 + ).toBeTruthy(); + }); +}); + +test('fatal error', async function() { + try { + await documentation( + ['build --shallow fixture/bad/syntax.input --parseExtension input'], + {}, + false + ); + } catch (err) { + expect(err.toString().match(/Unexpected token/)).toBeTruthy(); + } +}); + +test('build --document-exported', async function() { + const data = await documentation( + ['build fixture/document-exported.input.js --document-exported -f md'], + {}, + false + ); + expect(data).toMatchSnapshot(); +}); + +test('build large file without error (no deoptimized styling error)', function() { + var dstFile = + path.join(os.tmpdir(), (Date.now() + Math.random()).toString()) + '.js'; + var contents = ''; + for (var i = 0; i < 4e4; i++) { + contents += '/* - */\n'; + } + fs.writeFileSync(dstFile, contents, 'utf8'); + + return documentation(['build ' + dstFile], {}, false).then(() => { + fs.unlinkSync(dstFile); + }); +}); diff --git a/test/config_fixture/config b/__tests__/config_fixture/config similarity index 100% rename from test/config_fixture/config rename to __tests__/config_fixture/config diff --git a/test/config_fixture/config.json b/__tests__/config_fixture/config.json similarity index 100% rename from test/config_fixture/config.json rename to __tests__/config_fixture/config.json diff --git a/test/config_fixture/config.yaml b/__tests__/config_fixture/config.yaml similarity index 100% rename from test/config_fixture/config.yaml rename to __tests__/config_fixture/config.yaml diff --git a/test/config_fixture/config.yml b/__tests__/config_fixture/config.yml similarity index 100% rename from test/config_fixture/config.yml rename to __tests__/config_fixture/config.yml diff --git a/test/config_fixture/config_comments.json b/__tests__/config_fixture/config_comments.json similarity index 100% rename from test/config_fixture/config_comments.json rename to __tests__/config_fixture/config_comments.json diff --git a/test/config_fixture/config_file.yml b/__tests__/config_fixture/config_file.yml similarity index 100% rename from test/config_fixture/config_file.yml rename to __tests__/config_fixture/config_file.yml diff --git a/test/config_fixture/config_links.yml b/__tests__/config_fixture/config_links.yml similarity index 100% rename from test/config_fixture/config_links.yml rename to __tests__/config_fixture/config_links.yml diff --git a/test/fixture/_external-deps-included.json b/__tests__/fixture/_external-deps-included.json similarity index 100% rename from test/fixture/_external-deps-included.json rename to __tests__/fixture/_external-deps-included.json diff --git a/test/fixture/_multi-file-input.json b/__tests__/fixture/_multi-file-input.json similarity index 100% rename from test/fixture/_multi-file-input.json rename to __tests__/fixture/_multi-file-input.json diff --git a/test/fixture/auto_lang_hljs/config.yml b/__tests__/fixture/auto_lang_hljs/config.yml similarity index 100% rename from test/fixture/auto_lang_hljs/config.yml rename to __tests__/fixture/auto_lang_hljs/config.yml diff --git a/test/fixture/auto_lang_hljs/multilanguage.input.js b/__tests__/fixture/auto_lang_hljs/multilanguage.input.js similarity index 100% rename from test/fixture/auto_lang_hljs/multilanguage.input.js rename to __tests__/fixture/auto_lang_hljs/multilanguage.input.js diff --git a/test/fixture/auto_lang_hljs/multilanguage.output.md b/__tests__/fixture/auto_lang_hljs/multilanguage.output.md similarity index 100% rename from test/fixture/auto_lang_hljs/multilanguage.output.md rename to __tests__/fixture/auto_lang_hljs/multilanguage.output.md diff --git a/test/fixture/bad/syntax.input b/__tests__/fixture/bad/syntax.input similarity index 100% rename from test/fixture/bad/syntax.input rename to __tests__/fixture/bad/syntax.input diff --git a/test/fixture/bad/syntax.output.json b/__tests__/fixture/bad/syntax.output.json similarity index 100% rename from test/fixture/bad/syntax.output.json rename to __tests__/fixture/bad/syntax.output.json diff --git a/test/fixture/boolean-literal-type.input.js b/__tests__/fixture/boolean-literal-type.input.js similarity index 100% rename from test/fixture/boolean-literal-type.input.js rename to __tests__/fixture/boolean-literal-type.input.js diff --git a/test/fixture/class.input.js b/__tests__/fixture/class.input.js similarity index 100% rename from test/fixture/class.input.js rename to __tests__/fixture/class.input.js diff --git a/test/fixture/config-bad.yml b/__tests__/fixture/config-bad.yml similarity index 100% rename from test/fixture/config-bad.yml rename to __tests__/fixture/config-bad.yml diff --git a/test/fixture/config-malformed.json b/__tests__/fixture/config-malformed.json similarity index 100% rename from test/fixture/config-malformed.json rename to __tests__/fixture/config-malformed.json diff --git a/test/fixture/config.json b/__tests__/fixture/config.json similarity index 100% rename from test/fixture/config.json rename to __tests__/fixture/config.json diff --git a/test/fixture/custom_theme/index.js b/__tests__/fixture/custom_theme/index.js similarity index 100% rename from test/fixture/custom_theme/index.js rename to __tests__/fixture/custom_theme/index.js diff --git a/test/fixture/default-export-function.input.js b/__tests__/fixture/default-export-function.input.js similarity index 100% rename from test/fixture/default-export-function.input.js rename to __tests__/fixture/default-export-function.input.js diff --git a/test/fixture/document-exported-bad/exports-z.js b/__tests__/fixture/document-exported-bad/exports-z.js similarity index 100% rename from test/fixture/document-exported-bad/exports-z.js rename to __tests__/fixture/document-exported-bad/exports-z.js diff --git a/test/fixture/document-exported-bad/x.js b/__tests__/fixture/document-exported-bad/x.js similarity index 100% rename from test/fixture/document-exported-bad/x.js rename to __tests__/fixture/document-exported-bad/x.js diff --git a/test/fixture/document-exported-export-default-object.input.js b/__tests__/fixture/document-exported-export-default-object.input.js similarity index 100% rename from test/fixture/document-exported-export-default-object.input.js rename to __tests__/fixture/document-exported-export-default-object.input.js diff --git a/test/fixture/document-exported-export-default-value.input.js b/__tests__/fixture/document-exported-export-default-value.input.js similarity index 100% rename from test/fixture/document-exported-export-default-value.input.js rename to __tests__/fixture/document-exported-export-default-value.input.js diff --git a/test/fixture/document-exported.input.js b/__tests__/fixture/document-exported.input.js similarity index 100% rename from test/fixture/document-exported.input.js rename to __tests__/fixture/document-exported.input.js diff --git a/test/fixture/document-exported/x.js b/__tests__/fixture/document-exported/x.js similarity index 100% rename from test/fixture/document-exported/x.js rename to __tests__/fixture/document-exported/x.js diff --git a/test/fixture/document-exported/y.js b/__tests__/fixture/document-exported/y.js similarity index 100% rename from test/fixture/document-exported/y.js rename to __tests__/fixture/document-exported/y.js diff --git a/test/fixture/document-exported/z.js b/__tests__/fixture/document-exported/z.js similarity index 100% rename from test/fixture/document-exported/z.js rename to __tests__/fixture/document-exported/z.js diff --git a/test/fixture/es6-class.input.js b/__tests__/fixture/es6-class.input.js similarity index 100% rename from test/fixture/es6-class.input.js rename to __tests__/fixture/es6-class.input.js diff --git a/test/fixture/es6-default2.input.js b/__tests__/fixture/es6-default2.input.js similarity index 100% rename from test/fixture/es6-default2.input.js rename to __tests__/fixture/es6-default2.input.js diff --git a/test/fixture/es6-ext.es6 b/__tests__/fixture/es6-ext.es6 similarity index 100% rename from test/fixture/es6-ext.es6 rename to __tests__/fixture/es6-ext.es6 diff --git a/test/fixture/es6-import.input.js b/__tests__/fixture/es6-import.input.js similarity index 100% rename from test/fixture/es6-import.input.js rename to __tests__/fixture/es6-import.input.js diff --git a/test/fixture/es6.input.js b/__tests__/fixture/es6.input.js similarity index 100% rename from test/fixture/es6.input.js rename to __tests__/fixture/es6.input.js diff --git a/test/fixture/es6.output-toc.md b/__tests__/fixture/es6.output-toc.md similarity index 100% rename from test/fixture/es6.output-toc.md rename to __tests__/fixture/es6.output-toc.md diff --git a/test/fixture/event.input.js b/__tests__/fixture/event.input.js similarity index 100% rename from test/fixture/event.input.js rename to __tests__/fixture/event.input.js diff --git a/test/fixture/example-caption.input.js b/__tests__/fixture/example-caption.input.js similarity index 100% rename from test/fixture/example-caption.input.js rename to __tests__/fixture/example-caption.input.js diff --git a/test/fixture/extension.jsx b/__tests__/fixture/extension.jsx similarity index 100% rename from test/fixture/extension.jsx rename to __tests__/fixture/extension.jsx diff --git a/test/fixture/extension/extension-required.jsx b/__tests__/fixture/extension/extension-required.jsx similarity index 100% rename from test/fixture/extension/extension-required.jsx rename to __tests__/fixture/extension/extension-required.jsx diff --git a/test/fixture/extension/index.otherextension b/__tests__/fixture/extension/index.otherextension similarity index 100% rename from test/fixture/extension/index.otherextension rename to __tests__/fixture/extension/index.otherextension diff --git a/test/fixture/external.input.js b/__tests__/fixture/external.input.js similarity index 93% rename from test/fixture/external.input.js rename to __tests__/fixture/external.input.js index d156ef676..aa034223a 100644 --- a/test/fixture/external.input.js +++ b/__tests__/fixture/external.input.js @@ -8,7 +8,6 @@ require('./polyglot/blend.cpp'); * I am in `external.input.js`. */ function foo() { - 'use strict'; return 'bar'; } diff --git a/test/fixture/factory.input.js b/__tests__/fixture/factory.input.js similarity index 100% rename from test/fixture/factory.input.js rename to __tests__/fixture/factory.input.js diff --git a/test/fixture/flow-unnamed-params.input.js b/__tests__/fixture/flow-unnamed-params.input.js similarity index 81% rename from test/fixture/flow-unnamed-params.input.js rename to __tests__/fixture/flow-unnamed-params.input.js index 62bdbbca2..113e2968e 100644 --- a/test/fixture/flow-unnamed-params.input.js +++ b/__tests__/fixture/flow-unnamed-params.input.js @@ -1,9 +1,7 @@ // @flow -'use strict'; - /** x */ -let x: (T) => string; +let x: T => string; /** x2 */ let x2: (a: T) => string; diff --git a/test/fixture/html/documentation.yml b/__tests__/fixture/html/documentation.yml similarity index 100% rename from test/fixture/html/documentation.yml rename to __tests__/fixture/html/documentation.yml diff --git a/test/fixture/html/nested.config-output.html b/__tests__/fixture/html/nested.config-output.html similarity index 100% rename from test/fixture/html/nested.config-output.html rename to __tests__/fixture/html/nested.config-output.html diff --git a/test/fixture/html/nested.input.js b/__tests__/fixture/html/nested.input.js similarity index 99% rename from test/fixture/html/nested.input.js rename to __tests__/fixture/html/nested.input.js index 1b2a61da8..47c443f52 100644 --- a/test/fixture/html/nested.input.js +++ b/__tests__/fixture/html/nested.input.js @@ -1,5 +1,3 @@ -'use strict'; - /** * Creates a new Klass * @extends Stream.Writable diff --git a/test/fixture/html/nested.output.files b/__tests__/fixture/html/nested.output.files similarity index 100% rename from test/fixture/html/nested.output.files rename to __tests__/fixture/html/nested.output.files diff --git a/test/fixture/html/nested.output.json b/__tests__/fixture/html/nested.output.json similarity index 100% rename from test/fixture/html/nested.output.json rename to __tests__/fixture/html/nested.output.json diff --git a/test/fixture/infer-private.input.js b/__tests__/fixture/infer-private.input.js similarity index 100% rename from test/fixture/infer-private.input.js rename to __tests__/fixture/infer-private.input.js diff --git a/test/fixture/inheritance.input.js b/__tests__/fixture/inheritance.input.js similarity index 100% rename from test/fixture/inheritance.input.js rename to __tests__/fixture/inheritance.input.js diff --git a/test/fixture/inline-link.input.js b/__tests__/fixture/inline-link.input.js similarity index 100% rename from test/fixture/inline-link.input.js rename to __tests__/fixture/inline-link.input.js diff --git a/test/fixture/interface.input.js b/__tests__/fixture/interface.input.js similarity index 100% rename from test/fixture/interface.input.js rename to __tests__/fixture/interface.input.js diff --git a/test/fixture/internal.input.js b/__tests__/fixture/internal.input.js similarity index 100% rename from test/fixture/internal.input.js rename to __tests__/fixture/internal.input.js diff --git a/test/fixture/lends.input.js b/__tests__/fixture/lends.input.js similarity index 100% rename from test/fixture/lends.input.js rename to __tests__/fixture/lends.input.js diff --git a/test/fixture/lint/lint.input.js b/__tests__/fixture/lint/lint.input.js similarity index 100% rename from test/fixture/lint/lint.input.js rename to __tests__/fixture/lint/lint.input.js diff --git a/test/fixture/lint/lint.output b/__tests__/fixture/lint/lint.output similarity index 100% rename from test/fixture/lint/lint.output rename to __tests__/fixture/lint/lint.output diff --git a/test/fixture/literal_types.input.js b/__tests__/fixture/literal_types.input.js similarity index 100% rename from test/fixture/literal_types.input.js rename to __tests__/fixture/literal_types.input.js diff --git a/test/fixture/memberedclass.input.js b/__tests__/fixture/memberedclass.input.js similarity index 100% rename from test/fixture/memberedclass.input.js rename to __tests__/fixture/memberedclass.input.js diff --git a/test/fixture/merge-infered-type.input.js b/__tests__/fixture/merge-infered-type.input.js similarity index 100% rename from test/fixture/merge-infered-type.input.js rename to __tests__/fixture/merge-infered-type.input.js diff --git a/test/fixture/meta.input.js b/__tests__/fixture/meta.input.js similarity index 100% rename from test/fixture/meta.input.js rename to __tests__/fixture/meta.input.js diff --git a/test/fixture/multisignature.input.js b/__tests__/fixture/multisignature.input.js similarity index 100% rename from test/fixture/multisignature.input.js rename to __tests__/fixture/multisignature.input.js diff --git a/test/fixture/nearby_params.input.js b/__tests__/fixture/nearby_params.input.js similarity index 100% rename from test/fixture/nearby_params.input.js rename to __tests__/fixture/nearby_params.input.js diff --git a/test/fixture/nest_params.input.js b/__tests__/fixture/nest_params.input.js similarity index 100% rename from test/fixture/nest_params.input.js rename to __tests__/fixture/nest_params.input.js diff --git a/test/fixture/newline-in-description.input.js b/__tests__/fixture/newline-in-description.input.js similarity index 100% rename from test/fixture/newline-in-description.input.js rename to __tests__/fixture/newline-in-description.input.js diff --git a/test/fixture/no-name.input.js b/__tests__/fixture/no-name.input.js similarity index 100% rename from test/fixture/no-name.input.js rename to __tests__/fixture/no-name.input.js diff --git a/test/fixture/node_modules/external/index.js b/__tests__/fixture/node_modules/external/index.js similarity index 100% rename from test/fixture/node_modules/external/index.js rename to __tests__/fixture/node_modules/external/index.js diff --git a/test/fixture/node_modules/external/lib/main.js b/__tests__/fixture/node_modules/external/lib/main.js similarity index 92% rename from test/fixture/node_modules/external/lib/main.js rename to __tests__/fixture/node_modules/external/lib/main.js index 1f609e296..707db5be6 100644 --- a/test/fixture/node_modules/external/lib/main.js +++ b/__tests__/fixture/node_modules/external/lib/main.js @@ -1,5 +1,3 @@ -'use strict'; - var otherDep = require('external2'); /** diff --git a/test/fixture/node_modules/external/node_modules/external2/index.js b/__tests__/fixture/node_modules/external/node_modules/external2/index.js similarity index 100% rename from test/fixture/node_modules/external/node_modules/external2/index.js rename to __tests__/fixture/node_modules/external/node_modules/external2/index.js diff --git a/test/fixture/node_modules/external/package.json b/__tests__/fixture/node_modules/external/package.json similarity index 100% rename from test/fixture/node_modules/external/package.json rename to __tests__/fixture/node_modules/external/package.json diff --git a/test/fixture/node_modules/external2/index.js b/__tests__/fixture/node_modules/external2/index.js similarity index 100% rename from test/fixture/node_modules/external2/index.js rename to __tests__/fixture/node_modules/external2/index.js diff --git a/test/fixture/optional-record-field-type.input.js b/__tests__/fixture/optional-record-field-type.input.js similarity index 100% rename from test/fixture/optional-record-field-type.input.js rename to __tests__/fixture/optional-record-field-type.input.js diff --git a/test/fixture/params.input.js b/__tests__/fixture/params.input.js similarity index 100% rename from test/fixture/params.input.js rename to __tests__/fixture/params.input.js diff --git a/test/fixture/polyglot/blend.cpp b/__tests__/fixture/polyglot/blend.cpp similarity index 100% rename from test/fixture/polyglot/blend.cpp rename to __tests__/fixture/polyglot/blend.cpp diff --git a/test/fixture/polyglot/blend.json b/__tests__/fixture/polyglot/blend.json similarity index 100% rename from test/fixture/polyglot/blend.json rename to __tests__/fixture/polyglot/blend.json diff --git a/test/fixture/react-jsx.input.js b/__tests__/fixture/react-jsx.input.js similarity index 100% rename from test/fixture/react-jsx.input.js rename to __tests__/fixture/react-jsx.input.js diff --git a/test/fixture/readme/README.input.md b/__tests__/fixture/readme/README.input.md similarity index 100% rename from test/fixture/readme/README.input.md rename to __tests__/fixture/readme/README.input.md diff --git a/test/fixture/readme/README.output.md b/__tests__/fixture/readme/README.output.md similarity index 100% rename from test/fixture/readme/README.output.md rename to __tests__/fixture/readme/README.output.md diff --git a/test/fixture/readme/index.js b/__tests__/fixture/readme/index.js similarity index 100% rename from test/fixture/readme/index.js rename to __tests__/fixture/readme/index.js diff --git a/test/fixture/require-json-no-extension.input.js b/__tests__/fixture/require-json-no-extension.input.js similarity index 100% rename from test/fixture/require-json-no-extension.input.js rename to __tests__/fixture/require-json-no-extension.input.js diff --git a/test/fixture/require-json.input.js b/__tests__/fixture/require-json.input.js similarity index 100% rename from test/fixture/require-json.input.js rename to __tests__/fixture/require-json.input.js diff --git a/test/fixture/require-json.json b/__tests__/fixture/require-json.json similarity index 100% rename from test/fixture/require-json.json rename to __tests__/fixture/require-json.json diff --git a/test/fixture/simple-hashbang.input.js b/__tests__/fixture/simple-hashbang.input.js similarity index 100% rename from test/fixture/simple-hashbang.input.js rename to __tests__/fixture/simple-hashbang.input.js diff --git a/test/fixture/simple-private.input.js b/__tests__/fixture/simple-private.input.js similarity index 100% rename from test/fixture/simple-private.input.js rename to __tests__/fixture/simple-private.input.js diff --git a/test/fixture/simple-singlestar.input.js b/__tests__/fixture/simple-singlestar.input.js similarity index 100% rename from test/fixture/simple-singlestar.input.js rename to __tests__/fixture/simple-singlestar.input.js diff --git a/test/fixture/simple-triplestar.input.js b/__tests__/fixture/simple-triplestar.input.js similarity index 100% rename from test/fixture/simple-triplestar.input.js rename to __tests__/fixture/simple-triplestar.input.js diff --git a/test/fixture/simple-two.input.js b/__tests__/fixture/simple-two.input.js similarity index 100% rename from test/fixture/simple-two.input.js rename to __tests__/fixture/simple-two.input.js diff --git a/test/fixture/simple.config.yml b/__tests__/fixture/simple.config.yml similarity index 100% rename from test/fixture/simple.config.yml rename to __tests__/fixture/simple.config.yml diff --git a/test/fixture/simple.input.js b/__tests__/fixture/simple.input.js similarity index 100% rename from test/fixture/simple.input.js rename to __tests__/fixture/simple.input.js diff --git a/test/fixture/snowflake.md b/__tests__/fixture/snowflake.md similarity index 100% rename from test/fixture/snowflake.md rename to __tests__/fixture/snowflake.md diff --git a/test/fixture/sort-order-alpha.input.js b/__tests__/fixture/sort-order-alpha.input.js similarity index 100% rename from test/fixture/sort-order-alpha.input.js rename to __tests__/fixture/sort-order-alpha.input.js diff --git a/test/fixture/sorting/input.js b/__tests__/fixture/sorting/input.js similarity index 100% rename from test/fixture/sorting/input.js rename to __tests__/fixture/sorting/input.js diff --git a/test/fixture/sorting/output-bad.txt b/__tests__/fixture/sorting/output-bad.txt similarity index 100% rename from test/fixture/sorting/output-bad.txt rename to __tests__/fixture/sorting/output-bad.txt diff --git a/test/fixture/sorting/output.json b/__tests__/fixture/sorting/output.json similarity index 100% rename from test/fixture/sorting/output.json rename to __tests__/fixture/sorting/output.json diff --git a/test/fixture/string-literal-key.input.js b/__tests__/fixture/string-literal-key.input.js similarity index 100% rename from test/fixture/string-literal-key.input.js rename to __tests__/fixture/string-literal-key.input.js diff --git a/test/fixture/system-import.input.js b/__tests__/fixture/system-import.input.js similarity index 100% rename from test/fixture/system-import.input.js rename to __tests__/fixture/system-import.input.js diff --git a/test/fixture/this-class.input.js b/__tests__/fixture/this-class.input.js similarity index 100% rename from test/fixture/this-class.input.js rename to __tests__/fixture/this-class.input.js diff --git a/test/fixture/type_application.input.js b/__tests__/fixture/type_application.input.js similarity index 100% rename from test/fixture/type_application.input.js rename to __tests__/fixture/type_application.input.js diff --git a/test/fixture/var-function-param-return.input.js b/__tests__/fixture/var-function-param-return.input.js similarity index 100% rename from test/fixture/var-function-param-return.input.js rename to __tests__/fixture/var-function-param-return.input.js diff --git a/test/format_type.js b/__tests__/format_type.js similarity index 86% rename from test/format_type.js rename to __tests__/format_type.js index 6bb3c7279..4971f41b4 100644 --- a/test/format_type.js +++ b/__tests__/format_type.js @@ -1,11 +1,9 @@ /*eslint max-len: 0 */ -'use strict'; -var _formatType = require('../lib/output/util/format_type'), - LinkerStack = require('../lib/output/util/linker_stack'), +var _formatType = require('../src/output/util/format_type'), + LinkerStack = require('../src/output/util/linker_stack'), remark = require('remark'), - parse = require('doctrine-temporary-fork').parse, - test = require('tap').test; + parse = require('doctrine-temporary-fork').parse; function stringify(children) { return remark().stringify({ @@ -14,7 +12,7 @@ function stringify(children) { }); } -test('formatType', function(t) { +test('formatType', function() { var linkerStack = new LinkerStack({}); var formatType = _formatType.bind(undefined, linkerStack.link); [ @@ -84,26 +82,24 @@ test('formatType', function(t) { '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)' ] ].forEach(function(example) { - t.deepEqual( + expect( stringify( formatType( parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type ) - ), - example[1], - example[0] - ); + ) + ).toEqual(example[1]); }); - t.deepEqual( + expect( stringify( formatType(parse('@param {number} [a=1]', { sloppy: true }).tags[0].type) - ), - '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?', - 'default' + ) + ).toEqual( + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?' ); - t.deepEqual( + expect( stringify( _formatType( function(str) { @@ -113,16 +109,12 @@ test('formatType', function(t) { sloppy: true }).tags[0].type ) - ), - '[Foo](FOO)', - 'with custom linker' - ); + ) + ).toEqual('[Foo](FOO)'); - t.deepEqual(stringify(formatType()), 'any', 'empty case'); + expect(stringify(formatType())).toEqual('any'); - t.throws(function() { + expect(function() { formatType({}); - }); - - t.end(); + }).toThrow(); }); diff --git a/__tests__/lib/__snapshots__/server.js.snap b/__tests__/lib/__snapshots__/server.js.snap new file mode 100644 index 000000000..102e52d2f --- /dev/null +++ b/__tests__/lib/__snapshots__/server.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`server 1`] = `"test = 123"`; + +exports[`server 2`] = `"var test = 123;"`; + +exports[`server 3`] = `""`; diff --git a/__tests__/lib/__snapshots__/sort.js.snap b/__tests__/lib/__snapshots__/sort.js.snap new file mode 100644 index 000000000..ff8f5c7cc --- /dev/null +++ b/__tests__/lib/__snapshots__/sort.js.snap @@ -0,0 +1,109 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`sort toc with files 1`] = ` +Array [ + Object { + "file": "test/fixture/snowflake.md", + "kind": "note", + "name": "snowflake", + }, + Object { + "context": Object { + "sortKey": "a", + }, + "name": "apples", + }, + Object { + "context": Object { + "sortKey": "b", + }, + "name": "carrot", + }, + Object { + "context": Object { + "sortKey": "c", + }, + "name": "bananas", + }, +] +`; + +exports[`sort toc with files absolute path 1`] = ` +Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + }, + "type": "text", + "value": "The Snowflake", + }, + ], + "depth": 1, + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "heading", + }, + ], + "position": Object { + "end": Object { + "column": 1, + "line": 2, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "kind": "note", + "name": "snowflake", + }, + Object { + "context": Object { + "sortKey": "a", + }, + "name": "apples", + }, + Object { + "context": Object { + "sortKey": "b", + }, + "name": "carrot", + }, + Object { + "context": Object { + "sortKey": "c", + }, + "name": "bananas", + }, +] +`; diff --git a/test/lib/filter_access.js b/__tests__/lib/filter_access.js similarity index 60% rename from test/lib/filter_access.js rename to __tests__/lib/filter_access.js index ccab5b99e..85ab0bea8 100644 --- a/test/lib/filter_access.js +++ b/__tests__/lib/filter_access.js @@ -1,10 +1,7 @@ -'use strict'; +var filterAccess = require('../../src/filter_access'); -var test = require('tap').test, - filterAccess = require('../../lib/filter_access'); - -test('filterAccess ignore', function(t) { - t.deepEqual( +test('filterAccess ignore', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -13,14 +10,12 @@ test('filterAccess ignore', function(t) { ignore: true } ] - ), - [] - ); - t.end(); + ) + ).toEqual([]); }); -test('filterAccess public, protected, undefined, no private', function(t) { - t.deepEqual( +test('filterAccess public, protected, undefined, no private', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -37,24 +32,22 @@ test('filterAccess public, protected, undefined, no private', function(t) { access: 'private' } ] - ), - [ - { - access: 'public' - }, - { - access: 'protected' - }, - { - foo: 2 - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'public' + }, + { + access: 'protected' + }, + { + foo: 2 + } + ]); }); -test('filterAccess explicit public', function(t) { - t.deepEqual( +test('filterAccess explicit public', function() { + expect( filterAccess( ['public'], [ @@ -63,18 +56,16 @@ test('filterAccess explicit public', function(t) { { foo: 2 }, { access: 'private' } ] - ), - [ - { - access: 'public' - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'public' + } + ]); }); -test('filterAccess override', function(t) { - t.deepEqual( +test('filterAccess override', function() { + expect( filterAccess( ['private'], [ @@ -82,18 +73,16 @@ test('filterAccess override', function(t) { access: 'private' } ] - ), - [ - { - access: 'private' - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'private' + } + ]); }); -test('filterAccess nesting', function(t) { - t.deepEqual( +test('filterAccess nesting', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -124,19 +113,17 @@ test('filterAccess nesting', function(t) { } } ] - ), - [ - { - access: 'public', - members: { - static: [ - { - access: 'public' - } - ] - } + ) + ).toEqual([ + { + access: 'public', + members: { + static: [ + { + access: 'public' + } + ] } - ] - ); - t.end(); + } + ]); }); diff --git a/__tests__/lib/flow_doctrine.js b/__tests__/lib/flow_doctrine.js new file mode 100644 index 000000000..00365694c --- /dev/null +++ b/__tests__/lib/flow_doctrine.js @@ -0,0 +1,305 @@ +var flowDoctrine = require('../../src/flow_doctrine.js'), + parse = require('../../src/parsers/javascript'), + FLOW_TYPES = require('babel-types').FLOW_TYPES; + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +test('flowDoctrine', function() { + var types = FLOW_TYPES.filter(function(type) { + return type.match(/\wTypeAnnotation$/); + }); + + function toDoctrineType(flowType) { + var annotation = toComment( + '/** add */function add(a: ' + flowType + ' ) { }' + ).context.ast.node.params[0].typeAnnotation.typeAnnotation; + if (types.indexOf(annotation.type) !== -1) { + types.splice(types.indexOf(annotation.type), 1); + } + return flowDoctrine(annotation); + } + + expect(toDoctrineType('number')).toEqual({ + type: 'NameExpression', + name: 'number' + }); + + expect(toDoctrineType('string')).toEqual({ + type: 'NameExpression', + name: 'string' + }); + + expect(toDoctrineType('any')).toEqual({ + type: 'AllLiteral' + }); + + expect(toDoctrineType('(y:Foo) => Bar')).toEqual({ + type: 'FunctionType', + params: [ + { + type: 'ParameterType', + name: 'y', + expression: { + type: 'NameExpression', + name: 'Foo' + } + } + ], + result: { + type: 'NameExpression', + name: 'Bar' + } + }); + + expect(toDoctrineType('?number')).toEqual({ + type: 'NullableType', + expression: { + type: 'NameExpression', + name: 'number' + } + }); + + expect(toDoctrineType('number | string')).toEqual({ + type: 'UnionType', + elements: [ + { + type: 'NameExpression', + name: 'number' + }, + { + type: 'NameExpression', + name: 'string' + } + ] + }); + + expect(toDoctrineType('Object')).toEqual({ + type: 'NameExpression', + name: 'Object' + }); + + expect(toDoctrineType('namedType.propertyOfType')).toEqual({ + type: 'NameExpression', + name: 'namedType.propertyOfType' + }); + + expect(toDoctrineType('Array')).toEqual({ + applications: [ + { + type: 'NameExpression', + name: 'namedType.propertyOfType' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }); + + expect(toDoctrineType('Array>')).toEqual({ + applications: [ + { + applications: [ + { + name: 'boolean', + type: 'NameExpression' + } + ], + expression: { + type: 'NameExpression', + name: 'namedType.propertyOfType' + }, + type: 'TypeApplication' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }); + + expect(toDoctrineType('{ a: foo.bar }')).toEqual({ + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ], + type: 'RecordType' + }); + + expect(toDoctrineType('{ a: { b: foo.bar } }')).toEqual({ + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + type: 'RecordType', + fields: [ + { + key: 'b', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ] + } + } + ], + type: 'RecordType' + }); + + expect(toDoctrineType('{ a: 1 }')).toEqual({ + type: 'RecordType', + fields: [ + { + type: 'FieldType', + key: 'a', + value: { + type: 'NumericLiteralType', + value: 1 + } + } + ] + }); + + expect(toDoctrineType('mixed')).toEqual({ + type: 'AllLiteral' + }); + + expect(toDoctrineType('Array')).toEqual({ + type: 'NameExpression', + name: 'Array' + }); + + expect(toDoctrineType('Array')).toEqual({ + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: 'Array' + }, + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('number[]')).toEqual({ + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: 'Array' + }, + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('[]')).toEqual({ + type: 'ArrayType', + elements: [] + }); + + expect(toDoctrineType('[number]')).toEqual({ + type: 'ArrayType', + elements: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('[string, boolean]')).toEqual({ + type: 'ArrayType', + elements: [ + { + type: 'NameExpression', + name: 'string' + }, + { + type: 'NameExpression', + name: 'boolean' + } + ] + }); + + expect(toDoctrineType('boolean')).toEqual({ + type: 'NameExpression', + name: 'boolean' + }); + + expect(toDoctrineType('any => any')).toEqual({ + type: 'FunctionType', + params: [ + { + expression: { type: 'AllLiteral' }, + name: '', + type: 'ParameterType' + } + ], + result: { type: 'AllLiteral' } + }); + + expect(toDoctrineType('undefined')).toEqual({ + type: 'NameExpression', + name: 'undefined' + }); + + expect(toDoctrineType('"value"')).toEqual({ + type: 'StringLiteralType', + value: 'value' + }); + + expect(toDoctrineType('1')).toEqual({ + type: 'NumericLiteralType', + value: 1 + }); + + expect(toDoctrineType('true')).toEqual({ + type: 'BooleanLiteralType', + value: true + }); + + expect(toDoctrineType('false')).toEqual({ + type: 'BooleanLiteralType', + value: false + }); + + expect(toDoctrineType('null')).toEqual({ + type: 'NullLiteral' + }); + + expect(toDoctrineType('void')).toEqual({ + type: 'VoidLiteral' + }); + + // TODO: remove all these types + expect(types).toEqual([ + 'IntersectionTypeAnnotation', + 'EmptyTypeAnnotation', + 'ThisTypeAnnotation', + 'TypeofTypeAnnotation' + ]); +}); diff --git a/__tests__/lib/git/find_git.js b/__tests__/lib/git/find_git.js new file mode 100644 index 000000000..aed510251 --- /dev/null +++ b/__tests__/lib/git/find_git.js @@ -0,0 +1,16 @@ +var mock = require('mock-fs'); +var mockRepo = require('../../utils').mockRepo; +var path = require('path'); +var findGit = require('../../../src/git/find_git'); + +test('findGit', function() { + mock(mockRepo.master); + + const root = path.parse(__dirname).root; + + expect( + findGit(root + path.join('my', 'repository', 'path', 'index.js')) + ).toBe(root + path.join('my', 'repository', 'path', '.git')); + + mock.restore(); +}); diff --git a/__tests__/lib/git/url_prefix.js b/__tests__/lib/git/url_prefix.js new file mode 100644 index 000000000..3c1ace557 --- /dev/null +++ b/__tests__/lib/git/url_prefix.js @@ -0,0 +1,32 @@ +var mock = require('mock-fs'); +var mockRepo = require('../../utils').mockRepo; +var getGithubURLPrefix = require('../../../src/git/url_prefix'); +var parsePackedRefs = getGithubURLPrefix.parsePackedRefs; + +test('getGithubURLPrefix', function() { + mock(mockRepo.master); + + expect(getGithubURLPrefix('/my/repository/path/')).toBe( + 'https://github.com/foo/bar/blob/this_is_the_sha/' + ); + + mock.restore(); + + mock(mockRepo.detached); + + expect(getGithubURLPrefix('/my/repository/path/')).toBe( + 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/' + ); + + mock.restore(); +}); + +test('parsePackedRefs', function() { + var input = + '# pack-refs with: peeled fully-peeled\n' + + '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' + + '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types'; + expect(parsePackedRefs(input, 'refs/heads/babel-6')).toBe( + '4acd658617928bd17ae7364ef2512630d97c007a' + ); +}); diff --git a/__tests__/lib/github.js b/__tests__/lib/github.js new file mode 100644 index 000000000..76e7d7a67 --- /dev/null +++ b/__tests__/lib/github.js @@ -0,0 +1,86 @@ +/* eslint no-unused-vars: 0 */ + +var mock = require('mock-fs'), + path = require('path'), + mockRepo = require('../utils').mockRepo, + parse = require('../../src/parsers/javascript'), + github = require('../../src/github'); + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ).map(github); +} + +const root = path.parse(__dirname).root; + +function evaluate(fn) { + return toComment( + fn, + root + path.join('my', 'repository', 'path', 'index.js') + ); +} + +test('github', function() { + mock(mockRepo.master); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toEqual({ + path: 'index.js', + url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }); + + mock.restore(); +}); + +test('malformed repository', function() { + mock(mockRepo.malformed); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toBe(undefined); + + mock.restore(); +}); + +test('enterprise repository', function() { + mock(mockRepo.enterprise); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toEqual({ + path: 'index.js', + url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }); + + mock.restore(); +}); diff --git a/test/lib/hierarchy.js b/__tests__/lib/hierarchy.js similarity index 58% rename from test/lib/hierarchy.js rename to __tests__/lib/hierarchy.js index 478ad03c1..a30e7e3f8 100644 --- a/test/lib/hierarchy.js +++ b/__tests__/lib/hierarchy.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - hierarchy = require('../../lib/hierarchy'); +var parse = require('../../src/parsers/javascript'), + hierarchy = require('../../src/hierarchy'); function toComments(fn, filename) { return parse( @@ -24,7 +21,7 @@ function map(arr, prop) { }); } -test('hierarchy', function(t) { +test('hierarchy', function() { var comments = evaluate(function() { /** * @name Class @@ -51,21 +48,25 @@ test('hierarchy', function(t) { */ }); - t.deepEqual(map(comments, 'name'), ['Class']); + expect(map(comments, 'name')).toEqual(['Class']); var classMembers = comments[0].members; - t.deepEqual(map(classMembers.static, 'name'), ['isClass', 'MAGIC_NUMBER']); - t.deepEqual(map(classMembers.instance, 'name'), ['getFoo']); - - t.deepEqual(map(classMembers.static[0].path, 'name'), ['Class', 'isClass']); - t.deepEqual(map(classMembers.instance[0].path, 'name'), ['Class', 'getFoo']); - t.deepEqual(map(classMembers.events[0].path, 'name'), ['Class', 'event']); + expect(map(classMembers.static, 'name')).toEqual(['isClass', 'MAGIC_NUMBER']); + expect(map(classMembers.instance, 'name')).toEqual(['getFoo']); - t.end(); + expect(map(classMembers.static[0].path, 'name')).toEqual([ + 'Class', + 'isClass' + ]); + expect(map(classMembers.instance[0].path, 'name')).toEqual([ + 'Class', + 'getFoo' + ]); + expect(map(classMembers.events[0].path, 'name')).toEqual(['Class', 'event']); }); -test('hierarchy - nesting', function(t) { +test('hierarchy - nesting', function() { var comments = evaluate(function() { /** * @name Parent @@ -85,28 +86,26 @@ test('hierarchy - nesting', function(t) { */ }); - t.deepEqual(map(comments, 'name'), ['Parent']); + expect(map(comments, 'name')).toEqual(['Parent']); var classMembers = comments[0].members; - t.deepEqual(map(classMembers.static, 'name'), ['enum']); + expect(map(classMembers.static, 'name')).toEqual(['enum']); var enumMembers = classMembers.static[0].members; - t.deepEqual(map(enumMembers.static, 'name'), ['Parent', 'Child']); - t.deepEqual(map(enumMembers.static[0].path, 'name'), [ + expect(map(enumMembers.static, 'name')).toEqual(['Parent', 'Child']); + expect(map(enumMembers.static[0].path, 'name')).toEqual([ 'Parent', 'enum', 'Parent' ]); - t.deepEqual(map(enumMembers.static[1].path, 'name'), [ + expect(map(enumMembers.static[1].path, 'name')).toEqual([ 'Parent', 'enum', 'Child' ]); - - t.end(); }); -test('hierarchy - multisignature', function(t) { +test('hierarchy - multisignature', function() { var comments = evaluate(function() { /** * @name Parent @@ -124,11 +123,10 @@ test('hierarchy - multisignature', function(t) { */ }); - t.deepEqual(map(comments[0].members.instance, 'name'), ['foo', 'foo']); - t.end(); + expect(map(comments[0].members.instance, 'name')).toEqual(['foo', 'foo']); }); -test('hierarchy - missing memberof', function(t) { +test('hierarchy - missing memberof', function() { var test = evaluate(function() { /** * @name test @@ -136,33 +134,27 @@ test('hierarchy - missing memberof', function(t) { */ })[0]; - t.deepEqual( - test.errors, - [ - { - message: '@memberof reference to DoesNotExist not found', - commentLineNumber: 2 - } - ], - 'correct error message' - ); - t.end(); + expect(test.errors).toEqual([ + { + message: '@memberof reference to DoesNotExist not found', + commentLineNumber: 2 + } + ]); }); -test('hierarchy - anonymous', function(t) { +test('hierarchy - anonymous', function() { var result = evaluate(function() { /** Test */ })[0]; - t.deepEqual(result.errors, [ + expect(result.errors).toEqual([ { message: 'could not determine @name for hierarchy' } ]); - t.end(); }); -test('hierarchy - object prototype member names', function(t) { +test('hierarchy - object prototype member names', function() { var comments = evaluate(function() { /** * @name should @@ -187,10 +179,8 @@ test('hierarchy - object prototype member names', function(t) { **/ }); - t.deepEqual(map(comments[0].members.static[0].members.instance, 'name'), [ + expect(map(comments[0].members.static[0].members.instance, 'name')).toEqual([ 'hasOwnProperty', 'otherMethod' ]); - - t.end(); }); diff --git a/__tests__/lib/infer/__snapshots__/params.js.snap b/__tests__/lib/infer/__snapshots__/params.js.snap new file mode 100644 index 000000000..4dd7dcd46 --- /dev/null +++ b/__tests__/lib/infer/__snapshots__/params.js.snap @@ -0,0 +1,223 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`inferParams 1`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 1, + "name": "$0.x", + "title": "param", + }, + Object { + "lineNumber": 1, + "name": "$0.xs", + "title": "param", + "type": Object { + "type": "RestType", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 2`] = ` +Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "renamed destructuring param", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "a", + "properties": Array [ + Object { + "lineNumber": 6, + "name": "a.x", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 3`] = ` +Array [ + Object { + "default": "4", + "lineNumber": 3, + "name": "x", + "title": "param", + "type": undefined, + }, +] +`; + +exports[`inferParams 4`] = ` +Array [ + Object { + "default": "4", + "lineNumber": 1, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 5`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 3, + "name": "$0.x", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 6`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 3, + "name": "$0.x.y.z", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`mergeTrees 1`] = ` +Object { + "errors": Array [ + Object { + "commentLineNumber": undefined, + "message": "An explicit parameter named a was specified but didn't match inferred information ", + }, + ], + "mergedParams": Array [ + Object { + "description": "First arg!", + "name": "a", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], +} +`; + +exports[`mergeTrees 2`] = ` +Object { + "errors": Array [], + "mergedParams": Array [ + Object { + "description": "First arg!", + "name": "a", + "properties": Array [ + Object { + "name": "a.a", + "parameterIndex": 0, + "properties": Array [], + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "name": "object", + "type": "NameExpression", + }, + }, + ], +} +`; diff --git a/__tests__/lib/infer/access.js b/__tests__/lib/infer/access.js new file mode 100644 index 000000000..59d3bbf64 --- /dev/null +++ b/__tests__/lib/infer/access.js @@ -0,0 +1,46 @@ +var parse = require('../../../src/parsers/javascript'), + inferName = require('../../../src/infer/name'), + inferAccess = require('../../../src/infer/access'); + +function toComment(fn) { + return parse( + { + source: '(' + fn.toString() + ')' + }, + {} + )[0]; +} + +function evaluate(fn, re) { + return inferAccess(re)(inferName(toComment(fn))); +} + +test('inferAccess', function() { + expect( + evaluate(function() { + /** Test */ + function _name() {} + }, '^_').access + ).toBe('private'); + + expect( + evaluate(function() { + /** @private */ + function name() {} + }, '^_').access + ).toBe('private'); + + expect( + evaluate(function() { + /** @public */ + function _name() {} + }, '^_').access + ).toBe('public'); + + expect( + evaluate(function() { + /** Test */ + function name_() {} + }, '_$').access + ).toBe('private'); +}); diff --git a/test/lib/infer/finders.js b/__tests__/lib/infer/finders.js similarity index 51% rename from test/lib/infer/finders.js rename to __tests__/lib/infer/finders.js index 2bc566414..3c86b0473 100644 --- a/test/lib/infer/finders.js +++ b/__tests__/lib/infer/finders.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - findTarget = require('../../../lib/infer/finders').findTarget; +var parse = require('../../../src/parsers/javascript'), + findTarget = require('../../../src/infer/finders').findTarget; function toComment(fn) { if (typeof fn == 'function') { @@ -21,19 +18,17 @@ function evaluate(fn, re) { return toComment(fn); } -test('findTarget', function(t) { - t.equal( +test('findTarget', function() { + expect( findTarget( toComment(function() { /** Test */ var x = 10; }).context.ast - ).type, - 'VariableDeclarator', - 'variable declarator' - ); + ).type + ).toBe('VariableDeclarator'); - t.equal( + expect( findTarget( toComment(function() { var z = {}; @@ -41,12 +36,10 @@ test('findTarget', function(t) { /** Test */ z.y = 10; }).context.ast - ).type, - 'NumericLiteral', - 'assigned object value' - ); + ).type + ).toBe('NumericLiteral'); - t.equal( + expect( findTarget( toComment(function() { var z = { @@ -54,36 +47,28 @@ test('findTarget', function(t) { y: 10 }; }).context.ast - ).type, - 'NumericLiteral', - 'object property' - ); + ).type + ).toBe('NumericLiteral'); - t.equal( + expect( findTarget( toComment( ` - /** Test */ - export var z = 10; - ` + /** Test */ + export var z = 10; +` ).context.ast - ).type, - 'VariableDeclarator', - 'variable declarator in export' - ); + ).type + ).toBe('VariableDeclarator'); - t.equal( + expect( findTarget( toComment( ` - /** Test */ - export default 10; - ` + /** Test */ + export default 10; +` ).context.ast - ).type, - 'NumericLiteral', - 'default export' - ); - - t.end(); + ).type + ).toBe('NumericLiteral'); }); diff --git a/test/lib/infer/kind.js b/__tests__/lib/infer/kind.js similarity index 55% rename from test/lib/infer/kind.js rename to __tests__/lib/infer/kind.js index 1509ebb99..fa9c8d3d7 100644 --- a/test/lib/infer/kind.js +++ b/__tests__/lib/infer/kind.js @@ -1,8 +1,6 @@ -'use strict'; /*eslint-disable no-unused-vars*/ -var test = require('tap').test, - inferKind = require('../../../lib/infer/kind'), - parse = require('../../../lib/parsers/javascript'); +var inferKind = require('../../../src/infer/kind'), + parse = require('../../../src/parsers/javascript'); function toComment(fn, filename) { return parse( @@ -14,128 +12,100 @@ function toComment(fn, filename) { )[0]; } -test('inferKind', function(t) { - t.equal( +test('inferKind', function() { + expect( inferKind({ kind: 'class', tags: [] - }).kind, - 'class', - 'explicit' - ); + }).kind + ).toBe('class'); - t.equal( - inferKind(toComment('/**' + ' * Class' + ' */' + 'class C {}')).kind, - 'class', - 'es6 syntax' - ); + expect( + inferKind(toComment('/**' + ' * Class' + ' */' + 'class C {}')).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment('/**' + ' * Exported class' + ' */' + 'export class C {}') - ).kind, - 'class', - 'es6 syntax with export' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment( '/**' + ' * Export default class' + ' */' + 'export default class C {}' ) - ).kind, - 'class', - 'es6 syntax with default export' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment(function() { /** function */ function foo() {} foo(); }) - ).kind, - 'function', - 'inferred function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment(function() { /** function */ var foo = function() {}; foo(); }) - ).kind, - 'function', - 'inferred var function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment('/** Exported function */' + 'export function foo() {}') - ).kind, - 'function', - 'inferred exported function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment( '/** Export default function */' + 'export default function foo() {}' ) - ).kind, - 'function', - 'inferred exported function' - ); + ).kind + ).toBe('function'); - t.equal( - inferKind(toComment('class Foo { /** set b */ set b(v) { } }')).kind, - 'member', - 'member via set' - ); + expect( + inferKind(toComment('class Foo { /** set b */ set b(v) { } }')).kind + ).toBe('member'); - t.equal( - inferKind(toComment('var foo = { /** thing */ b: function(v) { } }')).kind, - 'function', - 'function via set' - ); + expect( + inferKind(toComment('var foo = { /** thing */ b: function(v) { } }')).kind + ).toBe('function'); - t.equal( - inferKind(toComment('class Foo { /** get b */ get b() { } }')).kind, - 'member', - 'member via get' - ); + expect( + inferKind(toComment('class Foo { /** get b */ get b() { } }')).kind + ).toBe('member'); - t.equal( - inferKind(toComment('class Foo { /** b */ b(v) { } }')).kind, - 'function', - 'normal function as part of class' + expect(inferKind(toComment('class Foo { /** b */ b(v) { } }')).kind).toBe( + 'function' ); - t.equal( + expect( inferKind( toComment(function() { /** class */ function Foo() {} }) - ).kind, - 'class', - 'class via uppercase' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment(function() { /** undefined */ }) - ).kind, - undefined, - 'undetectable' - ); + ).kind + ).toBe(undefined); - t.equal( + expect( inferKind( toComment( '/**' + @@ -143,20 +113,14 @@ test('inferKind', function(t) { ' */' + 'const foo = "bar";' ) - ).kind, - 'constant', - 'constant via const' - ); + ).kind + ).toBe('constant'); - t.equal( + expect( inferKind( toComment( '/**' + ' * Exported constant' + ' */' + 'export const foo = "bar";' ) - ).kind, - 'constant', - 'constant via export const' - ); - - t.end(); + ).kind + ).toBe('constant'); }); diff --git a/test/lib/infer/membership.js b/__tests__/lib/infer/membership.js similarity index 56% rename from test/lib/infer/membership.js rename to __tests__/lib/infer/membership.js index f20750709..20bf78d60 100644 --- a/test/lib/infer/membership.js +++ b/__tests__/lib/infer/membership.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferMembership = require('../../../lib/infer/membership')(); +var parse = require('../../../src/parsers/javascript'), + inferMembership = require('../../../src/infer/membership')(); function toComment(fn, file) { return parse( @@ -15,15 +12,12 @@ function toComment(fn, file) { } function pick(obj, props) { - return props.reduce( - function(memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, - {} - ); + return props.reduce(function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, {}); } function evaluate(fn, file) { @@ -33,120 +27,106 @@ function evaluate(fn, file) { function Foo() {} function lend() {} -test('inferMembership - explicit', function(t) { - t.deepEqual( +test('inferMembership - explicit', function() { + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar - * @static - */ + * Test + * @memberof Bar + * @static + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'static' - }, - 'explicit, static' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar# - */ + * Test + * @memberof Bar# + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'instance' - }, - 'explicit, instance' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar.prototype - */ + * Test + * @memberof Bar.prototype + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'instance' - }, - 'explicit, prototype' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'implicit' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.prototype.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.bar.baz = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo.bar', - scope: 'static' - }, - 'compound' - ); + ) + ).toEqual({ + memberof: 'Foo.bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ (0).baz = 0; })[0], ['memberof', 'scope'] - ), - {}, - 'unknown' - ); + ) + ).toEqual({}); - t.deepEqual( + expect( pick( evaluate(function() { Foo.bar = { @@ -155,15 +135,13 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo.bar', - scope: 'static' - }, - 'static object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo.bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { @@ -172,54 +150,48 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); /* eslint object-shorthand: 0 */ - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { /** - * Test - */ + * Test + */ bar: function() {} }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { /** - * Test - */ + * Test + */ bar() {} }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment, shorthand function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = { @@ -229,15 +201,13 @@ test('inferMembership - explicit', function(t) { return Foo; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'variable object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = { @@ -247,15 +217,13 @@ test('inferMembership - explicit', function(t) { return Foo; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'variable object assignment, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { function Foo() { @@ -266,15 +234,13 @@ test('inferMembership - explicit', function(t) { } })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor function declaration assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = function Bar() { @@ -285,15 +251,13 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor function expression assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { class Foo { @@ -306,30 +270,26 @@ test('inferMembership - explicit', function(t) { } })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ module.exports = function() {}; })[0], ['memberof', 'scope'] - ), - { - memberof: 'module', - scope: 'static' - }, - 'simple' - ); + ) + ).toEqual({ + memberof: 'module', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -340,15 +300,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'lends, static' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -359,15 +317,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'inferMembership - lends, static, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -378,14 +334,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -396,13 +351,11 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'inferMembership - lends, instance, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); // t.deepEqual(pick(evaluate(function () { // /** Foo */ @@ -418,247 +371,210 @@ test('inferMembership - explicit', function(t) { // scope: 'static' // }, 'inferMembership - revealing, static, function'); - t.equal( + expect( evaluate(function() { lend(/** @lends Foo */ {}); /** Test */ - })[0].memberof, - undefined, - 'inferMembership - lends applies only to following object' - ); - - t.end(); + })[0].memberof + ).toBe(undefined); }); -test('inferMembership - exports', function(t) { - t.equal( +test('inferMembership - exports', function() { + expect( evaluate(function() { /** @module mod */ /** foo */ exports.foo = 1; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** foo */ exports.foo = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ exports.foo.bar = 1; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo = { /** bar */ bar: 1 }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ exports.foo.prototype.bar = function() {}; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo.prototype = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); - - t.end(); + })[1].memberof + ).toBe('mod.foo'); }); -test('inferMembership - module.exports', function(t) { - t.equal( +test('inferMembership - module.exports', function() { + expect( evaluate(function() { /** @module mod */ /** foo */ module.exports.foo = 1; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** foo */ module.exports.foo = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ module.exports.foo.bar = 1; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.foo = { /** bar */ bar: 1 }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.foo = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ module.exports.prototype.bar = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.prototype = { /** bar */ bar() {} }; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** - * @module mod - * @name exports - */ + * @module mod + * @name exports + */ module.exports = 1; - })[0].memberof, - undefined - ); + })[0].memberof + ).toBe(undefined); - t.equal( + expect( evaluate(function() { /** - * @module mod - * @name exports - */ + * @module mod + * @name exports + */ module.exports = function() {}; - })[0].memberof, - undefined - ); + })[0].memberof + ).toBe(undefined); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports = { /** foo */ foo: 1 }; - })[1].memberof, - 'mod' - ); - - t.end(); + })[1].memberof + ).toBe('mod'); }); -test('inferMembership - not module exports', function(t) { - var result = evaluate( - function() { - /** +test('inferMembership - not module exports', function() { + var result = evaluate(function() { + /** * @module mod */ - /** Test */ - global.module.exports.foo = 1; - }, - '/path/mod.js' - ); + /** Test */ + global.module.exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 2); - t.notEqual(result[0].memberof, 'mod'); - t.end(); + expect(result.length).toBe(2); + expect(result[0].memberof).not.toBe('mod'); }); -test('inferMembership - anonymous @module', function(t) { - var result = evaluate( - function() { - /** +test('inferMembership - anonymous @module', function() { + var result = evaluate(function() { + /** * @module */ - /** Test */ - exports.foo = 1; - }, - '/path/mod.js' - ); + /** Test */ + exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 2); - t.equal(result[1].memberof, 'mod'); - t.end(); + expect(result.length).toBe(2); + expect(result[1].memberof).toBe('mod'); }); -test('inferMembership - no @module', function(t) { - var result = evaluate( - function() { - /** Test */ - exports.foo = 1; - }, - '/path/mod.js' - ); +test('inferMembership - no @module', function() { + var result = evaluate(function() { + /** Test */ + exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 1); - t.equal(result[0].memberof, 'mod'); - t.end(); + expect(result.length).toBe(1); + expect(result[0].memberof).toBe('mod'); }); -test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function(t) { - t.deepEqual( +test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function() { + expect( pick( evaluate(function() { Foo.prototype = { @@ -670,58 +586,50 @@ test('inferMembership - https://github.com/documentationjs/documentation/issues/ }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - } - ); - - t.end(); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); }); -test('inferMembership - export', function(t) { - t.deepEqual( +test('inferMembership - export', function() { + expect( pick( evaluate( 'export default class {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'test-file', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'test-file', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate( 'export default class C {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'C', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'C', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate( 'export class C {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'C', - scope: 'instance' - } - ); - - t.end(); + ) + ).toEqual({ + memberof: 'C', + scope: 'instance' + }); }); diff --git a/test/lib/infer/name.js b/__tests__/lib/infer/name.js similarity index 56% rename from test/lib/infer/name.js rename to __tests__/lib/infer/name.js index eb1851c29..a07a46c8b 100644 --- a/test/lib/infer/name.js +++ b/__tests__/lib/infer/name.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name'); +var parse = require('../../../src/parsers/javascript'), + inferName = require('../../../src/infer/name'); function toComment(fn, file) { return parse( @@ -18,8 +15,8 @@ function evaluate(fn, file) { return inferName(toComment(fn, file)); } -test('inferName', function(t) { - t.equal( +test('inferName', function() { + expect( evaluate(function() { // ExpressionStatement (comment attached here) // AssignmentExpression @@ -27,12 +24,10 @@ test('inferName', function(t) { // Identifier /** Test */ exports.name = test; - }).name, - 'name', - 'expression statement' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { // ExpressionStatement // AssignmentExpression @@ -40,12 +35,10 @@ test('inferName', function(t) { // FunctionExpression /** Test */ exports.name = function() {}; - }).name, - 'name', - 'expression statement, function' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { exports = { // Property (comment attached here) @@ -54,12 +47,10 @@ test('inferName', function(t) { /** Test */ name: test }; - }).name, - 'name', - 'property' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { exports = { // Property @@ -68,178 +59,139 @@ test('inferName', function(t) { /** Test */ name() {} }; - }).name, - 'name', - 'property, function' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ function name() {} - }).name, - 'name', - 'function declaration' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ var name = function() {}; - }).name, - 'name', - 'anonymous function expression' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ var name = function name2() {}; - }).name, - 'name', - 'named function expression' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** @name explicitName */ function implicitName() {} - }).name, - 'explicitName', - 'explicit name' - ); + }).name + ).toBe('explicitName'); - t.equal( + expect( evaluate(function() { /** @alias explicitAlias */ function implicitName() {} - }).name, - 'explicitAlias', - 'explicit alias' - ); + }).name + ).toBe('explicitAlias'); - t.equal( + expect( evaluate(function() { /** @class ExplicitClass */ function ImplicitClass() {} - }).name, - 'ExplicitClass', - 'explicit class' - ); + }).name + ).toBe('ExplicitClass'); - t.equal( + expect( evaluate(function() { /** @class */ function ImplicitClass() {} - }).name, - 'ImplicitClass', - 'anonymous class' - ); + }).name + ).toBe('ImplicitClass'); - t.equal( + expect( evaluate(function() { /** @event explicitEvent */ function implicitName() {} - }).name, - 'explicitEvent', - 'explicitEvent' - ); + }).name + ).toBe('explicitEvent'); - t.equal( + expect( evaluate(function() { /** @typedef {Object} ExplicitTypedef */ function implicitName() {} - }).name, - 'ExplicitTypedef', - 'ExplicitTypedef' - ); + }).name + ).toBe('ExplicitTypedef'); - t.equal( + expect( evaluate(function() { /** @callback explicitCallback */ function implicitName() {} - }).name, - 'explicitCallback', - 'explicitCallback' - ); + }).name + ).toBe('explicitCallback'); - t.equal( + expect( evaluate(function() { /** @module explicitModule */ function implicitName() {} - }).name, - 'explicitModule' - ); + }).name + ).toBe('explicitModule'); - t.equal( + expect( evaluate(function() { /** @module {Function} explicitModule */ function implicitName() {} - }).name, - 'explicitModule' - ); + }).name + ).toBe('explicitModule'); - t.equal( - evaluate( - function() { - /** @module */ - function implicitName() {} - }, - '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + expect( + evaluate(function() { + /** @module */ + function implicitName() {} + }, '/path/inferred-from-file.js').name + ).toBe('inferred-from-file'); - t.equal( - evaluate( - function() { - /** @module */ - }, - '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + expect( + evaluate(function() { + /** @module */ + }, '/path/inferred-from-file.js').name + ).toBe('inferred-from-file'); - t.equal( - evaluate('/** Test */ export function exported() {}').name, + expect(evaluate('/** Test */ export function exported() {}').name).toBe( 'exported' ); - t.equal( + expect( evaluate( '/** Test */ export default function() {}', '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + ).name + ).toBe('inferred-from-file'); - t.equal( + expect( evaluate( '/** Test */ export default function exported() {}', '/path/inferred-from-file.js' - ).name, - 'exported' - ); + ).name + ).toBe('exported'); - t.equal(evaluate('/** Test */ export var life = 42;').name, 'life'); + expect(evaluate('/** Test */ export var life = 42;').name).toBe('life'); - t.equal(evaluate('/** Test */ export class Wizard {}').name, 'Wizard'); + expect(evaluate('/** Test */ export class Wizard {}').name).toBe('Wizard'); - t.equal( + expect( evaluate( '/** Test */ export default class Warlock {}', '/path/inferred-from-file.js' - ).name, - 'Warlock' - ); + ).name + ).toBe('Warlock'); - t.equal( + expect( evaluate( '/** Test */ export default class {}', '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); - - t.end(); + ).name + ).toBe('inferred-from-file'); }); diff --git a/__tests__/lib/infer/params.js b/__tests__/lib/infer/params.js new file mode 100644 index 000000000..01eba07d3 --- /dev/null +++ b/__tests__/lib/infer/params.js @@ -0,0 +1,166 @@ +var parse = require('../../../src/parsers/javascript'), + inferParams = require('../../../src/infer/params'); + +function toComment(fn, file) { + return parse( + { + file, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(fn, file) { + return inferParams(toComment(fn, file)); +} + +test('mergeTrees', function() { + expect( + inferParams.mergeTrees( + [], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'string' + } + } + ] + ) + ).toMatchSnapshot(); + + expect( + inferParams.mergeTrees( + [ + { + title: 'param', + name: '$0', + anonymous: true, + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'object' + }, + properties: [ + { + title: 'param', + name: '$0.a', + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'string' + }, + properties: [] + } + ] + } + ], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'object' + } + } + ] + ) + ).toMatchSnapshot(); +}); + +test('inferParams', function() { + expect( + evaluate(function() { + /** Test */ + function f(x) {} + }).params + ).toEqual([{ lineNumber: 3, name: 'x', title: 'param' }]); + + expect( + evaluate(function() { + /** Test */ + var f = function(x) {}; + }).params + ).toEqual([{ lineNumber: 3, name: 'x', title: 'param' }]); + + expect( + evaluate(`/** Test */function f({ x, ...xs }) {};`).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** + * Test + * @param {Object} a renamed destructuring param + */ + var f = function({ x }) {}; + ` + ).params + ).toMatchSnapshot(); + + expect(evaluate('/** Test */ var f = (x) => {}').params).toEqual([ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + expect( + evaluate(function() { + var x = 1, + g = function(y) {}, + /** Test */ + f = function(x) {}; + }).params + ).toEqual([{ lineNumber: 5, name: 'x', title: 'param' }]); + + expect( + evaluate( + ` + /** Test */ + function f(x = 4) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test + * @param {number} x + */ + function f(x = 4) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test */ + function f({ x: y }) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test */ + function f({ x: { y: { z } } }) {} + ` + ).params + ).toMatchSnapshot(); + + expect(evaluate('/** Test */ export function f(x) {}').params).toEqual([ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + expect( + evaluate('/** Test */ export default function f(x) {}').params + ).toEqual([{ lineNumber: 1, name: 'x', title: 'param' }]); +}); diff --git a/test/lib/infer/type.js b/__tests__/lib/infer/type.js similarity index 52% rename from test/lib/infer/type.js rename to __tests__/lib/infer/type.js index 0a72e4e1d..4832d9d1c 100644 --- a/test/lib/infer/type.js +++ b/__tests__/lib/infer/type.js @@ -1,9 +1,6 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferKind = require('../../../lib/infer/kind'), - inferType = require('../../../lib/infer/type'); +var parse = require('../../../src/parsers/javascript'), + inferKind = require('../../../src/infer/kind'), + inferType = require('../../../src/infer/type'); function toComment(code) { return parse( @@ -18,18 +15,18 @@ function evaluate(code) { return inferType(inferKind(toComment(code))); } -test('inferType', function(t) { - t.deepEqual(evaluate('/** @typedef {T} V */').type, { +test('inferType', function() { + expect(evaluate('/** @typedef {T} V */').type).toEqual({ name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'type V = T').type, { + expect(evaluate('/** */' + 'type V = T').type).toEqual({ name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate('/** @typedef {Array} V */').type, { + expect(evaluate('/** @typedef {Array} V */').type).toEqual({ applications: [ { name: 'T', @@ -43,7 +40,7 @@ test('inferType', function(t) { type: 'TypeApplication' }); - t.deepEqual(evaluate('/** */' + 'type V = Array').type, { + expect(evaluate('/** */' + 'type V = Array').type).toEqual({ applications: [ { name: 'T', @@ -57,45 +54,43 @@ test('inferType', function(t) { type: 'TypeApplication' }); - t.deepEqual(evaluate('/** */' + 'var x: number').type, { + expect(evaluate('/** */' + 'var x: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'let x: number').type, { + expect(evaluate('/** */' + 'let x: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x: number = 42;').type, { + expect(evaluate('/** */' + 'const x: number = 42;').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('let x,' + '/** */' + 'y: number').type, { + expect(evaluate('let x,' + '/** */' + 'y: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('class C {' + '/** */' + 'x: number;' + '}').type, { + expect(evaluate('class C {' + '/** */' + 'x: number;' + '}').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = 42;').type, { + expect(evaluate('/** */' + 'const x = 42;').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = "abc";').type, { + expect(evaluate('/** */' + 'const x = "abc";').type).toEqual({ name: 'string', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = true;').type, { + expect(evaluate('/** */' + 'const x = true;').type).toEqual({ name: 'boolean', type: 'NameExpression' }); - - t.end(); }); diff --git a/__tests__/lib/input/shallow.js b/__tests__/lib/input/shallow.js new file mode 100644 index 000000000..9e075b889 --- /dev/null +++ b/__tests__/lib/input/shallow.js @@ -0,0 +1,46 @@ +var path = require('path'), shallow = require('../../../src/input/shallow'); + +test('shallow deps', async function() { + const deps = await shallow( + [path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], + {} + ); + expect(deps.length).toBe(1); + expect(deps[0]).toBeTruthy(); +}); + +test('shallow deps multi', async function() { + const deps = await shallow( + [ + path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), + path.resolve(path.join(__dirname, '../../fixture/simple.input.js')) + ], + {} + ); + expect(deps.length).toBe(2); + expect(deps[0]).toBeTruthy(); +}); + +test('shallow deps directory', async function() { + const deps = await shallow( + [path.resolve(path.join(__dirname, '../../fixture/html'))], + {} + ); + expect(deps.length).toBe(1); + expect(deps[0].file.match(/input.js/)).toBeTruthy(); +}); + +test('throws on non-string or object input', function() { + return shallow([true], {}).catch(err => { + expect(err.message).toBe('Indexes should be either strings or objects'); + }); +}); + +test('shallow deps literal', async function() { + var obj = { + file: 'foo.js', + source: '//bar' + }; + const deps = await shallow([obj], {}); + expect(deps[0]).toBe(obj); +}); diff --git a/__tests__/lib/lint.js b/__tests__/lib/lint.js new file mode 100644 index 000000000..0f035b480 --- /dev/null +++ b/__tests__/lib/lint.js @@ -0,0 +1,74 @@ +var parse = require('../../src/parsers/javascript'), + lintComments = require('../../src/lint').lintComments, + formatLint = require('../../src/lint').formatLint; + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(fn) { + return lintComments(toComment(fn, 'input.js')); +} + +test('lintComments', function() { + expect( + evaluate(function() { + /** + * @param {foo + */ + }).errors + ).toEqual([ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ]); + + expect( + evaluate(function() { + /** + * @param {String} foo + * @param {array} bar + */ + }).errors + ).toEqual([ + { + commentLineNumber: 1, + message: 'type String found, string is standard' + }, + { commentLineNumber: 2, message: 'type array found, Array is standard' } + ]); + + expect( + evaluate(function() { + /** + * @param {string} foo + */ + }).errors + ).toEqual([]); +}); + +test('formatLint', function() { + var comment = evaluate(function() { + // 2 + // 3 + /** 4 + * @param {String} foo + * @param {array} bar + * @param {foo + */ + }); + + var formatted = formatLint([comment]); + + expect(formatted.match(/input.js/g)); + expect(formatted.match(/4:1[^\n]+Braces are not balanced/g)); + expect(formatted.match(/4:1[^\n]+Missing or invalid tag name/g)); + expect(formatted.match(/5:1[^\n]+type String found, string is standard/g)); + expect(formatted.match(/6:1[^\n]+type array found, Array is standard/g)); + expect(formatted.match(/4 warnings/g)); +}); diff --git a/test/lib/merge_config.js b/__tests__/lib/merge_config.js similarity index 82% rename from test/lib/merge_config.js rename to __tests__/lib/merge_config.js index 4dd14ae54..45a42836a 100644 --- a/test/lib/merge_config.js +++ b/__tests__/lib/merge_config.js @@ -1,18 +1,16 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), +var path = require('path'), _ = require('lodash'), - mergeConfig = require('../../lib/merge_config'); + mergeConfig = require('../../src/merge_config'); -test('bad config', function(t) { - mergeConfig({ config: 'DOES-NOT-EXIST' }).catch(err => { - t.ok(err); - t.end(); - }); +test('bad config', async function() { + try { + await mergeConfig({ config: 'DOES-NOT-EXIST' }); + } catch (err) { + expect(err).toBeTruthy(); + } }); -test('nc(mergeConfig)', function(t) { +test('nc(mergeConfig)', function(done) { // Omit configuration from output, for simplicity var nc = _.curryRight(_.omit, 2)([ 'config', @@ -73,9 +71,10 @@ test('nc(mergeConfig)', function(t) { mergeConfig(Object.assign(pair[0], { 'no-package': true })) .then(nc) .then(res => { - t.deepEqual(res, pair[1]); - })) + expect(res).toEqual(pair[1]); + }) + ) ).then(res => { - t.end(); + done(); }); }); diff --git a/test/lib/nest.js b/__tests__/lib/nest.js similarity index 70% rename from test/lib/nest.js rename to __tests__/lib/nest.js index fb603cabd..40469949f 100644 --- a/test/lib/nest.js +++ b/__tests__/lib/nest.js @@ -1,20 +1,16 @@ -'use strict'; - -var test = require('tap').test; -var nestTag = require('../../lib/nest').nestTag; +var nestTag = require('../../src/nest').nestTag; // Print a tree of tags in a way that's easy to test. -var printTree = indent => - node => - `${new Array(indent + 1).join(' ')}- ${node.name}${node.properties ? '\n' : ''}${(node.properties || [ - ]) - .map(printTree(indent + 1)) - .join('\n')}`; +var printTree = indent => node => + `${new Array(indent + 1).join(' ')}- ${node.name}${node.properties ? '\n' : ''}${(node.properties || [ + ]) + .map(printTree(indent + 1)) + .join('\n')}`; var printNesting = params => printTree(0)({ properties: nestTag(params), name: 'root' }); -test('nest params - basic', function(t) { +test('nest params - basic', function() { var params = [ 'foo', 'foo.bar', @@ -22,8 +18,7 @@ test('nest params - basic', function(t) { 'foo.third', 'foo.third[].baz' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - foo - foo.bar @@ -31,30 +26,26 @@ test('nest params - basic', function(t) { - foo.third - foo.third[].baz` ); - t.end(); }); -test('nest params - multiple roots', function(t) { +test('nest params - multiple roots', function() { var params = ['a', 'b', 'c'].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - a - b - c` ); - t.end(); }); -test('nest params - missing parent', function(t) { +test('nest params - missing parent', function() { var params = ['foo', 'foo.bar.third'].map(name => ({ name })); - t.throws(() => { + expect(() => { nestTag(params); - }); - t.end(); + }).toThrow(); }); -test('nest params - #658', function(t) { +test('nest params - #658', function() { var params = [ 'state', 'payload', @@ -65,8 +56,7 @@ test('nest params - #658', function(t) { 'payload.output_meter_levels[].peak', 'payload.output_meter_levels[].rms' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - state - payload @@ -77,10 +67,9 @@ test('nest params - #658', function(t) { - payload.output_meter_levels[].peak - payload.output_meter_levels[].rms` ); - t.end(); }); -test('nest params - #554', function(t) { +test('nest params - #554', function() { var params = [ 'x', 'yIn', @@ -96,8 +85,7 @@ test('nest params - #554', function(t) { 'options.boundaries', 'options.derivativeThreshold' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - x - yIn @@ -113,5 +101,4 @@ test('nest params - #554', function(t) { - options.boundaries - options.derivativeThreshold` ); - t.end(); }); diff --git a/__tests__/lib/output/util/formatters.js b/__tests__/lib/output/util/formatters.js new file mode 100644 index 000000000..3861e12c4 --- /dev/null +++ b/__tests__/lib/output/util/formatters.js @@ -0,0 +1,56 @@ +var formatters = require('../../../../src/output/util/formatters')(getHref); + +test('formatters.parameters -- long form', function() { + expect(formatters.parameters({})).toEqual('()'); + expect(formatters.parameters({ params: [] })).toEqual('()'); + expect(formatters.parameters({ params: [{ name: 'foo' }] })).toEqual( + '(foo: any)' + ); + expect( + formatters.parameters({ + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }) + ).toEqual('(foo: any?)'); +}); + +test('formatters.parameters -- short form', function() { + expect(formatters.parameters({}, true)).toEqual('()'); + expect(formatters.parameters({ params: [] }, true)).toEqual('()'); + expect(formatters.parameters({ params: [{ name: 'foo' }] }, true)).toEqual( + '(foo)' + ); + expect( + formatters.parameters( + { + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }, + true + ) + ).toEqual('(foo?)'); + expect( + formatters.parameters( + { + params: [ + { + title: 'param', + description: 'param', + type: { + type: 'OptionalType', + expression: { + type: 'NameExpression', + name: 'number' + } + }, + name: 'bar', + default: '1' + } + ] + }, + true + ) + ).toEqual('(bar = 1)'); +}); + +function getHref(x) { + return x; +} diff --git a/__tests__/lib/parse.js b/__tests__/lib/parse.js new file mode 100644 index 000000000..2349ec8ff --- /dev/null +++ b/__tests__/lib/parse.js @@ -0,0 +1,1142 @@ +var parse = require('../../src/parsers/javascript'), + remark = require('remark'), + visit = require('unist-util-visit'); + +function pick(obj, props) { + if (Array.isArray(props)) { + return props.reduce(function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, {}); + } + return obj[props]; +} + +function evaluate(fn, filename) { + return parse( + { + file: filename || 'test.js', + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ); +} + +function addJSDocTag(tree) { + visit(tree, 'link', function(node) { + node.jsdoc = true; + }); + return tree; +} + +function removePosition(tree) { + visit(tree, function(node) { + delete node.position; + }); + return tree; +} + +test('parse - @abstract', function() { + expect( + evaluate(function() { + /** @abstract */ + })[0].abstract + ).toBe(true); +}); + +test('parse - @access', function() { + expect( + evaluate(function() { + /** @access public */ + })[0].access + ).toBe('public'); + + expect( + evaluate(function() { + /** @access protected */ + })[0].access + ).toBe('protected'); + + expect( + evaluate(function() { + /** @access private */ + })[0].access + ).toBe('private'); +}); + +test('parse - @alias', function() {}); + +test('parse - @arg', function() {}); + +test('parse - @argument', function() {}); + +test('parse - @augments', function() { + expect( + evaluate(function() { + /** @augments Foo */ + })[0].augments[0].name + ).toBe('Foo'); +}); + +test('parse - @description', function() { + expect( + evaluate(function() { + /** + * This is a free-form description + * @description This tagged description wins, and [is markdown](http://markdown.com). + */ + })[0].description + ).toEqual( + remark().parse( + 'This tagged description wins, and [is markdown](http://markdown.com).' + ) + ); +}); + +/* + * Dossier-style augments tag + * https://github.com/google/closure-library/issues/746 + */ +test('parse - @augments in dossier style', function() { + expect( + evaluate(function() { + /** @augments {Foo} */ + })[0].augments[0].name + ).toBe('Foo'); +}); + +test('parse - @augments of complex passes through', function() { + expect( + evaluate(function() { + /** @augments {function()} */ + })[0].augments + ).toEqual([]); +}); + +test('parse - @author', function() {}); + +test('parse - @borrows', function() {}); + +test('parse - @callback', function() { + expect( + pick( + evaluate(function() { + /** @callback name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'typedef', + type: { + type: 'NameExpression', + name: 'Function' + } + }); +}); + +test('parse - @class', function() { + expect( + pick( + evaluate(function() { + /** @class */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'class' + }); + + expect( + pick( + evaluate(function() { + /** @class name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'class' + }); + + expect( + pick( + evaluate(function() { + /** @class {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'class', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @classdesc', function() { + expect( + evaluate(function() { + /** @classdesc test */ + })[0].classdesc + ).toEqual(remark().parse('test')); +}); + +test('parse - @const', function() {}); + +test('parse - @constant', function() { + expect( + pick( + evaluate(function() { + /** @constant */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant' + }); + + expect( + pick( + evaluate(function() { + /** @constant name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @constant {Object} */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + type: { + type: 'NameExpression', + name: 'Object' + } + }); + + expect( + pick( + evaluate(function() { + /** @constant {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @constructor', function() {}); + +test('parse - @constructs', function() {}); + +test('parse - @copyright', function() { + expect( + evaluate(function() { + /** @copyright test */ + })[0].copyright + ).toEqual(remark().parse('test')); +}); + +test('parse - @default', function() {}); + +test('parse - @defaultvalue', function() {}); + +test('parse - @deprecated', function() { + expect( + evaluate(function() { + /** @deprecated test */ + })[0].deprecated + ).toEqual(remark().parse('test')); +}); + +test('parse - @desc', function() { + expect( + evaluate(function() { + /** @desc test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - @description', function() { + expect( + evaluate(function() { + /** @description test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - description', function() { + expect( + evaluate(function() { + /** test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - @emits', function() {}); + +test('parse - @enum', function() {}); + +test('parse - @event', function() { + expect( + pick( + evaluate(function() { + /** @event name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'event', + name: 'name' + }); +}); + +test('parse - @example', function() { + expect( + evaluate(function() { + /** @example test */ + })[0].examples[0] + ).toEqual({ + description: 'test' + }); + + expect( + evaluate(function() { + /** + * @example + * a + * b + */ + })[0].examples[0] + ).toEqual({ + description: 'a\nb' + }); + + expect( + evaluate(function() { + /** + * @example caption + * a + * b + */ + })[0].examples[0] + ).toEqual({ + description: 'a\nb', + caption: remark().parse('caption') + }); + + expect( + evaluate(function() { + /** @example */ + })[0].errors[0] + ).toEqual({ + message: '@example without code', + commentLineNumber: 0 + }); +}); + +test('parse - @exception', function() {}); + +test('parse - @exports', function() {}); + +test('parse - @extends', function() { + expect( + evaluate(function() { + /** @extends Foo */ + })[0].augments[0].name + ).toEqual('Foo'); +}); + +test('parse - @external', function() { + expect( + pick( + evaluate(function() { + /** @external name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'external', + name: 'name' + }); +}); + +test('parse - @file', function() { + expect( + pick( + evaluate(function() { + /** @file */ + })[0], + ['kind'] + ) + ).toEqual({ + kind: 'file' + }); + + expect( + pick( + evaluate(function() { + /** @file desc */ + })[0], + ['kind', 'description'] + ) + ).toEqual({ + kind: 'file', + description: remark().parse('desc') + }); +}); + +test('parse - @fileoverview', function() {}); + +test('parse - @fires', function() {}); + +test('parse - @func', function() {}); + +test('parse - @function', function() { + expect( + pick( + evaluate(function() { + /** @function */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'function' + }); + + expect( + pick( + evaluate(function() { + /** @function name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'function', + name: 'name' + }); +}); + +test('parse - @global', function() { + expect( + evaluate(function() { + /** @global */ + })[0].scope + ).toBe('global'); +}); + +test('parse - @host', function() {}); + +test('parse - @ignore', function() { + expect( + evaluate(function() { + /** @ignore */ + })[0].ignore + ).toBe(true); +}); + +test('parse - @implements', function() {}); + +test('parse - @inheritdoc', function() {}); + +test('parse - @inner', function() { + expect( + evaluate(function() { + /** @inner*/ + })[0].scope + ).toBe('inner'); +}); + +test('parse - @instance', function() { + expect( + evaluate(function() { + /** @instance*/ + })[0].scope + ).toBe('instance'); +}); + +test('parse - @interface', function() { + expect( + evaluate(function() { + /** @interface */ + })[0].interface + ).toEqual(true); + + expect( + evaluate(function() { + /** @interface Foo */ + })[0].name + ).toEqual('Foo'); +}); + +test('parse - @kind', function() { + expect( + evaluate(function() { + /** @kind class */ + })[0].kind + ).toBe('class'); +}); + +test('parse - @license', function() {}); + +test('parse - @listens', function() {}); + +test('parse - @member', function() { + expect( + pick( + evaluate(function() { + /** @member */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member' + }); + + expect( + pick( + evaluate(function() { + /** @member name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @member {Object} */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + type: { + type: 'NameExpression', + name: 'Object' + } + }); + + expect( + pick( + evaluate(function() { + /** @member {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @memberof', function() { + expect( + evaluate(function() { + /** @memberof test */ + })[0].memberof + ).toBe('test'); +}); + +test('parse - @method', function() {}); + +test('parse - @mixes', function() {}); + +test('parse - @mixin', function() { + expect( + pick( + evaluate(function() { + /** @mixin */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'mixin' + }); + + expect( + pick( + evaluate(function() { + /** @mixin name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'mixin', + name: 'name' + }); +}); + +test('parse - @module', function() { + expect( + pick( + evaluate(function() { + /** @module */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module' + }); + + expect( + pick( + evaluate(function() { + /** @module name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @module {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @name', function() { + expect( + evaluate(function() { + /** @name test */ + })[0].name + ).toBe('test'); +}); + +test('parse - @namespace', function() { + expect( + pick( + evaluate(function() { + /** @namespace */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace' + }); + + expect( + pick( + evaluate(function() { + /** @namespace name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @namespace {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @override', function() { + expect( + evaluate(function() { + /** @override */ + })[0].override + ).toBe(true); +}); + +test('parse - @overview', function() {}); + +test('parse - @param', function() { + expect( + evaluate(function() { + /** @param test */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @param {number} test */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @param {number} test - desc */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @private', function() { + expect( + evaluate(function() { + /** @private */ + })[0].access + ).toBe('private'); +}); + +test('parse - @prop', function() { + expect( + evaluate(function() { + /** @prop {number} test */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @prop {number} test - desc */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @property', function() { + expect( + evaluate(function() { + /** @property {number} test */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @property {number} test - desc */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @protected', function() { + expect( + evaluate(function() { + /** @protected */ + })[0].access + ).toBe('protected'); +}); + +test('parse - @public', function() {}); + +test('parse - @readonly', function() { + expect( + evaluate(function() { + /** @readonly */ + })[0].readonly + ).toBe(true); +}); + +test('parse - @requires', function() {}); + +test('parse - @return', function() { + expect( + evaluate(function() { + /** @return test */ + })[0].returns[0] + ).toEqual({ + title: 'returns', + description: remark().parse('test') + }); + + expect( + evaluate(function() { + /** @return {number} test */ + })[0].returns[0] + ).toEqual({ + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }); +}); + +test('parse - @returns', function() { + expect( + evaluate(function() { + /** @returns test */ + })[0].returns[0] + ).toEqual({ + title: 'returns', + description: remark().parse('test') + }); + + expect( + evaluate(function() { + /** @returns {number} test */ + })[0].returns[0] + ).toEqual({ + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }); +}); + +test('parse - @see', function() { + expect( + evaluate(function() { + /** @see test */ + })[0].sees + ).toEqual([remark().parse('test')]); + + expect( + evaluate(function() { + /** + * @see a + * @see b + */ + })[0].sees + ).toEqual([remark().parse('a'), remark().parse('b')]); +}); + +test('parse - @since', function() {}); + +test('parse - @static', function() { + expect( + evaluate(function() { + /** @static */ + })[0].scope + ).toBe('static'); +}); + +test('parse - @summary', function() { + expect( + evaluate(function() { + /** @summary test */ + })[0].summary + ).toEqual(remark().parse('test')); +}); + +test('parse - @this', function() {}); + +test('parse - @throws', function() { + expect( + evaluate(function() { + /** @throws desc */ + })[0].throws[0] + ).toEqual({ + description: remark().parse('desc') + }); + + expect( + evaluate(function() { + /** @throws {Error} */ + })[0].throws[0] + ).toEqual({ + type: { + name: 'Error', + type: 'NameExpression' + } + }); + + expect( + evaluate(function() { + /** @throws {Error} desc */ + })[0].throws[0] + ).toEqual({ + type: { + name: 'Error', + type: 'NameExpression' + }, + description: remark().parse('desc') + }); + + expect( + evaluate(function() { + /** + * @throws a + * @throws b + */ + })[0].throws + ).toEqual([ + { + description: remark().parse('a') + }, + { + description: remark().parse('b') + } + ]); +}); + +test('parse - @todo', function() { + expect( + evaluate(function() { + /** @todo test */ + })[0].todos + ).toEqual([remark().parse('test')]); + + expect( + evaluate(function() { + /** + * @todo a + * @todo b + */ + })[0].todos + ).toEqual([remark().parse('a'), remark().parse('b')]); +}); + +test('parse - @tutorial', function() {}); + +test('parse - @type', function() {}); + +test('parse - @typedef', function() { + expect( + pick( + evaluate(function() { + /** @typedef {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'typedef', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @var', function() {}); + +test('parse - @variation', function() { + expect( + evaluate(function() { + /** @variation 1 */ + })[0].variation + ).toBe(1); +}); + +test('parse - @version', function() {}); + +test('parse - @virtual', function() {}); + +test('parse - unknown tag', function() { + expect( + evaluate(function() { + /** @unknown */ + })[0].errors[0] + ).toEqual({ + message: 'unknown tag @unknown', + commentLineNumber: 0 + }); +}); + +test('parse - {@link}', function() { + expect( + removePosition( + evaluate(function() { + /** {@link Foo} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[Foo](Foo)')))); + + expect( + removePosition( + evaluate(function() { + /** {@link Foo|text} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[text](Foo)')))); + + expect( + removePosition( + evaluate(function() { + /** {@link Foo text} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[text](Foo)')))); +}); + +test('parse - {@linkcode}', function() {}); + +test('parse - {@linkplain}', function() {}); + +test('parse - {@tutorial}', function() { + expect( + removePosition( + evaluate(function() { + /** {@tutorial id} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'id' + } + ] + } + ] + } + ] + }); + + expect( + removePosition( + evaluate(function() { + /** {@tutorial id|text} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + }); + + expect( + removePosition( + evaluate(function() { + /** {@tutorial id text} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + }); +}); diff --git a/__tests__/lib/parsers/javascript.js b/__tests__/lib/parsers/javascript.js new file mode 100644 index 000000000..46b840551 --- /dev/null +++ b/__tests__/lib/parsers/javascript.js @@ -0,0 +1,86 @@ +var remark = require('remark'), + parse = require('../../../src/parsers/javascript'); + +function toComments(source, filename, opts) { + source = typeof source === 'string' ? source : '(' + source.toString() + ')'; + return parse( + { + file: filename || 'test.js', + source + }, + opts || {} + ); +} + +test('parse - leading comment', function() { + expect( + toComments(function() { + /** one */ + /** two */ + function two() {} + }).map(function(c) { + return c.description; + }) + ).toEqual([remark().parse('one'), remark().parse('two')]); +}); + +test('parse - trailing comment', function() { + expect( + toComments(function() { + /** one */ + function one() {} + /** two */ + }).map(function(c) { + return c.description; + }) + ).toEqual([remark().parse('one'), remark().parse('two')]); +}); + +test('parse - unknown tag', function() { + expect( + toComments(function() { + /** @unknown */ + })[0].tags[0].title + ).toBe('unknown'); +}); + +test('parse - error', function() { + expect( + toComments(function() { + /** @param {foo */ + })[0].errors + ).toEqual([ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ]); +}); + +test('parse - document exported', function() { + expect( + toComments( + ` + export class C {} +` + ).length + ).toBe(0); + expect( + toComments( + ` + export class C {} +`, + 'test.js', + { documentExported: true } + ).length + ).toBe(1); + expect( + toComments( + ` + export class C { + method() {} + } +`, + 'test.js', + { documentExported: true } + ).length + ).toBe(2); +}); diff --git a/__tests__/lib/parsers/polyglot.js b/__tests__/lib/parsers/polyglot.js new file mode 100644 index 000000000..10b268c58 --- /dev/null +++ b/__tests__/lib/parsers/polyglot.js @@ -0,0 +1,81 @@ +var fs = require('fs'), + path = require('path'), + remark = require('remark'), + polyglot = require('../../../src/parsers/polyglot'); + +test('polyglot', function() { + var file = path.resolve( + path.join(__dirname, '../../fixture/polyglot/blend.cpp') + ); + var result = polyglot({ + file, + source: fs.readFileSync(file, 'utf8') + }); + delete result[0].context.file; + delete result[0].context.sortKey; + expect(result).toEqual([ + { + errors: [], + augments: [], + examples: [], + properties: [], + throws: [], + todos: [], + sees: [], + context: { + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } + }, + description: remark().parse('This method moves a hex to a color'), + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, + name: 'hexToUInt32Color', + params: [ + { + lineNumber: 3, + title: 'param', + name: 'hex', + type: { + name: 'string', + type: 'NameExpression' + } + } + ], + returns: [ + { + title: 'returns', + description: remark().parse('color'), + type: { + name: 'number', + type: 'NameExpression' + } + } + ], + tags: [ + { + description: null, + lineNumber: 2, + name: 'hexToUInt32Color', + title: 'name' + }, + { + description: null, + lineNumber: 3, + name: 'hex', + title: 'param', + type: { + name: 'string', + type: 'NameExpression' + } + }, + { + description: 'color', + lineNumber: 4, + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + } + ] + } + ]); +}); diff --git a/__tests__/lib/server.js b/__tests__/lib/server.js new file mode 100644 index 000000000..8ad9fa332 --- /dev/null +++ b/__tests__/lib/server.js @@ -0,0 +1,59 @@ +var get = require('../utils').get; +var File = require('vinyl'); +var getPort = require('get-port'); +var Server = require('../../src/serve/server'); + +var jsFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/file.js', + contents: new Buffer('var test = 123;') +}); + +var coffeeFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/file.coffee', + contents: new Buffer('test = 123') +}); + +var indexFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/index.html', + contents: new Buffer('') +}); + +test('server - throws on bad port', function() { + expect(function() { + var server = new Server('${port}'); + }).toThrow(); + expect(function() { + var server = new Server(); + }).toThrow(); +}); + +test('server', async function() { + const port = await getPort(); + const server = new Server(port, true); + expect(server).toBeTruthy(); + await server.start(); + try { + await get(`http://localhost:${port}/file.coffee`); + } catch (code) { + expect(code).toEqual(404); + } + + server.setFiles([coffeeFile]); + var text; + + text = await get(`http://localhost:${port}/file.coffee`); + expect(text).toMatchSnapshot(); + server.setFiles([coffeeFile, jsFile]); + text = await get(`http://localhost:${port}/file.js`); + expect(text).toMatchSnapshot(); + server.setFiles([coffeeFile, indexFile, jsFile]); + text = await get(`http://localhost:${port}/`); + expect(text).toMatchSnapshot(); + await server.stop(); +}); diff --git a/test/lib/sort.js b/__tests__/lib/sort.js similarity index 60% rename from test/lib/sort.js rename to __tests__/lib/sort.js index a90cc6673..df6ca8856 100644 --- a/test/lib/sort.js +++ b/__tests__/lib/sort.js @@ -1,46 +1,28 @@ -'use strict'; +var sort = require('../../src/sort'), path = require('path'); -var test = require('tap').test, - sort = require('../../lib/sort'), - path = require('path'); - -test('sort stream alphanumeric', function(t) { +test('sort stream alphanumeric', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var banana = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual( - sort([apples, carrot, banana]), - [apples, carrot, banana], - 'sort stream alphanumeric' - ); - - t.deepEqual( - sort([carrot, apples, banana]), - [apples, carrot, banana], - 'sort stream alphanumeric' - ); + expect(sort([apples, carrot, banana])).toEqual([apples, carrot, banana]); - t.end(); + expect(sort([carrot, apples, banana])).toEqual([apples, carrot, banana]); }); -test('sort stream with configuration', function(t) { +test('sort stream with configuration', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: ['carrot', 'bananas'] - }), - [carrot, bananas, apples], - 'with configuration' - ); - - t.end(); + }) + ).toEqual([carrot, bananas, apples]); }); -test('sort stream with configuration and a section', function(t) { +test('sort stream with configuration and a section', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -107,18 +89,14 @@ test('sort stream with configuration and a section', function(t) { kind: 'note' }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: ['carrot', section, 'bananas'] - }), - [carrot, sectionMarkdown, bananas, apples], - 'with configuration' - ); - - t.end(); + }) + ).toEqual([carrot, sectionMarkdown, bananas, apples]); }); -test('sort an already-sorted stream containing a section/description', function(t) { +test('sort an already-sorted stream containing a section/description', function() { // this happens in the 'serve' task var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; @@ -191,11 +169,10 @@ test('sort an already-sorted stream containing a section/description', function( var sortOnce = sort([apples, carrot, bananas], config); var sortTwice = sort(sortOnce, config); - t.deepEqual(sortTwice, [carrot, sectionMarkdown, bananas, apples]); - t.end(); + expect(sortTwice).toEqual([carrot, sectionMarkdown, bananas, apples]); }); -test('sort toc with files', function(t) { +test('sort toc with files', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -205,51 +182,14 @@ test('sort toc with files', function(t) { file: 'test/fixture/snowflake.md' }; - var processedSnowflake = { - name: 'snowflake', - kind: 'note', - description: { - children: [ - { - children: [ - { - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 3, line: 1, offset: 2 } - }, - type: 'text', - value: 'The Snowflake' - } - ], - depth: 1, - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 1, line: 1, offset: 0 } - }, - type: 'heading' - } - ], - position: { - end: { column: 1, line: 2, offset: 16 }, - start: { column: 1, line: 1, offset: 0 } - }, - type: 'root' - } - }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: [snowflake] - }), - [processedSnowflake, apples, carrot, bananas], - 'with configuration' - ); - - t.end(); + }) + ).toMatchSnapshot(); }); -test('sort toc with files absolute path', function(t) { +test('sort toc with files absolute path', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -258,47 +198,9 @@ test('sort toc with files absolute path', function(t) { name: 'snowflake', file: path.join(__dirname, '../fixture/snowflake.md') }; - - var processedSnowflake = { - name: 'snowflake', - kind: 'note', - description: { - children: [ - { - children: [ - { - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 3, line: 1, offset: 2 } - }, - type: 'text', - value: 'The Snowflake' - } - ], - depth: 1, - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 1, line: 1, offset: 0 } - }, - type: 'heading' - } - ], - position: { - end: { column: 1, line: 2, offset: 16 }, - start: { column: 1, line: 1, offset: 0 } - }, - type: 'root' - } - }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: [snowflake] - }), - [processedSnowflake, apples, carrot, bananas], - 'with configuration' - ); - - t.end(); + }) + ).toMatchSnapshot(); }); diff --git a/__tests__/lib/walk.js b/__tests__/lib/walk.js new file mode 100644 index 000000000..e63db9b20 --- /dev/null +++ b/__tests__/lib/walk.js @@ -0,0 +1,74 @@ +var walk = require('../../src/walk'); + +test('walk', function() { + test('flat comments', function(t) { + var comments = [{ name: 'Tom' }]; + + function renamer(comment, options) { + if (options) { + comment.name = options.name; + } else { + comment.name = 'Tim'; + } + } + + expect(walk(comments, renamer)).toEqual([{ name: 'Tim' }]); + + expect(walk(comments, renamer, { name: 'John' })).toEqual([ + { name: 'John' } + ]); + }); + + test('nested comments', function(t) { + var comments = [ + { + name: 'Tom', + members: { + static: [ + { + name: 'Billy' + } + ] + } + } + ]; + + function renamer(comment, options) { + if (options) { + comment.name = options.name; + } else { + comment.name = 'Tim'; + } + } + + expect(walk(comments, renamer)).toEqual([ + { + name: 'Tim', + members: { + static: [ + { + name: 'Tim' + } + ] + } + } + ]); + + expect( + walk(comments, renamer, { + name: 'Bob' + }) + ).toEqual([ + { + name: 'Bob', + members: { + static: [ + { + name: 'Bob' + } + ] + } + } + ]); + }); +}); diff --git a/__tests__/linker.js b/__tests__/linker.js new file mode 100644 index 000000000..41d646fef --- /dev/null +++ b/__tests__/linker.js @@ -0,0 +1,44 @@ +var LinkerStack = require('../src/output/util/linker_stack'); + +test('linkerStack', function() { + var linkerStack = new LinkerStack({}); + + expect(linkerStack.link('string')).toBe( + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' + ); + + expect( + new LinkerStack({ + paths: { + Point: 'http://geojson.org/geojson-spec.html#point' + } + }).link('Point') + ).toBe('http://geojson.org/geojson-spec.html#point'); + + expect( + new LinkerStack({ + paths: { + Image: 'http://custom.com/' + } + }).link('Image') + ).toBe('http://custom.com/'); + + var linker = new LinkerStack({ + paths: { + Image: 'http://custom.com/' + } + }); + + linker.namespaceResolver( + [ + { + namespace: 'Image' + } + ], + function(namespace) { + return '#' + namespace; + } + ); + + expect(linker.link('Image')).toBe('#Image'); +}); diff --git a/test/misc/package.json b/__tests__/misc/package.json similarity index 100% rename from test/misc/package.json rename to __tests__/misc/package.json diff --git a/__tests__/test.js b/__tests__/test.js new file mode 100644 index 000000000..2da48557e --- /dev/null +++ b/__tests__/test.js @@ -0,0 +1,221 @@ +var documentationSchema = require('documentation-schema'), + validate = require('json-schema'), + documentation = require('../'), + outputMarkdown = require('../src/output/markdown.js'), + outputMarkdownAST = require('../src/output/markdown_ast.js'), + outputHtml = require('../src/output/html.js'), + normalize = require('./utils').normalize, + glob = require('glob'), + pify = require('pify'), + path = require('path'), + fs = require('fs'), + _ = require('lodash'), + chdir = require('chdir'); + +var UPDATE = !!process.env.UPDATE; + +function makePOJO(ast) { + return JSON.parse(JSON.stringify(ast)); +} + +function readOptionsFromFile(file) { + var s = fs.readFileSync(file, 'utf-8'); + var lines = s.split(/\n/, 20); + for (var i = 0; i < lines.length; i++) { + var m = lines[i].match(/^\/\/\s+Options:\s*(.+)$/); + if (m) { + return JSON.parse(m[1]); + } + } + return {}; +} + +if (fs.existsSync(path.join(__dirname, '../.git'))) { + test('git option', async function() { + var file = path.join(__dirname, './fixture/simple.input.js'); + const result = await documentation.build([file], { github: true }); + normalize(result); + expect(result).toMatchSnapshot(); + + const md = await outputMarkdown(result, {}); + expect(md.toString()).toMatchSnapshot(); + }); +} + +test('document-exported error', async function() { + var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); + try { + await documentation.build([file], { documentExported: true }); + } catch (err) { + expect(err.message.match(/Unable to find the value x/g)).toBeTruthy(); + } +}); + +test('external modules option', async function() { + const result = await documentation.build( + [path.join(__dirname, 'fixture', 'external.input.js')], + { + external: '(external|external/node_modules/*)' + } + ); + normalize(result); + var outputfile = path.join( + __dirname, + 'fixture', + '_external-deps-included.json' + ); + expect(result).toMatchSnapshot(); +}); + +test('bad input', function() { + glob + .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), function(t) { + return documentation + .build([file], readOptionsFromFile(file)) + .then(res => { + expect(res).toBe(undefined); + }) + .catch(error => { + // make error a serializable object + error = JSON.parse(JSON.stringify(error)); + // remove system-specific path + delete error.filename; + delete error.codeFrame; + expect(error).toMatchSnapshot(); + }); + }); + }); +}); + +test('html', function() { + glob + .sync(path.join(__dirname, 'fixture/html', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), async function(t) { + const result = await documentation.build( + [file], + readOptionsFromFile(file) + ); + const html = await outputHtml(result, {}); + var clean = html + .sort((a, b) => a.path > b.path) + .filter(r => r.path.match(/(html)$/)) + .map(r => r.contents) + .join('\n'); + expect(clean).toMatchSnapshot(); + }); + }); +}); + +test('outputs', function() { + glob + .sync(path.join(__dirname, 'fixture', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), async function(tt) { + const result = await documentation.build( + [file], + readOptionsFromFile(file) + ); + test('markdown', async function(t) { + const md = await outputMarkdown(_.cloneDeep(result), { + markdownToc: true + }); + expect(result.toString()).toMatchSnapshot(); + }); + + if (file.match(/es6.input.js/)) { + test('no markdown TOC', async function(t) { + const txt = await outputMarkdown(_.cloneDeep(result), { + markdownToc: false + }); + expect(result.toString()).toMatchSnapshot(); + }); + } + + test('markdown AST', async function(t) { + const ast = await outputMarkdownAST(_.cloneDeep(result), {}); + expect(ast).toMatchSnapshot(); + }); + + test('JSON', function(t) { + normalize(result); + result.forEach(function(comment) { + validate( + comment, + documentationSchema.jsonSchema + ).errors.forEach(function(error) { + expect(error).toBeFalsy(); + }); + }); + expect(makePOJO(result)).toMatchSnapshot(); + }); + }); + }); +}); + +test('highlightAuto md output', async function() { + var file = path.join( + __dirname, + 'fixture/auto_lang_hljs/multilanguage.input.js' + ), + hljsConfig = { + hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } + }; + + const result = await documentation.build(file, {}); + const md = await outputMarkdown(result, hljsConfig); + expect(md.toString()).toMatchSnapshot(); +}); + +test('config', async function() { + var file = path.join(__dirname, 'fixture', 'class.input.js'); + var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); + const out = await documentation.build([file], { + config: path.join(__dirname, 'fixture', 'simple.config.yml') + }); + const md = await outputMarkdown(out, {}); + expect(md).toMatchSnapshot(); +}); + +test('multi-file input', async function() { + const result = await documentation.build( + [ + path.join(__dirname, 'fixture', 'simple.input.js'), + path.join(__dirname, 'fixture', 'simple-two.input.js') + ], + {} + ); + normalize(result); + expect(result).toMatchSnapshot(); +}); + +test('accepts simple relative paths', async function() { + await pify(chdir)(__dirname); + const data = await documentation.build( + '__tests__/fixture/simple.input.js', + {} + ); + expect(data.length).toBe(1); +}); + +test('.lint', async function() { + await pify(chdir)(__dirname); + const data = await documentation.lint( + '__tests__/fixture/simple.input.js', + {} + ); + expect(data).toBe(''); +}); + +test('.lint with bad input', async function() { + await pify(chdir)(__dirname); + try { + await documentation.lint('__tests__/fixture/bad/syntax.input', { + parseExtension: ['input'] + }); + } catch (err) { + expect(err).toBeTruthy(); + } +}); diff --git a/test/lib/git/mock_repo.js b/__tests__/utils.js similarity index 63% rename from test/lib/git/mock_repo.js rename to __tests__/utils.js index 5095fb865..9031b6181 100644 --- a/test/lib/git/mock_repo.js +++ b/__tests__/utils.js @@ -1,5 +1,39 @@ -'use strict'; -module.exports = { +var http = require('http'); +import { walk } from '../src/walk'; +var concat = require('concat-stream'); + +function get(url, callback) { + return new Promise((resolve, reject) => { + http.get(url, function(res) { + res.pipe( + concat(function(text) { + if (res.statusCode >= 400) { + return reject(res.statusCode); + } + resolve(text.toString()); + }) + ); + }); + }); +} + +function normalize(comments) { + return walk(comments, function(comment) { + var hasGithub = !!comment.context.github; + var path = comment.context.path; + comment.context = { + loc: comment.context.loc + }; + if (hasGithub) { + comment.context.github = '[github]'; + } + if (path) { + comment.context.path = path; + } + }); +} + +module.exports.mockRepo = { master: { '/my': { repository: { @@ -66,3 +100,6 @@ module.exports = { } } }; + +module.exports.get = get; +module.exports.normalize = normalize; diff --git a/bin/documentation.js b/bin/documentation.js index 9ecd0ff16..7c8d41ce4 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -2,9 +2,8 @@ /* eslint no-console: 0 */ -'use strict'; - -var yargs = require('yargs'), commands = require('../lib/commands'); +var yargs = require('yargs'); +var commands = require('../lib/commands'); var argv = yargs .command(commands.serve) diff --git a/circle.yml b/circle.yml index fe4654099..3569827f5 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,8 @@ machine: node: - version: 4 + version: 7 +test: + override: + - npm run test-ci + post: + - ./node_modules/.bin/coveralls < coverage/lcov.info diff --git a/declarations/comment.js b/declarations/comment.js index b1c7744a9..a3dfa8735 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -1,3 +1,5 @@ +/* @flow */ +/* eslint no-use-before-define: 0 */ type DocumentationConfig = { polyglot?: boolean, inferPrivate?: string, @@ -13,11 +15,6 @@ type DocumentationConfig = { parseExtension: Array }; -type InputsConfig = { - inputs: Array, - config: DocumentationConfig -}; - type CommentError = { message: string, commentLineNumber?: number @@ -69,40 +66,6 @@ type CommentTag = { properties?: Array }; -type CommentMembers = { - static: Array, - instance: Array, - events: Array, - global: Array, - inner: Array -}; - -type CommentExample = { - caption?: string, - description?: Object -}; - -type Remark = { - type: string, - children: Array -}; - -type Access = 'private' | 'public' | 'protected'; -type Scope = 'instance' | 'static' | 'inner' | 'global'; -type Kind = - | 'class' - | 'constant' - | 'event' - | 'external' - | 'file' - | 'function' - | 'member' - | 'mixin' - | 'module' - | 'namespace' - | 'typedef' - | 'interface'; - type Comment = { errors: Array, tags: Array, @@ -150,8 +113,36 @@ type Comment = { }> }; -type ReducedComment = { - name: string, - kind: ?Kind, - scope?: ?Scope +type CommentMembers = { + static: Array, + instance: Array, + events: Array, + global: Array, + inner: Array +}; + +type CommentExample = { + caption?: string, + description?: Object +}; + +type Remark = { + type: string, + children: Array }; + +type Access = 'private' | 'public' | 'protected'; +type Scope = 'instance' | 'static' | 'inner' | 'global'; +type Kind = + | 'class' + | 'constant' + | 'event' + | 'external' + | 'file' + | 'function' + | 'member' + | 'mixin' + | 'module' + | 'namespace' + | 'typedef' + | 'interface'; diff --git a/default_theme/test/format_markdown.js b/default_theme/test/format_markdown.js deleted file mode 100644 index d50b71ce0..000000000 --- a/default_theme/test/format_markdown.js +++ /dev/null @@ -1,119 +0,0 @@ -var test = require('tap').test; -var remark = require('remark'); -var formatMarkdown = require('../lib/format_markdown'); - -test('main', function(t) { - t.deepEqual( - formatMarkdown(remark().parse('Converts from `Result` to `?Error`')), - '

Converts from Result<T> to ?Error

\n' - ); - t.done(); -}); - -test('type', function(t) { - var formatType = formatMarkdown.type; - - t.deepEqual(formatType(undefined), ''); - - t.deepEqual( - formatType({ - type: 'NameExpression', - name: 'Foo' - }), - 'Foo' - ); - - t.deepEqual( - formatType( - { - type: 'NameExpression', - name: 'Foo' - }, - ['Foo'] - ), - 'Foo' - ); - - t.deepEqual( - formatType({ - type: 'UnionType', - elements: [ - { - type: 'NameExpression', - name: 'Foo' - }, - { - type: 'NameExpression', - name: 'Bar' - } - ] - }), - '(Foo | Bar)' - ); - - t.deepEqual( - formatType({ - type: 'AllLiteral' - }), - 'Any' - ); - - t.deepEqual( - formatType({ - type: 'RestType' - }), - '...' - ); - - t.deepEqual( - formatType({ - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'Foo' - } - }), - '[Foo]' - ); - - t.deepEqual( - formatType({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Foo' - }, - applications: [ - { - type: 'NameExpression', - name: 'Bar' - } - ] - }), - 'Foo<Bar>' - ); - - t.deepEqual( - formatType({ - type: 'UndefinedLiteral' - }), - 'undefined' - ); - - t.done(); -}); - -test('autolink', function(t) { - var autolink = formatMarkdown.link; - - t.equal(autolink([], 'Foo'), 'Foo'); - t.equal(autolink(['Foo'], 'Foo'), 'Foo'); - t.equal( - autolink([], 'Array'), - 'Array' - ); - t.equal(autolink([], 'C&O'), 'C&O'); - - t.done(); -}); diff --git a/default_theme/test/format_parameters.js b/default_theme/test/format_parameters.js deleted file mode 100644 index e59ca5937..000000000 --- a/default_theme/test/format_parameters.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tap').test; -var formatParameters = require('../lib/format_parameters'); - -test('main', function(t) { - t.deepEqual(formatParameters({}), ''); - t.deepEqual(formatParameters({ params: [] }), '()'); - t.deepEqual(formatParameters({ params: [{ name: 'foo' }] }), '(foo: )'); - t.deepEqual( - formatParameters({ - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }), - '(foo: [])' - ); - t.done(); -}); diff --git a/default_theme/test/index.js b/default_theme/test/index.js deleted file mode 100644 index a613069b4..000000000 --- a/default_theme/test/index.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tap').test; -var remark = require('remark'); -var theme = require('..'); - -test('main', function(t) { - var comments = [ - { - path: [], - context: {}, - description: remark().parse('test'), - members: { - static: [], - instance: [] - }, - returns: [ - { - type: { - type: 'NameExpression', - name: 'Foo' - } - } - ] - } - ]; - - theme(comments, {}, function(err) { - t.ifError(err); - t.done(); - }); -}); diff --git a/lib/commands/serve.js b/lib/commands/serve.js deleted file mode 100644 index ebc386878..000000000 --- a/lib/commands/serve.js +++ /dev/null @@ -1,100 +0,0 @@ -/* @flow */ -'use strict'; - -var errorPage = require('../../lib/serve/error_page'), - fs = require('fs'), - path = require('path'), - chokidar = require('chokidar'), - sharedOptions = require('./shared_options'), - Server = require('../../lib/serve/server'), - _ = require('lodash'), - documentation = require('../../'); - -module.exports.command = 'serve [input..]'; -module.exports.description = 'generate, update, and display HTML documentation'; -/** - * Add yargs parsing for the serve command - * @param {Object} yargs module instance - * @returns {Object} yargs with options - * @private - */ -module.exports.builder = _.assign( - {}, - sharedOptions.sharedOutputOptions, - sharedOptions.sharedInputOptions, - { - port: { - describe: 'port for the local server', - type: 'number', - default: 4001 - } - } -); - -/** - * Wrap the documentation build command along with a server, making it possible - * to preview changes live - * @private - * @param {Object} argv cli input - * @returns {undefined} has side effects - */ -module.exports.handler = function serve(argv /*: Object*/) { - argv._handled = true; - - if (!argv.input.length) { - try { - argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' - ]; - } catch (e) { - throw new Error( - 'documentation was given no files and was not run in a module directory' - ); - } - } - - var server = new Server(argv.port); - var watcher; - - server.on('listening', function() { - process.stdout.write(`documentation.js serving on port ${argv.port}\n`); - }); - - function updateWatcher() { - if (!watcher) { - watcher = chokidar.watch(argv.input); - watcher.on('all', _.debounce(updateServer, 300)); - } - - documentation - .expandInputs(argv.input, argv) - .then(files => { - watcher.add( - files.map(data => typeof data === 'string' ? data : data.file) - ); - }) - .catch(err => { - /* eslint no-console: 0 */ - return server.setFiles([errorPage(err)]).start(); - }); - } - - function updateServer() { - documentation - .build(argv.input, argv) - .then(comments => documentation.formats.html(comments, argv)) - .then(files => { - if (argv.watch) { - updateWatcher(); - } - server.setFiles(files).start(); - }) - .catch(err => { - return server.setFiles([errorPage(err)]).start(); - }); - } - - updateServer(); -}; diff --git a/package.json b/package.json index 89271dc77..1282ab71c 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "disparity": "^2.0.0", "doctrine-temporary-fork": "2.0.0-alpha-allowarrayindex", "get-comments": "^1.0.1", + "get-port": "^3.1.0", "git-url-parse": "^6.0.1", "github-slugger": "1.1.1", "glob": "^7.0.0", @@ -58,22 +59,28 @@ }, "devDependencies": { "are-we-flow-yet": "^1.0.0", + "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", + "babel-jest": "^19.0.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", + "coveralls": "^2.13.1", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", "eslint": "^3.19.0", "eslint-config-prettier": "^1.7.0", "eslint-plugin-flowtype": "^2.32.1", - "flow-bin": "^0.44.0", + "flow-bin": "^0.45.0", "fs-extra": "^3.0.0", "husky": "^0.13.3", + "jest": "^19.0.2", "json-schema": "0.2.3", "lint-staged": "^3.4.0", "mock-fs": "^4.2.0", - "prettier": "^0.22.0", + "p-event": "^1.0.0", + "prettier": "^1.0.0", "standard-version": "^4.0.0", - "tap": "^10.3.2", "tmp": "^0.0.31" }, "keywords": [ @@ -91,14 +98,27 @@ "url": "git@github.com:documentationjs/documentation.git" }, "scripts": { + "build": "rm -rf lib && babel -D src -d lib", "release": "standard-version", "precommit": "lint-staged --verbose", - "format": "prettier --write '{lib,test,declarations,bin,default_theme}/**/*.js' --single-quote", + "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "./bin/documentation.js build lib/index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", - "self-lint": "node ./bin/documentation.js lint", - "test": "eslint lib && are-we-flow-yet lib && flow check && npm run self-lint && npm run test-tap", - "test-tap": "tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams" + "self-lint": "node ./bin/documentation.js lint src", + "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", + "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" + }, + "jest": { + "testPathIgnorePatterns": [ + "/node_modules/", + "utils.js", + "fixture" + ], + "coveragePathIgnorePatterns": [ + "/lib/" + ], + "collectCoverage": true, + "testEnvironment": "node" }, "config": { "commitizen": { diff --git a/lib/commands/build.js b/src/commands/build.js similarity index 89% rename from lib/commands/build.js rename to src/commands/build.js index 63def7210..17b89611b 100644 --- a/lib/commands/build.js +++ b/src/commands/build.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var streamArray = require('stream-array'), sharedOptions = require('./shared_options'), @@ -7,7 +6,7 @@ var streamArray = require('stream-array'), fs = require('fs'), vfs = require('vinyl-fs'), chokidar = require('chokidar'), - documentation = require('../../'), + documentation = require('../'), _ = require('lodash'); module.exports.command = 'build [input..]'; @@ -42,16 +41,15 @@ module.exports.builder = _.assign( * The former case, with the callback, is used by the `serve` command, which is * just a thin wrapper around this one. */ -module.exports.handler = function build(argv /*: Object*/) { +module.exports.handler = function build(argv: Object) { var watcher; argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( @@ -70,7 +68,8 @@ module.exports.handler = function build(argv /*: Object*/) { return documentation .build(argv.input, argv) .then(comments => - documentation.formats[argv.format](comments, argv).then(onFormatted)) + documentation.formats[argv.format](comments, argv).then(onFormatted) + ) .catch(err => { /* eslint no-console: 0 */ if (err instanceof Error) { @@ -110,8 +109,9 @@ module.exports.handler = function build(argv /*: Object*/) { .expandInputs(argv.input, argv) .then(files => watcher.add( - files.map(data => typeof data === 'string' ? data : data.file) - )); + files.map(data => (typeof data === 'string' ? data : data.file)) + ) + ); } return generator(); diff --git a/lib/commands/index.js b/src/commands/index.js similarity index 97% rename from lib/commands/index.js rename to src/commands/index.js index 8f09831ff..b1c38ebbf 100644 --- a/lib/commands/index.js +++ b/src/commands/index.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /* * Maps command name to a command plugin module. Each command plugin module diff --git a/lib/commands/lint.js b/src/commands/lint.js similarity index 82% rename from lib/commands/lint.js rename to src/commands/lint.js index 2b9d06d77..3e465cc9c 100644 --- a/lib/commands/lint.js +++ b/src/commands/lint.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; -var documentation = require('../../'); +var documentation = require('../'); var fs = require('fs'); var path = require('path'); @@ -19,14 +18,13 @@ module.exports.builder = {}; * @returns {undefined} has side-effects * @private */ -module.exports.handler = function(argv /*: Object*/) { +module.exports.handler = function(argv: Object) { argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( diff --git a/lib/commands/readme.js b/src/commands/readme.js similarity index 92% rename from lib/commands/readme.js rename to src/commands/readme.js index 27202da4e..81176c29b 100644 --- a/lib/commands/readme.js +++ b/src/commands/readme.js @@ -1,10 +1,9 @@ /* @flow */ -'use strict'; var fs = require('fs'); var remark = require('remark'); var path = require('path'); -var documentation = require('../../'); +var documentation = require('../'); var inject = require('mdast-util-inject'); var chalk = require('chalk'); var disparity = require('disparity'); @@ -51,15 +50,14 @@ function noop() {} * @param {Object} argv args from the CLI option parser * @return {undefined} has the side-effect of writing a file or printing to stdout */ -module.exports.handler = function readme(argv /*: Object*/) { +module.exports.handler = function readme(argv: Object) { argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( @@ -85,7 +83,8 @@ module.exports.handler = function readme(argv /*: Object*/) { section: argv.section, toInject: JSON.parse(docsAst) }) - .process(readmeContent)) + .process(readmeContent) + ) .then(file => { var diffOutput = disparity.unified(readmeContent, file.contents, { paths: [argv.readmeFile, argv.readmeFile] diff --git a/src/commands/serve.js b/src/commands/serve.js new file mode 100644 index 000000000..b83c8488f --- /dev/null +++ b/src/commands/serve.js @@ -0,0 +1,101 @@ +/* @flow */ + +var errorPage = require('../serve/error_page'), + fs = require('fs'), + path = require('path'), + chokidar = require('chokidar'), + sharedOptions = require('./shared_options'), + Server = require('../serve/server'), + _ = require('lodash'), + getPort = require('get-port'), + documentation = require('../'); + +module.exports.command = 'serve [input..]'; +module.exports.description = 'generate, update, and display HTML documentation'; +/** + * Add yargs parsing for the serve command + * @param {Object} yargs module instance + * @returns {Object} yargs with options + * @private + */ +module.exports.builder = _.assign( + {}, + sharedOptions.sharedOutputOptions, + sharedOptions.sharedInputOptions, + { + port: { + describe: 'preferred port for the local server', + type: 'number', + default: 4001 + } + } +); + +/** + * Wrap the documentation build command along with a server, making it possible + * to preview changes live + * @private + * @param {Object} argv cli input + * @returns {undefined} has side effects + */ +module.exports.handler = function serve(argv: Object) { + argv._handled = true; + + if (!argv.input.length) { + try { + argv.input = [ + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' + ]; + } catch (e) { + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); + } + } + + getPort(argv.port).then(port => { + var server = new Server(port); + var watcher; + + server.on('listening', function() { + process.stdout.write(`documentation.js serving on port ${port}\n`); + }); + + function updateWatcher() { + if (!watcher) { + watcher = chokidar.watch(argv.input); + watcher.on('all', _.debounce(updateServer, 300)); + } + + documentation + .expandInputs(argv.input, argv) + .then(files => { + watcher.add( + files.map(data => (typeof data === 'string' ? data : data.file)) + ); + }) + .catch(err => { + /* eslint no-console: 0 */ + return server.setFiles([errorPage(err)]).start(); + }); + } + + function updateServer() { + documentation + .build(argv.input, argv) + .then(comments => documentation.formats.html(comments, argv)) + .then(files => { + if (argv.watch) { + updateWatcher(); + } + server.setFiles(files).start(); + }) + .catch(err => { + return server.setFiles([errorPage(err)]).start(); + }); + } + + updateServer(); + }); +}; diff --git a/lib/commands/shared_options.js b/src/commands/shared_options.js similarity index 95% rename from lib/commands/shared_options.js rename to src/commands/shared_options.js index 605a7452f..2ffeb362c 100644 --- a/lib/commands/shared_options.js +++ b/src/commands/shared_options.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Adds shared options to any command that runs documentation @@ -32,13 +31,13 @@ module.exports.sharedInputOptions = { describe: "additional extensions to include in require() and import's search algorithm." + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array - coerce: (value /*: string | Array*/) => [].concat(value), + coerce: (value: string | Array) => [].concat(value), alias: 're' }, 'parse-extension': { describe: 'additional extensions to parse as source code.', // Ensure that the value is an array - coerce: (value /*: string | Array*/) => [].concat(value), + coerce: (value: string | Array) => [].concat(value), alias: 'pe' }, polyglot: { diff --git a/default_theme/README.md b/src/default_theme/README.md similarity index 100% rename from default_theme/README.md rename to src/default_theme/README.md diff --git a/default_theme/assets/anchor.js b/src/default_theme/assets/anchor.js similarity index 97% rename from default_theme/assets/anchor.js rename to src/default_theme/assets/anchor.js index 476a8f9ab..2ec9a1d4b 100644 --- a/default_theme/assets/anchor.js +++ b/src/default_theme/assets/anchor.js @@ -5,7 +5,6 @@ */ function AnchorJS(options) { - 'use strict'; this.options = options || {}; this._applyRemainingDefaultOptions = function(opts) { @@ -154,23 +153,27 @@ function AnchorJS(options) { } var style = document.createElement('style'), - linkRule = ' .anchorjs-link {' + + linkRule = + ' .anchorjs-link {' + ' opacity: 0;' + ' text-decoration: none;' + ' -webkit-font-smoothing: antialiased;' + ' -moz-osx-font-smoothing: grayscale;' + ' }', - hoverRule = ' *:hover > .anchorjs-link,' + + hoverRule = + ' *:hover > .anchorjs-link,' + ' .anchorjs-link:focus {' + ' opacity: 1;' + ' }', - anchorjsLinkFontFace = ' @font-face {' + + anchorjsLinkFontFace = + ' @font-face {' + ' font-family: "anchorjs-icons";' + ' font-style: normal;' + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + ' }', - pseudoElContent = ' [data-anchorjs-icon]::after {' + + pseudoElContent = + ' [data-anchorjs-icon]::after {' + ' content: attr(data-anchorjs-icon);' + ' }', firstStyleEl; diff --git a/default_theme/assets/bass-addons.css b/src/default_theme/assets/bass-addons.css similarity index 100% rename from default_theme/assets/bass-addons.css rename to src/default_theme/assets/bass-addons.css diff --git a/default_theme/assets/bass.css b/src/default_theme/assets/bass.css similarity index 100% rename from default_theme/assets/bass.css rename to src/default_theme/assets/bass.css diff --git a/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot b/src/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot similarity index 100% rename from default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot rename to src/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot diff --git a/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot b/src/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot similarity index 100% rename from default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot rename to src/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot diff --git a/default_theme/assets/fonts/LICENSE.txt b/src/default_theme/assets/fonts/LICENSE.txt similarity index 100% rename from default_theme/assets/fonts/LICENSE.txt rename to src/default_theme/assets/fonts/LICENSE.txt diff --git a/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf b/src/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf similarity index 100% rename from default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf rename to src/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf diff --git a/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf b/src/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf similarity index 100% rename from default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf rename to src/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf diff --git a/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf b/src/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf similarity index 100% rename from default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf rename to src/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf diff --git a/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf b/src/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf similarity index 100% rename from default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf rename to src/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf diff --git a/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff b/src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff rename to src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff diff --git a/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff b/src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff rename to src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff diff --git a/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff b/src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff rename to src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff diff --git a/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff b/src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff rename to src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff diff --git a/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 b/src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 rename to src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 b/src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 rename to src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 b/src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 rename to src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 b/src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 rename to src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 diff --git a/default_theme/assets/fonts/source-code-pro.css b/src/default_theme/assets/fonts/source-code-pro.css similarity index 100% rename from default_theme/assets/fonts/source-code-pro.css rename to src/default_theme/assets/fonts/source-code-pro.css diff --git a/default_theme/assets/github.css b/src/default_theme/assets/github.css similarity index 100% rename from default_theme/assets/github.css rename to src/default_theme/assets/github.css diff --git a/default_theme/assets/site.js b/src/default_theme/assets/site.js similarity index 100% rename from default_theme/assets/site.js rename to src/default_theme/assets/site.js diff --git a/default_theme/assets/style.css b/src/default_theme/assets/style.css similarity index 100% rename from default_theme/assets/style.css rename to src/default_theme/assets/style.css diff --git a/default_theme/index._ b/src/default_theme/index._ similarity index 100% rename from default_theme/index._ rename to src/default_theme/index._ diff --git a/default_theme/index.js b/src/default_theme/index.js similarity index 96% rename from default_theme/index.js rename to src/default_theme/index.js index 1c5347215..48ef6682a 100644 --- a/default_theme/index.js +++ b/src/default_theme/index.js @@ -1,5 +1,3 @@ -'use strict'; - var fs = require('fs'), path = require('path'), File = require('vinyl'), @@ -12,8 +10,8 @@ var fs = require('fs'), hljs = require('highlight.js'); module.exports = function( - comments /*: Array */, - config /*: DocumentationConfig */ + comments: Array, + config: DocumentationConfig ) { var linkerStack = new LinkerStack( config @@ -108,7 +106,7 @@ module.exports = function( contents: new Buffer( pageTemplate({ docs: comments, - config: config + config }), 'utf8' ) diff --git a/default_theme/note._ b/src/default_theme/note._ similarity index 100% rename from default_theme/note._ rename to src/default_theme/note._ diff --git a/default_theme/section._ b/src/default_theme/section._ similarity index 100% rename from default_theme/section._ rename to src/default_theme/section._ diff --git a/default_theme/section_list._ b/src/default_theme/section_list._ similarity index 100% rename from default_theme/section_list._ rename to src/default_theme/section_list._ diff --git a/lib/extractors/comments.js b/src/extractors/comments.js similarity index 84% rename from lib/extractors/comments.js rename to src/extractors/comments.js index f6e4abaf7..8130e4dbe 100644 --- a/lib/extractors/comments.js +++ b/src/extractors/comments.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; -var traverse = require('babel-traverse').default, - isJSDocComment = require('../../lib/is_jsdoc_comment'); +import traverse from 'babel-traverse'; +var isJSDocComment = require('../is_jsdoc_comment'); /** * Iterate through the abstract syntax tree, finding a different kind of comment @@ -16,12 +15,12 @@ var traverse = require('babel-traverse').default, * @private */ function walkComments( - type /*: string*/, - includeContext /*: boolean*/, - ast /*: Object*/, - data /*: Object*/, - addComment /*: Function*/ -) /*: Array*/ { + type: string, + includeContext: boolean, + ast: Object, + data: Object, + addComment: Function +): Array { var newResults = []; traverse(ast, { diff --git a/lib/extractors/exported.js b/src/extractors/exported.js similarity index 95% rename from lib/extractors/exported.js rename to src/extractors/exported.js index 8e00ae917..e9be88a44 100644 --- a/lib/extractors/exported.js +++ b/src/extractors/exported.js @@ -1,12 +1,11 @@ /* @flow */ -'use strict'; -var traverse = require('babel-traverse').default, - isJSDocComment = require('../../lib/is_jsdoc_comment'), - t = require('babel-types'), - nodePath = require('path'), - fs = require('fs'), - parseToAst = require('../parsers/parse_to_ast'), - findTarget = require('../infer/finders').findTarget; +import traverse from 'babel-traverse'; +var isJSDocComment = require('../is_jsdoc_comment'); +var t = require('babel-types'); +var nodePath = require('path'); +var fs = require('fs'); +import { parseToAst } from '../parsers/parse_to_ast'; +var findTarget = require('../infer/finders').findTarget; /** * Iterate through the abstract syntax tree, finding ES6-style exports, @@ -20,11 +19,11 @@ var traverse = require('babel-traverse').default, * @private */ function walkExported( - ast /*: Object */, + ast: Object, data /*: { file: string } */, - addComment /*: Function */ + addComment: Function ) { var newResults = []; var filename = data.file; diff --git a/lib/filter_access.js b/src/filter_access.js similarity index 81% rename from lib/filter_access.js rename to src/filter_access.js index 5cfe53650..94fb89495 100644 --- a/lib/filter_access.js +++ b/src/filter_access.js @@ -1,7 +1,6 @@ -'use strict'; /* @flow */ -var walk = require('./walk'); +import { walk } from './walk'; /** * Exclude given access levels from the generated documentation: this allows @@ -12,15 +11,14 @@ var walk = require('./walk'); * @param {Array} comments parsed comments (can be nested) * @return {Array} filtered comments */ -function filterAccess( - levels /*: Array*/, - comments /*: Array*/ -) { +function filterAccess(levels: Array, comments: Array) { levels = levels || ['public', 'undefined', 'protected']; function filter(comment) { - return comment.kind === 'note' || - (!comment.ignore && levels.indexOf(String(comment.access)) !== -1); + return ( + comment.kind === 'note' || + (!comment.ignore && levels.indexOf(String(comment.access)) !== -1) + ); } function recurse(comment) { diff --git a/lib/flow_doctrine.js b/src/flow_doctrine.js similarity index 98% rename from lib/flow_doctrine.js rename to src/flow_doctrine.js index dd1d7b004..031c4124e 100644 --- a/lib/flow_doctrine.js +++ b/src/flow_doctrine.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ const generate = require('babel-generator').default; @@ -44,7 +43,7 @@ function propertyToField(property) { * @param {Object} type babel-parsed flow type * @returns {Object} doctrine compatible type */ -function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { +function flowDoctrine(type: Object): DoctrineType { if (type.type in namedTypes) { let doctrineType = { type: 'NameExpression', @@ -68,7 +67,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { type: 'UnionType', elements: type.types.map(flowDoctrine) }; - // [number] // [string, boolean, number] case 'TupleTypeAnnotation': @@ -76,7 +74,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { type: 'ArrayType', elements: type.types.map(flowDoctrine) }; - // number[] case 'ArrayTypeAnnotation': return { @@ -87,7 +84,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { }, applications: [flowDoctrine(type.elementType)] }; - // (y: number) => bool case 'FunctionTypeAnnotation': return { diff --git a/lib/garbage_collect.js b/src/garbage_collect.js similarity index 66% rename from lib/garbage_collect.js rename to src/garbage_collect.js index 38569298a..78a698d4e 100644 --- a/lib/garbage_collect.js +++ b/src/garbage_collect.js @@ -1,6 +1,5 @@ /* @flow */ -'use strict'; -function garbageCollect(comment /*: Comment*/) { +function garbageCollect(comment: Comment) { delete comment.context.code; delete comment.context.ast; return comment; diff --git a/lib/git/find_git.js b/src/git/find_git.js similarity index 90% rename from lib/git/find_git.js rename to src/git/find_git.js index e3f342415..8dfb0e8e5 100644 --- a/lib/git/find_git.js +++ b/src/git/find_git.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var path = require('path'); @@ -10,7 +9,7 @@ var fs = require('fs'); * @param filename any file within a repository * @returns repository path */ -function findGit(filename /*: string*/) { +function findGit(filename: string) { var paths = filename.split(path.sep); for (var i = paths.length; i > 0; i--) { var p = path.resolve(paths.slice(0, i).join(path.sep) + path.sep + '.git'); diff --git a/lib/git/url_prefix.js b/src/git/url_prefix.js similarity index 87% rename from lib/git/url_prefix.js rename to src/git/url_prefix.js index 1e0972df6..07562a5aa 100644 --- a/lib/git/url_prefix.js +++ b/src/git/url_prefix.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var fs = require('fs'); var path = require('path'); var gitUrlParse = require('git-url-parse'); @@ -20,13 +19,10 @@ function parsePackedRefs(packedRefs, branchName) { return packedRefs .split(/\n/) .filter(line => line[0] !== '#' && line[0] !== '^') - .reduce( - (memo, line) => { - memo[line.split(' ')[1]] = line.split(' ')[0]; - return memo; - }, - {} - )[branchName]; + .reduce((memo, line) => { + memo[line.split(' ')[1]] = line.split(' ')[0]; + return memo; + }, {})[branchName]; } /** @@ -37,7 +33,7 @@ function parsePackedRefs(packedRefs, branchName) { * @returns {string} base HTTPS url of the GitHub repository * @throws {Error} if the root is not a git repo */ -function getGithubURLPrefix(root /*: string*/) { +function getGithubURLPrefix(root: string) { var sha; try { var head = fs.readFileSync(path.join(root, '.git', 'HEAD'), 'utf8'); @@ -62,10 +58,12 @@ function getGithubURLPrefix(root /*: string*/) { sha = head; } if (sha) { - return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + + return ( + gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + '/blob/' + sha.trim() + - '/'; + '/' + ); } } catch (e) { return null; diff --git a/lib/github.js b/src/github.js similarity index 81% rename from lib/github.js rename to src/github.js index ac0462262..c25817e47 100644 --- a/lib/github.js +++ b/src/github.js @@ -1,9 +1,8 @@ -'use strict'; /* @flow */ var path = require('path'); -var findGit = require('../lib/git/find_git'); -var getGithubURLPrefix = require('../lib/git/url_prefix'); +var findGit = require('./git/find_git'); +var getGithubURLPrefix = require('./git/url_prefix'); /** * Attempts to link code to its place on GitHub. @@ -12,7 +11,7 @@ var getGithubURLPrefix = require('../lib/git/url_prefix'); * @param {Object} comment parsed comment * @return {Object} comment with github inferred */ -module.exports = function(comment /*: Comment*/) { +module.exports = function(comment: Comment) { var repoPath = findGit(comment.context.file); var root = repoPath ? path.dirname(repoPath) : '.'; var urlPrefix = getGithubURLPrefix(root); diff --git a/lib/hierarchy.js b/src/hierarchy.js similarity index 88% rename from lib/hierarchy.js rename to src/hierarchy.js index 59776eb57..f8bb120fb 100644 --- a/lib/hierarchy.js +++ b/src/hierarchy.js @@ -1,5 +1,3 @@ -'use strict'; - var _ = require('lodash'); var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -29,12 +27,12 @@ let getMembers = () => ({ * @returns reduced comment * @private */ -function pick(comment /*: Comment */) /*: ?ReducedComment */ { +function pick(comment) { if (typeof comment.name !== 'string') { return undefined; } - var item /*: ReducedComment */ = { + var item = { name: comment.name, kind: comment.kind }; @@ -51,7 +49,7 @@ function pick(comment /*: Comment */) /*: ?ReducedComment */ { * @returns {Array} nested comments, with only root comments * at the top level. */ -module.exports = function(comments /*: Array*/) { +module.exports = function(comments) { var id = 0, root = { members: getMembers() @@ -175,26 +173,23 @@ module.exports = function(comments /*: Array*/) { global: '' }; - comment.namespace = comment.path.reduce( - (memo, part) => { - if (part.kind === 'event') { - return memo + '.event:' + part.name; - } - let scopeChar = ''; - if (part.scope) { - scopeChar = scopeChars[part.scope]; - } - return memo + scopeChar + part.name; - }, - '' - ); + comment.namespace = comment.path.reduce((memo, part) => { + if (part.kind === 'event') { + return memo + '.event:' + part.name; + } + let scopeChar = ''; + if (part.scope) { + scopeChar = scopeChars[part.scope]; + } + return memo + scopeChar + part.name; + }, ''); if (hasUndefinedParent) { var memberOfTag = comment.tags.filter( tag => tag.title === 'memberof' )[0]; - var memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || - 0; + var memberOfTagLineNumber = + (memberOfTag && memberOfTag.lineNumber) || 0; comment.errors.push({ message: `@memberof reference to ${comment.memberof} not found`, diff --git a/lib/index.js b/src/index.js similarity index 93% rename from lib/index.js rename to src/index.js index 653cb43d2..e06f04986 100644 --- a/lib/index.js +++ b/src/index.js @@ -1,5 +1,3 @@ -'use strict'; - var fs = require('fs'), _ = require('lodash'), sort = require('./sort'), @@ -44,10 +42,7 @@ function pipeline(fns) { }; } -function configure( - indexes /*: Array */, - args /*: Object */ -) /*: Promise */ { +function configure(indexes, args) { let mergedConfig = mergeConfig(args); return mergedConfig.then(config => { @@ -70,10 +65,7 @@ function configure( * @param {Object} config options * @returns {Promise>} promise with results */ -function expandInputs( - indexes /*: string|Array */, - config /*: DocumentationConfig */ -) { +function expandInputs(indexes, config) { // Ensure that indexes is an array of strings indexes = [].concat(indexes); @@ -187,8 +179,7 @@ function lintInternal(inputsAndConfig) { * } * }); */ -let lint = (indexes /*: Array */, args) => - configure(indexes, args).then(lintInternal); +let lint = (indexes, args) => configure(indexes, args).then(lintInternal); /** * Generate JavaScript documentation as a list of parsed JSDoc @@ -231,8 +222,7 @@ let lint = (indexes /*: Array */, args) => * // any other kind of code data. * }); */ -let build = (indexes /*: Array */, args /*: Object */) => - configure(indexes, args).then(buildInternal); +let build = (indexes, args) => configure(indexes, args).then(buildInternal); /** * Documentation's formats are modular methods that take comments @@ -244,7 +234,7 @@ let build = (indexes /*: Array */, args /*: Object */) => var formats = { html: require('./output/html'), md: require('./output/markdown'), - remark: (comments /*: Array */, config /*: DocumentationConfig */) => + remark: (comments, config) => markdownAST(comments, config).then(res => JSON.stringify(res, null, 2)), json: require('./output/json') }; diff --git a/lib/infer/access.js b/src/infer/access.js similarity index 86% rename from lib/infer/access.js rename to src/infer/access.js index 1141fd501..5908b2a87 100644 --- a/lib/infer/access.js +++ b/src/infer/access.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ /** @@ -9,7 +8,7 @@ * @returns {Function} inference method * @private */ -function inferAccessWithPattern(pattern /*: ?string*/) { +function inferAccessWithPattern(pattern: ?string) { var re = pattern && new RegExp(pattern); /** @@ -19,7 +18,7 @@ function inferAccessWithPattern(pattern /*: ?string*/) { * @param {Object} comment parsed comment * @returns {Object} comment with access inferred */ - return function inferAccess(comment /*: Comment */) { + return function inferAccess(comment: Comment) { // This needs to run after inferName beacuse we infer the access based on // the name. if ( diff --git a/lib/infer/augments.js b/src/infer/augments.js similarity index 87% rename from lib/infer/augments.js rename to src/infer/augments.js index 988df7dbe..1801eefb5 100644 --- a/lib/infer/augments.js +++ b/src/infer/augments.js @@ -1,8 +1,7 @@ -'use strict'; /* @flow */ -var generate = require('babel-generator').default, - findTarget = require('./finders').findTarget; +import generate from 'babel-generator'; +var findTarget = require('./finders').findTarget; /** * Infers an `augments` tag from an ES6 class declaration @@ -10,7 +9,7 @@ var generate = require('babel-generator').default, * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferAugments(comment /*: Comment */) { +function inferAugments(comment: Comment) { if (comment.augments.length) { return comment; } diff --git a/lib/infer/finders.js b/src/infer/finders.js similarity index 94% rename from lib/infer/finders.js rename to src/infer/finders.js index f3cd5d88d..645c22b86 100644 --- a/lib/infer/finders.js +++ b/src/infer/finders.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var t = require('babel-types'); @@ -11,7 +10,7 @@ var t = require('babel-types'); * @returns {?Object} ast path, if one is found. * @private */ -function findTarget(path /*: Object */) { +function findTarget(path: Object) { if (!path) { return path; } diff --git a/lib/infer/kind.js b/src/infer/kind.js similarity index 96% rename from lib/infer/kind.js rename to src/infer/kind.js index a92ac5746..be0310927 100644 --- a/lib/infer/kind.js +++ b/src/infer/kind.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var t = require('babel-types'); @@ -9,7 +8,7 @@ var t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferKind(comment /*: Comment*/) { +function inferKind(comment: Comment) { if (comment.kind) { return comment; } diff --git a/lib/infer/membership.js b/src/infer/membership.js similarity index 96% rename from lib/infer/membership.js rename to src/infer/membership.js index ecf558374..2b2f852da 100644 --- a/lib/infer/membership.js +++ b/src/infer/membership.js @@ -1,14 +1,15 @@ -'use strict'; /* @flow */ var n = require('babel-types'), pathParse = require('parse-filepath'), - isJSDocComment = require('../../lib/is_jsdoc_comment'), - parse = require('../../lib/parse'); + isJSDocComment = require('../is_jsdoc_comment'), + parse = require('../parse'); function inferModuleName(comment) { - return (comment.kind === 'module' && comment.name) || - pathParse(comment.context.file).name; + return ( + (comment.kind === 'module' && comment.name) || + pathParse(comment.context.file).name + ); } /** @@ -155,7 +156,7 @@ function countModuleIdentifiers(comment, identifiers) { * @param comment parsed comment * @returns the normalized comment */ -function normalizeMemberof(comment /*: Comment*/) /*: Comment */ { +function normalizeMemberof(comment: Comment): Comment { if (typeof comment.memberof != 'string') { return comment; } @@ -240,7 +241,7 @@ module.exports = function() { return comment; } - function shouldSkipInference(comment /*: Comment */) /*: boolean */ { + function shouldSkipInference(comment: Comment): boolean { // If someone uses the @name tag, they explicitly ask for inference // to be skipped. if (comment.tags.some(tag => tag.title === 'name')) { @@ -262,7 +263,7 @@ module.exports = function() { return false; } - return function inferMembership(comment /*: Comment */) { + return function inferMembership(comment: Comment) { // First skip inference if the user indicates it or if it isn't possible. if (shouldSkipInference(comment)) { return comment; @@ -382,7 +383,8 @@ module.exports = function() { if (objectParent) { // The @lends comment is sometimes attached to the first property rather than // the object expression itself. - var lendsIdentifiers = findLendsIdentifiers(objectParent) || + var lendsIdentifiers = + findLendsIdentifiers(objectParent) || findLendsIdentifiers(objectParent.get('properties')[0]); if (lendsIdentifiers) { diff --git a/lib/infer/name.js b/src/infer/name.js similarity index 95% rename from lib/infer/name.js rename to src/infer/name.js index 17bba104d..99048ffe6 100644 --- a/lib/infer/name.js +++ b/src/infer/name.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var pathParse = require('parse-filepath'), t = require('babel-types'); @@ -10,7 +9,7 @@ var pathParse = require('parse-filepath'), t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with name inferred */ -function inferName(comment /*: Comment */) { +function inferName(comment: Comment) { if (comment.name) { return comment; } @@ -75,7 +74,8 @@ function inferName(comment /*: Comment */) { */ StringLiteral(path) { if ( - path.parent.type === 'ObjectProperty' && path.node === path.parent.key + path.parent.type === 'ObjectProperty' && + path.node === path.parent.key ) { if (inferName(path, path.node)) { path.stop(); diff --git a/lib/infer/params.js b/src/infer/params.js similarity index 94% rename from lib/infer/params.js rename to src/infer/params.js index cb655f56f..cb9791000 100644 --- a/lib/infer/params.js +++ b/src/infer/params.js @@ -1,11 +1,10 @@ -'use strict'; /* @flow */ -const t = require('babel-types'); -const generate = require('babel-generator').default; -const _ = require('lodash'); -const findTarget = require('./finders').findTarget; -const flowDoctrine = require('../flow_doctrine'); +import * as t from 'babel-types'; +import generate from 'babel-generator'; +import _ from 'lodash'; +import finders from './finders'; +import flowDoctrine from '../flow_doctrine'; /** * Infers param tags by reading function parameter names @@ -13,8 +12,8 @@ const flowDoctrine = require('../flow_doctrine'); * @param {Object} comment parsed comment * @returns {Object} comment with parameters */ -function inferParams(comment /*: Comment */) { - var path = findTarget(comment.context.ast); +function inferParams(comment: Comment) { + var path = finders.findTarget(comment.context.ast); // In case of `/** */ var x = function () {}` findTarget returns // the declarator. @@ -56,7 +55,7 @@ function inferAndCombineParams(params, comment) { // const PATH_SPLIT_CAPTURING = /(\[])?(\.)/g; const PATH_SPLIT = /(?:\[])?\./g; -function tagDepth(tag /*: CommentTag */) /*: number */ { +function tagDepth(tag: CommentTag): number { return (tag.name || '').split(PATH_SPLIT).length; } @@ -90,9 +89,9 @@ function mapTags(tags) { */ function paramToDoc( param, - prefix /*: string */, - i /*: ?number */ -) /*: CommentTag|Array */ { + prefix: string, + i: ?number +): CommentTag | Array { const autoName = '$' + String(i); const prefixedName = prefix + '.' + param.name; @@ -194,7 +193,7 @@ function paramToDoc( } case 'RestProperty': // (a, ...b) case 'RestElement': { - let type /*: DoctrineType */ = { + let type: DoctrineType = { type: 'RestType' }; if (param.typeAnnotation) { @@ -209,7 +208,7 @@ function paramToDoc( } default: { // (a) - var newParam /*: CommentTag*/ = { + var newParam: CommentTag = { title: 'param', name: prefix ? prefixedName : param.name, lineNumber: param.loc.start.line @@ -327,8 +326,8 @@ function combineTags(inferredTag, explicitTag) { defaultValue = inferredTag.default; } - const hasProperties = (inferredTag.properties && - inferredTag.properties.length) || + const hasProperties = + (inferredTag.properties && inferredTag.properties.length) || (explicitTag.properties && explicitTag.properties.length); return _.assign( diff --git a/lib/infer/properties.js b/src/infer/properties.js similarity index 92% rename from lib/infer/properties.js rename to src/infer/properties.js index 375c92c6a..19b63dd95 100644 --- a/lib/infer/properties.js +++ b/src/infer/properties.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var flowDoctrine = require('../flow_doctrine'), @@ -11,7 +10,7 @@ function prefixedName(name, prefix) { return name; } -function propertyToDoc(property, prefix) /*: CommentTag */ { +function propertyToDoc(property, prefix): CommentTag { var type = flowDoctrine(property.value); if (property.optional) { type = { @@ -33,7 +32,7 @@ function propertyToDoc(property, prefix) /*: CommentTag */ { * @param {Object} comment parsed comment * @returns {Object} comment with inferred properties */ -function inferProperties(comment /*: Comment */) /*: Comment */ { +function inferProperties(comment: Comment): Comment { let explicitProperties = new Set(); // Ensure that explicitly specified properties are not overridden // by inferred properties diff --git a/lib/infer/return.js b/src/infer/return.js similarity index 94% rename from lib/infer/return.js rename to src/infer/return.js index 5e257f16d..e1bc147e5 100644 --- a/lib/infer/return.js +++ b/src/infer/return.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var findTarget = require('./finders').findTarget, @@ -12,7 +11,7 @@ var findTarget = require('./finders').findTarget, * @param {Object} comment parsed comment * @returns {Object} comment with return tag inferred */ -function inferReturn(comment /*: Comment */) { +function inferReturn(comment: Comment) { if ( Array.isArray(comment.returns) && comment.returns.length && diff --git a/lib/infer/type.js b/src/infer/type.js similarity index 95% rename from lib/infer/type.js rename to src/infer/type.js index 32af6c8e2..9d4d2b03a 100644 --- a/lib/infer/type.js +++ b/src/infer/type.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var findTarget = require('./finders').findTarget, @@ -18,7 +17,7 @@ var constTypeMapping = { * @param {Object} comment parsed comment * @returns {Object} comment with type tag inferred */ -function inferType(comment /*: Comment */) { +function inferType(comment: Comment) { if (comment.type) { return comment; } diff --git a/lib/inline_tokenizer.js b/src/inline_tokenizer.js similarity index 99% rename from lib/inline_tokenizer.js rename to src/inline_tokenizer.js index adfb85f40..30006cded 100644 --- a/lib/inline_tokenizer.js +++ b/src/inline_tokenizer.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Create a tokenizer method for Remark, our Markdown processor, diff --git a/lib/input/dependency.js b/src/input/dependency.js similarity index 82% rename from lib/input/dependency.js rename to src/input/dependency.js index c1bb5f1e8..add94a8f8 100644 --- a/lib/input/dependency.js +++ b/src/input/dependency.js @@ -1,11 +1,10 @@ -'use strict'; /* @flow */ var mdeps = require('module-deps-sortable'); var path = require('path'); var babelify = require('babelify'); var concat = require('concat-stream'); -var moduleFilters = require('../../lib/module_filters'); +var moduleFilters = require('../module_filters'); var smartGlob = require('../smart_glob.js'); /** @@ -20,9 +19,9 @@ var smartGlob = require('../smart_glob.js'); * @returns results */ function dependencyStream( - indexes /*: Array*/, - config /*: DocumentationConfig */ -) /*: Promise>*/ { + indexes: Array, + config: DocumentationConfig +): Promise> { var md = mdeps({ /** * Determine whether a module should be included in documentation @@ -66,11 +65,11 @@ function dependencyStream( inputs .filter( input => - // At this point, we may have allowed a JSON file to be caught by - // module-deps, or anything else allowed by requireExtension. - // otherwise module-deps would complain about - // it not being found. But Babel can't parse JSON, so we filter non-JavaScript - // files away. + // At this point, we may have allowed a JSON file to be caught by + // module-deps, or anything else allowed by requireExtension. + // otherwise module-deps would complain about + // it not being found. But Babel can't parse JSON, so we filter non-JavaScript + // files away. config.parseExtension.indexOf( path.extname(input.file).replace(/^\./, '') ) > -1 diff --git a/lib/input/shallow.js b/src/input/shallow.js similarity index 90% rename from lib/input/shallow.js rename to src/input/shallow.js index ed42fbe30..4ebf2cfaf 100644 --- a/lib/input/shallow.js +++ b/src/input/shallow.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var smartGlob = require('../smart_glob.js'); @@ -20,9 +19,9 @@ var smartGlob = require('../smart_glob.js'); * @return promise with parsed files */ module.exports = function( - indexes /*: Array*/, - config /*: DocumentationConfig */ -) /*: Promise>*/ { + indexes: Array, + config: DocumentationConfig +): Promise> { var objects = []; var strings = []; for (var index of indexes) { diff --git a/lib/is_jsdoc_comment.js b/src/is_jsdoc_comment.js similarity index 79% rename from lib/is_jsdoc_comment.js rename to src/is_jsdoc_comment.js index f76d76b5c..d24fb7a2e 100644 --- a/lib/is_jsdoc_comment.js +++ b/src/is_jsdoc_comment.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ /** @@ -20,8 +19,10 @@ module.exports = function isJSDocComment( }*/ ) { var asterisks = comment.value.match(/^(\*+)/); - return (comment.type === 'CommentBlock' || // estree - comment.type === 'Block') && // get-comments / traditional + return ( + (comment.type === 'CommentBlock' || // estree + comment.type === 'Block') && // get-comments / traditional asterisks && - asterisks[1].length === 1; + asterisks[1].length === 1 + ); }; diff --git a/lib/lint.js b/src/lint.js similarity index 86% rename from lib/lint.js rename to src/lint.js index b2fa03b0d..448c201ff 100644 --- a/lib/lint.js +++ b/src/lint.js @@ -1,10 +1,9 @@ -'use strict'; /* @flow */ -var VFile = require('vfile'), - walk = require('../lib/walk'), - vfileSort = require('vfile-sort'), - reporter = require('vfile-reporter'); +var VFile = require('vfile'); +import { walk } from './walk'; +import vfileSort from 'vfile-sort'; +import reporter from 'vfile-reporter'; var CANONICAL = { String: 'string', @@ -23,7 +22,7 @@ var CANONICAL = { * @param {Object} comment parsed comment * @returns {Array} array of errors */ -function lintComments(comment /*: Comment*/) { +function lintComments(comment: Comment) { comment.tags.forEach(function(tag) { function nameInvariant(name) { if (name && typeof CANONICAL[name] === 'string') { @@ -70,12 +69,13 @@ function lintComments(comment /*: Comment*/) { * @param {Array} comments a list of comments * @return {string} user-readable output */ -function formatLint(comments /*: Array*/) /*: string */ { +function formatLint(comments: Array): string { var vFiles = {}; walk(comments, function(comment) { comment.errors.forEach(function(error) { var p = comment.context.file; - vFiles[p] = vFiles[p] || + vFiles[p] = + vFiles[p] || new VFile({ path: p }); diff --git a/lib/merge_config.js b/src/merge_config.js similarity index 87% rename from lib/merge_config.js rename to src/merge_config.js index ad2e9f2c3..7d4cd8726 100644 --- a/lib/merge_config.js +++ b/src/merge_config.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var yaml = require('js-yaml'), @@ -9,10 +8,7 @@ var yaml = require('js-yaml'), path = require('path'), stripComments = require('strip-json-comments'); -function processToc( - config /*: DocumentationConfig */, - absFilePath /*: string*/ -) { +function processToc(config: DocumentationConfig, absFilePath: string) { if (!config || !config.toc) { return config; } @@ -36,7 +32,7 @@ function processToc( * @returns {Object} configuration with inferred parameters * @throws {Error} if the file cannot be read. */ -function mergePackage(config /*: Object */) /*: Promise */ { +function mergePackage(config: Object): Promise { if (config.noPackage) { return Promise.resolve(config); } @@ -50,7 +46,8 @@ function mergePackage(config /*: Object */) /*: Promise */ { (val, key) => `project-${key}` ), config - )) + ) + ) // Allow this to fail: this inference is not required. .catch(() => config) ); @@ -64,7 +61,7 @@ function mergePackage(config /*: Object */) /*: Promise */ { * @returns {Promise} configuration, if it can be parsed * @throws {Error} if the file cannot be read. */ -function mergeConfigFile(config) /*: Promise */ { +function mergeConfigFile(config): Promise { if (config && typeof config.config === 'string') { var filePath = config.config; var ext = path.extname(filePath); @@ -88,7 +85,7 @@ function mergeConfigFile(config) /*: Promise */ { return Promise.resolve(config || {}); } -function mergeConfig(config /*: Object */) /*: Promise */ { +function mergeConfig(config: Object): Promise { config.parseExtension = (config.parseExtension || []) .concat(['js', 'jsx', 'es5', 'es6']); diff --git a/lib/module_filters.js b/src/module_filters.js similarity index 89% rename from lib/module_filters.js rename to src/module_filters.js index 9cb4de09c..a288fa30f 100644 --- a/lib/module_filters.js +++ b/src/module_filters.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var path = require('path'); var micromatch = require('micromatch'); @@ -29,8 +28,8 @@ module.exports = { * options. */ externals: function externalModuleFilter( - indexes /*: Array*/, - options /*: Object*/ + indexes: Array, + options: Object ) { var externalFilters = false; if (options.external) { @@ -57,10 +56,11 @@ module.exports = { }); } - return function(id /*: string*/, file /*: string*/, pkg /*: Object*/) { + return function(id: string, file: string, pkg: Object) { var internal = internalModuleRegexp.test(id); - return internal || - (externalFilters && externalFilters.some(f => f(file, pkg))); + return ( + internal || (externalFilters && externalFilters.some(f => f(file, pkg))) + ); }; } }; diff --git a/lib/nest.js b/src/nest.js similarity index 92% rename from lib/nest.js rename to src/nest.js index b776e93c7..bf760449d 100644 --- a/lib/nest.js +++ b/src/nest.js @@ -1,13 +1,10 @@ /* @flow */ -'use strict'; var _ = require('lodash'); const PATH_SPLIT = /(?:\[])?\./g; -function removeUnnamedTags( - tags /*: Array */ -) /*: Array */ { +function removeUnnamedTags(tags: Array): Array { return tags.filter(tag => typeof tag.name === 'string'); } @@ -36,7 +33,7 @@ var tagDepth = tag => tag.name.split(PATH_SPLIT).length; * @returns {Object} nested comment */ var nestTag = ( - tags /*: Array */ + tags: Array // Use lodash here both for brevity and also because, unlike JavaScript's // sort, it's stable. ) => @@ -54,7 +51,8 @@ var nestTag = ( } else { // The recursive case: try to find the child that owns // this tag. - let child = node.properties && + let child = + node.properties && node.properties.find( property => parts[0] === _.last(property.name.split(PATH_SPLIT)) ); @@ -92,7 +90,7 @@ var nestTag = ( * @param {Object} comment input comment * @return {Object} nested comment */ -var nest = (comment /*: Comment*/) => +var nest = (comment: Comment) => _.assign(comment, { params: nestTag(comment.params), properties: nestTag(comment.properties) diff --git a/lib/output/highlighter.js b/src/output/highlighter.js similarity index 82% rename from lib/output/highlighter.js rename to src/output/highlighter.js index 639043337..90ce41731 100644 --- a/lib/output/highlighter.js +++ b/src/output/highlighter.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var visit = require('unist-util-visit'); var hljs = require('highlight.js'); @@ -13,13 +12,14 @@ var hljs = require('highlight.js'); function visitor(node) { if (node.lang) { node.type = 'html'; - node.value = "
" +
+    node.value =
+      "
" +
       hljs.highlightAuto(node.value, [node.lang]).value +
       '
'; } } -module.exports = function(ast /*: Object*/) { +module.exports = function(ast: Object) { visit(ast, 'code', visitor); return ast; }; diff --git a/lib/output/html.js b/src/output/html.js similarity index 87% rename from lib/output/html.js rename to src/output/html.js index f4ca68228..16a5f6f81 100644 --- a/lib/output/html.js +++ b/src/output/html.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var path = require('path'); @@ -24,9 +23,9 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments /*: Array*/, config /*: DocumentationConfig*/) { +function html(comments: Array, config: DocumentationConfig) { return mergeConfig(config).then(config => { - var themePath = '../../default_theme/'; + var themePath = '../default_theme/'; if (config.theme) { themePath = path.resolve(process.cwd(), config.theme); } diff --git a/lib/output/json.js b/src/output/json.js similarity index 85% rename from lib/output/json.js rename to src/output/json.js index 1e61b253b..a210c6362 100644 --- a/lib/output/json.js +++ b/src/output/json.js @@ -1,7 +1,6 @@ -'use strict'; /* @flow */ -var walk = require('../walk'); +import { walk } from '../walk'; /** * Formats documentation as a JSON string. @@ -20,7 +19,7 @@ var walk = require('../walk'); * fs.writeFileSync('./output.json', output); * }); */ -function json(comments /*: Array*/) /*: Promise*/ { +function json(comments: Array): Promise { walk(comments, comment => { delete comment.errors; if (comment.context) { diff --git a/lib/output/markdown.js b/src/output/markdown.js similarity index 87% rename from lib/output/markdown.js rename to src/output/markdown.js index 33f8456ef..29a3127e2 100644 --- a/lib/output/markdown.js +++ b/src/output/markdown.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var remark = require('remark'), markdownAST = require('./markdown_ast'); @@ -23,10 +22,7 @@ var remark = require('remark'), markdownAST = require('./markdown_ast'); * fs.writeFileSync('./output.md', output); * }); */ -function markdown( - comments /*: Array*/, - args /*: Object*/ -) /*: Promise */ { +function markdown(comments: Array, args: Object): Promise { return markdownAST(comments, args).then(ast => remark().stringify(ast)); } diff --git a/lib/output/markdown_ast.js b/src/output/markdown_ast.js similarity index 78% rename from lib/output/markdown_ast.js rename to src/output/markdown_ast.js index 2a7f10bec..ab1b1dae7 100644 --- a/lib/output/markdown_ast.js +++ b/src/output/markdown_ast.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var u = require('unist-builder'), remark = require('remark'), @@ -25,13 +24,13 @@ var DEFAULT_LANGUAGE = 'javascript'; * consult hljs.configure for the full list. * @returns {Promise} returns an eventual Markdown value */ -function markdownAST(comments /*: Array */, args /*: Object */) { +function markdownAST(comments: Array, args: Object) { return mergeConfig(args).then(config => buildMarkdownAST(comments, config)); } function buildMarkdownAST( - comments /*: Array */, - config /*: DocumentationConfig*/ + comments: Array, + config: DocumentationConfig ) { // Configure code highlighting var hljsOptions = config.hljs || {}; @@ -65,13 +64,15 @@ function buildMarkdownAST( * @param {Object} comment a single comment * @returns {Object} remark-compatible AST */ - function generate(depth /*: number */, comment /*: Comment */) { - function typeSection(comment /*: Comment */) { - return comment.type && - u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type))); + function generate(depth: number, comment: Comment) { + function typeSection(comment: Comment) { + return ( + comment.type && + u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type))) + ); } - function paramList(params /*: Array */) { + function paramList(params: Array) { if (params.length === 0) return []; return u( 'list', @@ -102,25 +103,30 @@ function buildMarkdownAST( ] .concat(param.properties && paramList(param.properties)) .filter(Boolean) - )) + ) + ) ); } - function paramSection(comment /*: Comment */) { - return comment.params.length > 0 && [ - u('strong', [u('text', 'Parameters')]), - paramList(comment.params) - ]; + function paramSection(comment: Comment) { + return ( + comment.params.length > 0 && [ + u('strong', [u('text', 'Parameters')]), + paramList(comment.params) + ] + ); } - function propertySection(comment /*: Comment */) { - return comment.properties.length > 0 && [ - u('strong', [u('text', 'Properties')]), - propertyList(comment.properties) - ]; + function propertySection(comment: Comment) { + return ( + comment.properties.length > 0 && [ + u('strong', [u('text', 'Properties')]), + propertyList(comment.properties) + ] + ); } - function propertyList(properties /*: Array */) { + function propertyList(properties: Array) { return u( 'list', { ordered: false }, @@ -143,33 +149,34 @@ function buildMarkdownAST( ), property.properties && propertyList(property.properties) ].filter(Boolean) - )) + ) + ) ); } - function examplesSection(comment /*: Comment */) { - return comment.examples.length > 0 && + function examplesSection(comment: Comment) { + return ( + comment.examples.length > 0 && [u('strong', [u('text', 'Examples')])].concat( - comment.examples.reduce( - function(memo, example) { - var language = hljsOptions.highlightAuto - ? hljs.highlightAuto(example.description).language - : DEFAULT_LANGUAGE; - return memo - .concat( - example.caption - ? [u('paragraph', [u('emphasis', example.caption)])] - : [] - ) - .concat([u('code', { lang: language }, example.description)]); - }, - [] - ) - ); + comment.examples.reduce(function(memo, example) { + var language = hljsOptions.highlightAuto + ? hljs.highlightAuto(example.description).language + : DEFAULT_LANGUAGE; + return memo + .concat( + example.caption + ? [u('paragraph', [u('emphasis', example.caption)])] + : [] + ) + .concat([u('code', { lang: language }, example.description)]); + }, []) + ) + ); } - function returnsSection(comment /*: Comment */) { - return comment.returns.length > 0 && + function returnsSection(comment: Comment) { + return ( + comment.returns.length > 0 && comment.returns.map(returns => u( 'paragraph', @@ -178,11 +185,14 @@ function buildMarkdownAST( u('strong', formatType(returns.type)), u('text', ' ') ].concat(returns.description ? returns.description.children : []) - )); + ) + ) + ); } - function throwsSection(comment /*: Comment */) { - return comment.throws.length > 0 && + function throwsSection(comment: Comment) { + return ( + comment.throws.length > 0 && u( 'list', { ordered: false }, @@ -198,34 +208,42 @@ function buildMarkdownAST( returns.description ? returns.description.children : [] ) ) - ])) - ); + ]) + ) + ) + ); } - function augmentsLink(comment /*: Comment */) { - return comment.augments.length > 0 && + function augmentsLink(comment: Comment) { + return ( + comment.augments.length > 0 && u('paragraph', [ u('strong', [ u('text', 'Extends '), u('text', comment.augments.map(tag => tag.name).join(', ')) ]) - ]); + ]) + ); } - function seeLink(comment /*: Comment */) { - return comment.sees.length > 0 && + function seeLink(comment: Comment) { + return ( + comment.sees.length > 0 && u( 'list', { ordered: false }, comment.sees.map(see => u('listItem', [ u('strong', [u('text', 'See: ')].concat(see.children)) - ])) - ); + ]) + ) + ) + ); } - function githubLink(comment /*: Comment */) { - return comment.context && + function githubLink(comment: Comment) { + return ( + comment.context && comment.context.github && u('paragraph', [ u( @@ -245,10 +263,11 @@ function buildMarkdownAST( ) ] ) - ]); + ]) + ); } - function metaSection(comment /*: Comment */) { + function metaSection(comment: Comment) { let meta = [ 'version', 'since', @@ -257,7 +276,8 @@ function buildMarkdownAST( 'license', 'deprecated' ].filter(tag => comment[tag]); - return !!meta.length && + return ( + !!meta.length && [u('strong', [u('text', 'Meta')])].concat( u( 'list', @@ -278,7 +298,8 @@ function buildMarkdownAST( ]); }) ) - ); + ) + ); } if (comment.kind === 'note') { diff --git a/lib/output/util/format_type.js b/src/output/util/format_type.js similarity index 98% rename from lib/output/util/format_type.js rename to src/output/util/format_type.js index 37d79b8b4..4e2ad406f 100644 --- a/lib/output/util/format_type.js +++ b/src/output/util/format_type.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var Syntax = require('doctrine-temporary-fork').Syntax, u = require('unist-builder'); @@ -101,7 +100,7 @@ function decorate(formatted, str, prefix) { * formatType({ type: 'NameExpression', name: 'String' })[0].url * // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' */ -function formatType(getHref /*: Function*/, node /*: ?Object */) { +function formatType(getHref: Function, node: ?Object) { var result = []; if (!node) { diff --git a/lib/output/util/formatters.js b/src/output/util/formatters.js similarity index 88% rename from lib/output/util/formatters.js rename to src/output/util/formatters.js index f371894a1..a5c523afe 100644 --- a/lib/output/util/formatters.js +++ b/src/output/util/formatters.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var remark = require('remark'), html = require('remark-html'), Syntax = require('doctrine-temporary-fork').Syntax, @@ -15,7 +14,7 @@ var remark = require('remark'), * @param getHref linker method * @returns {formatters} formatter object */ -module.exports = function(getHref /*: Function*/) { +module.exports = function(getHref: Function) { var rerouteLinks = _rerouteLinks.bind(undefined, getHref); var formatters = {}; @@ -29,10 +28,7 @@ module.exports = function(getHref /*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameter representation. */ - formatters.parameter = function( - param /*: Object*/, - short /*: boolean */ - ) /*: string */ { + formatters.parameter = function(param: Object, short: boolean): string { if (short) { if (param.type && param.type.type == Syntax.OptionalType) { if (param.default) { @@ -63,7 +59,7 @@ module.exports = function(getHref /*: Function*/) { * @param {Object} type doctrine-format type * @returns {string} HTML */ - formatters.type = function(type /*: Object*/) { + formatters.type = function(type: Object) { return formatters .markdown(u('root', formatType(getHref, type))) .replace(/\n/g, ''); @@ -74,7 +70,7 @@ module.exports = function(getHref /*: Function*/) { * @param {string} text inner text of the link * @returns {string} potentially linked HTML */ - formatters.autolink = function(text /*: string*/) { + formatters.autolink = function(text: string) { var href = getHref(text); if (href) { // TODO: this is a temporary fix until we drop remark 3.x support, @@ -105,18 +101,17 @@ module.exports = function(getHref /*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameters */ - formatters.parameters = function( - section /*: Comment*/, - short /*: boolean */ - ) { + formatters.parameters = function(section: Comment, short: boolean) { if (section.params) { - return '(' + + return ( + '(' + section.params .map(function(param) { return formatters.parameter(param, short); }) .join(', ') + - ')'; + ')' + ); } return '()'; }; diff --git a/lib/output/util/linker_stack.js b/src/output/util/linker_stack.js similarity index 90% rename from lib/output/util/linker_stack.js rename to src/output/util/linker_stack.js index 1d9dd6b7e..49569fcce 100644 --- a/lib/output/util/linker_stack.js +++ b/src/output/util/linker_stack.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; var globalsDocs = require('globals-docs'); -var walk = require('../../walk'); +import { walk } from '../../walk'; /** * Generate a linker method that links given hardcoded namepaths to URLs @@ -25,7 +24,7 @@ function pathsLinker(paths /* Object */) { * @param {*} input any input * @returns {*} any output */ -function firstPass(fns /*: Array */, input) { +function firstPass(fns: Array, input) { for (var i = 0; i < fns.length; i++) { var output = fns[i](input); if (output) { @@ -42,10 +41,10 @@ function firstPass(fns /*: Array */, input) { * @returns {Function} linker method */ class LinkerStack { - /* :: stack: Array */ - /* :: link: Function */ + stack: Array; + link: Function; - constructor(config /*: DocumentationConfig */) { + constructor(config: DocumentationConfig) { this.stack = []; if (config.defaultGlobals !== false) { @@ -85,7 +84,7 @@ class LinkerStack { * return '#' + slugger.slug(namespace); * }); */ - namespaceResolver(comments /*: Array */, resolver /*: Function */) { + namespaceResolver(comments: Array, resolver: Function) { var namespaces = {}; walk(comments, comment => { namespaces[comment.namespace] = true; @@ -107,7 +106,7 @@ class LinkerStack { * @returns {string?} URL target or maybe undefined * @private */ - _link(namepath /*: string */) { + _link(namepath: string) { return firstPass(this.stack, namepath); } } diff --git a/lib/output/util/reroute_links.js b/src/output/util/reroute_links.js similarity index 67% rename from lib/output/util/reroute_links.js rename to src/output/util/reroute_links.js index d8e902a3a..f5a189e37 100644 --- a/lib/output/util/reroute_links.js +++ b/src/output/util/reroute_links.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var visit = require('unist-util-visit'); /** @@ -9,13 +8,12 @@ var visit = require('unist-util-visit'); * @returns {Object} that ast with rerouted links * @private */ -module.exports = function rerouteLinks( - getHref /*: Function */, - ast /*: Object*/ -) { +module.exports = function rerouteLinks(getHref: Function, ast: Object) { visit(ast, 'link', function(node) { if ( - node.jsdoc && !node.url.match(/^(http|https|\.)/) && getHref(node.url) + node.jsdoc && + !node.url.match(/^(http|https|\.)/) && + getHref(node.url) ) { node.url = getHref(node.url); } diff --git a/lib/parse.js b/src/parse.js similarity index 98% rename from lib/parse.js rename to src/parse.js index d0d5f0a64..49b60d4de 100644 --- a/lib/parse.js +++ b/src/parse.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var doctrine = require('doctrine-temporary-fork'); @@ -115,7 +114,7 @@ var flatteners = { return; } - var example /*: CommentExample */ = { + var example: CommentExample = { description: tag.description }; @@ -236,7 +235,7 @@ var flatteners = { * @returns {undefined} has side-effects */ param(result, tag) { - var param /*: CommentTag */ = { + var param: CommentTag = { title: 'param', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -277,7 +276,7 @@ var flatteners = { * @returns {undefined} has side-effects */ property(result, tag) { - var property /*: CommentTag */ = { + var property: CommentTag = { title: 'property', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -322,7 +321,7 @@ var flatteners = { * @returns {undefined} has side-effects */ returns(result, tag) { - var returns /*: CommentTag */ = { + var returns: CommentTag = { description: parseMarkdown(tag.description), title: 'returns' }; @@ -567,11 +566,7 @@ function flattenKindShorthand(result, tag, key) { * @return {Comment} an object conforming to the * [documentation schema](https://github.com/documentationjs/api-json) */ -function parseJSDoc( - comment /*: string*/, - loc /*: ?Object*/, - context /*: ?Object*/ -) /*: Comment */ { +function parseJSDoc(comment: string, loc: ?Object, context: ?Object): Comment { var result = doctrine.parse(comment, { // have doctrine itself remove the comment asterisks from content unwrap: true, diff --git a/lib/parse_markdown.js b/src/parse_markdown.js similarity index 85% rename from lib/parse_markdown.js rename to src/parse_markdown.js index ae7dc5e6a..2e7d544f0 100644 --- a/lib/parse_markdown.js +++ b/src/parse_markdown.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var remark = require('remark'); var inlineTokenizer = require('./inline_tokenizer'); @@ -11,7 +10,7 @@ var inlineTokenizer = require('./inline_tokenizer'); * @returns {Object} abstract syntax tree * @private */ -function parseMarkdown(string /*: string */) { +function parseMarkdown(string: string) { return remark().use(inlineTokenizer).parse(string); } diff --git a/lib/parsers/README.md b/src/parsers/README.md similarity index 100% rename from lib/parsers/README.md rename to src/parsers/README.md diff --git a/lib/parsers/javascript.js b/src/parsers/javascript.js similarity index 89% rename from lib/parsers/javascript.js rename to src/parsers/javascript.js index f584cafc3..30690d1d3 100644 --- a/lib/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -1,14 +1,14 @@ -'use strict'; /* @flow */ var _ = require('lodash'), t = require('babel-types'), - parse = require('../../lib/parse'), + parse = require('../parse'), walkComments = require('../extractors/comments'), walkExported = require('../extractors/exported'), util = require('util'), - debuglog = util.debuglog('documentation'), - parseToAst = require('./parse_to_ast'); + debuglog = util.debuglog('documentation'); + +import { parseToAst } from './parse_to_ast'; /** * Left-pad a string so that it can be sorted lexicographically. We sort @@ -34,7 +34,7 @@ function leftPad(str, width) { * @param {Object} config config * @return {Array} an array of parsed comments */ -function parseJavaScript(data /*: Object*/, config /*: DocumentationConfig */) { +function parseJavaScript(data: Object, config: DocumentationConfig) { var visited = new Set(); var ast = parseToAst(data.source, data.file); @@ -63,11 +63,8 @@ function _addComment( ) { // Avoid visiting the same comment twice as a leading // and trailing node - var key = data.file + - ':' + - commentLoc.start.line + - ':' + - commentLoc.start.column; + var key = + data.file + ':' + commentLoc.start.line + ':' + commentLoc.start.column; if (!visited.has(key)) { visited.add(key); diff --git a/lib/parsers/parse_to_ast.js b/src/parsers/parse_to_ast.js similarity index 84% rename from lib/parsers/parse_to_ast.js rename to src/parsers/parse_to_ast.js index eaa15821f..e9720e538 100644 --- a/lib/parsers/parse_to_ast.js +++ b/src/parsers/parse_to_ast.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var babylon = require('babylon'); @@ -24,8 +23,6 @@ var opts = { ] }; -function parseToAst(source /*: string*/) { +export function parseToAst(source: string) { return babylon.parse(source, opts); } - -module.exports = parseToAst; diff --git a/lib/parsers/polyglot.js b/src/parsers/polyglot.js similarity index 81% rename from lib/parsers/polyglot.js rename to src/parsers/polyglot.js index 8c55cfde7..a323972bc 100644 --- a/lib/parsers/polyglot.js +++ b/src/parsers/polyglot.js @@ -1,10 +1,9 @@ -'use strict'; /* @flow */ var getComments = require('get-comments'), _ = require('lodash'), - isJSDocComment = require('../../lib/is_jsdoc_comment'), - parse = require('../../lib/parse'); + isJSDocComment = require('../is_jsdoc_comment'), + parse = require('../parse'); /** * Documentation stream parser: this receives a module-dep item, @@ -13,7 +12,7 @@ var getComments = require('get-comments'), * @param sourceFile a chunk of data provided by module-deps * @return {Array} adds to memo */ -function parsePolyglot(sourceFile /*: SourceFile*/) { +function parsePolyglot(sourceFile: SourceFile) { return getComments(sourceFile.source, true) .filter(isJSDocComment) .map(comment => { diff --git a/lib/serve/error_page.js b/src/serve/error_page.js similarity index 90% rename from lib/serve/error_page.js rename to src/serve/error_page.js index 1b71b0299..0978561e8 100644 --- a/lib/serve/error_page.js +++ b/src/serve/error_page.js @@ -1,10 +1,10 @@ /* @flow */ /* eslint no-console: 0 */ -'use strict'; var File = require('vinyl'); var ansiHTML = require('ansi-html'); -var template = ''; @@ -26,7 +26,7 @@ ansiHTML.setColors({ * @param error parse or generation error * @returns {Object} vinyl file object */ -function errorPage(error /*: Error*/) { +function errorPage(error: Error) { var errorText = error.toString(); console.error(error); if (error.codeFrame) { diff --git a/lib/serve/server.js b/src/serve/server.js similarity index 76% rename from lib/serve/server.js rename to src/serve/server.js index 93915d8af..75efca443 100644 --- a/lib/serve/server.js +++ b/src/serve/server.js @@ -2,7 +2,6 @@ // This file triggers https://github.com/prettier/prettier/issues/1151 -'use strict'; var http = require('http'), mime = require('mime'), pify = require('pify'), @@ -10,12 +9,10 @@ var http = require('http'), liveReload = require('tiny-lr'), sep = require('path').sep; -/* :: declare type ServerFile = { relative: string, contents: string }; -*/ /** * A static file server designed to support documentation.js's --serve @@ -27,18 +24,20 @@ declare type ServerFile = { * @param port server port to serve on. */ class Server extends EventEmitter { - /* :: _lr: Object; */ - /* :: _port: number; */ - /* :: _files: Array; */ - /* :: _http: http.Server; */ + _lr: Object; + _disableLiveReload: boolean; + _port: number; + _files: Array; + _http: http.Server; - constructor(port /*: number*/) { + constructor(port: number, disableLiveReload?: boolean) { super(); if (typeof port !== 'number') { throw new Error('port argument required to initialize a server'); } this._port = port; this._files = []; + this._disableLiveReload = !!disableLiveReload; } /** @@ -48,7 +47,7 @@ class Server extends EventEmitter { * @param files new content. replaces any previously-set content. * @returns {Server} self */ - setFiles(files /*: Array */) { + setFiles(files: Array) { this._files = files; if (this._lr) { this._lr.changed({ body: { files: '*' } }); @@ -66,10 +65,7 @@ class Server extends EventEmitter { * @returns {undefined} nothing * @private */ - handler( - request /*: http.IncomingMessage */, - response /*: http.ServerResponse */ - ) { + handler(request: http.IncomingMessage, response: http.ServerResponse) { var path = request.url.substring(1); if (path === '') { path = 'index.html'; @@ -88,8 +84,7 @@ class Server extends EventEmitter { response.end('Not found'); } - // prettier-ignore - start()/*: Promise */ { + start(): Promise { /* * Boot up the server's HTTP & LiveReload endpoints. This method * can be called multiple times. @@ -98,41 +93,37 @@ class Server extends EventEmitter { */ return new Promise(resolve => { // idempotent - if (this._lr) { - return resolve(true); + if (this._http) { + return resolve(this); } - this._lr = liveReload(); + if (!this._disableLiveReload) { + this._lr = liveReload(); + } this._http = http.createServer(this.handler.bind(this)); return Promise.all([ - pify(this._lr.listen.bind(this._lr))(35729), + this._lr && pify(this._lr.listen.bind(this._lr))(35729), pify(this._http.listen.bind(this._http))(this._port) ]).then(() => { this.emit('listening'); - return resolve(true); + return resolve(this); }); }); } - // prettier-ignore - stop()/*: Promise */ { + stop(): Promise { /* * Shut down the server's HTTP & LiveReload endpoints. This method * can be called multiple times. */ - return new Promise(resolve => { - // idempotent - if (!this._lr) { - return resolve(true); - } - - this._http.close(() => { - this._lr.close(); - delete this._http; - delete this._lr; - resolve(true); - }); + return Promise.all([ + this._http && this._http.close(), + this._lr && this._lr.close() + ]).then(() => { + delete this._http; + delete this._lr; + return this; }); } } diff --git a/lib/smart_glob.js b/src/smart_glob.js similarity index 95% rename from lib/smart_glob.js rename to src/smart_glob.js index 2eab29320..8dc026b88 100644 --- a/lib/smart_glob.js +++ b/src/smart_glob.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var fs = require('fs'); var path = require('path'); var glob = require('glob'); @@ -86,9 +85,7 @@ function resolveFileGlobPatterns(patterns, extensions) { * @param globPatterns Glob patterns. * @returns Resolved absolute filenames. */ -function listFilesToProcess( - globPatterns /*: Array*/ -) /*: Array */ { +function listFilesToProcess(globPatterns: Array): Array { var files = [], added = new Set(); var cwd = process.cwd(); @@ -127,10 +124,7 @@ function listFilesToProcess( return files; } -function smartGlob( - indexes /*: Array*/, - extensions /*: Array*/ -) { +function smartGlob(indexes: Array, extensions: Array) { return listFilesToProcess(resolveFileGlobPatterns(indexes, extensions)); } diff --git a/lib/sort.js b/src/sort.js similarity index 82% rename from lib/sort.js rename to src/sort.js index f6c85ae2a..2bc54bd51 100644 --- a/lib/sort.js +++ b/src/sort.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var parseMarkdown = require('./parse_markdown'); @@ -15,34 +14,25 @@ var fs = require('fs'); * @return {number} sorting value * @private */ -module.exports = function sortDocs( - comments /*: Array*/, - options /*: Object*/ -) { +module.exports = function sortDocs(comments: Array, options: Object) { if (!options || !options.toc) { return sortComments(comments, options && options.sortOrder); } - var indexes = options.toc.reduce( - function(memo, val, i) { - if (typeof val === 'object' && val.name) { - val.kind = 'note'; - memo[val.name] = i; - } else { - memo[val] = i; - } - return memo; - }, - Object.create(null) - ); - var toBeSorted = options.toc.reduce( - function(memo, val) { - if (typeof val === 'string') { - memo[val] = false; - } - return memo; - }, - Object.create(null) - ); + var indexes = options.toc.reduce(function(memo, val, i) { + if (typeof val === 'object' && val.name) { + val.kind = 'note'; + memo[val.name] = i; + } else { + memo[val] = i; + } + return memo; + }, Object.create(null)); + var toBeSorted = options.toc.reduce(function(memo, val) { + if (typeof val === 'string') { + memo[val] = false; + } + return memo; + }, Object.create(null)); // Table of contents 'theme' entries: defined as objects // in the YAML list var fixed = options.toc @@ -104,7 +94,7 @@ module.exports = function sortDocs( return fixed.concat(unfixed); }; -function compare(a /*: string */, b /*: string */) { +function compare(a: string, b: string) { return a.localeCompare(b, undefined, { caseFirst: 'upper' }); } diff --git a/lib/walk.js b/src/walk.js similarity index 79% rename from lib/walk.js rename to src/walk.js index c80bc2c10..28a3a2787 100644 --- a/lib/walk.js +++ b/src/walk.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Apply a function to all comments within a hierarchy: this iterates @@ -10,11 +9,7 @@ * @param {Object} [options] options passed through to walker function * @returns {Array} comments */ -function walk( - comments /*: Array*/, - fn /*: Function*/, - options /*: ?Object*/ -) { +export function walk(comments: Array, fn: Function, options: ?Object) { comments.forEach(comment => { fn(comment, options); for (var scope in comment.members) { @@ -23,5 +18,3 @@ function walk( }); return comments; } - -module.exports = walk; diff --git a/test/bin-readme.js b/test/bin-readme.js deleted file mode 100644 index 8b082d9da..000000000 --- a/test/bin-readme.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; -var test = require('tap').test, - path = require('path'), - os = require('os'), - exec = require('child_process').exec, - tmp = require('tmp'), - fs = require('fs-extra'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - - args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); - - exec(args.join(' '), options, callback); -} - -var UPDATE = !!process.env.UPDATE; - -test('readme command', function(group) { - var fixtures = path.join(__dirname, 'fixture/readme'); - var sourceFile = path.join(fixtures, 'index.js'); - - tmp.dir({ unsafeCleanup: true }, function(err, d) { - group.error(err); - fs.copySync( - path.join(fixtures, 'README.input.md'), - path.join(d, 'README.md') - ); - fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js')); - - // run tests after setting up temp dir - - group.test('--diff-only: changes needed', function(t) { - t.error(err); - var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - documentation( - ['readme index.js --diff-only -s API'], - { cwd: d }, - function(err, stdout, stderr) { - var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - t.ok(err); - t.notEqual(err.code, 0, 'exit nonzero'); - t.same(after, before, 'readme unchanged'); - t.end(); - } - ); - }); - - var expectedFile = path.join(fixtures, 'README.output.md'); - var expectedPath = path.join(fixtures, 'README.output.md'); - var expected = fs.readFileSync(expectedFile, 'utf-8'); - - group.test('updates README.md', function(t) { - documentation( - ['readme index.js -s API'], - { cwd: d }, - function(err, stdout) { - var outputPath = path.join(d, 'README.md'); - t.error(err); - - if (UPDATE) { - fs.writeFileSync( - expectedPath, - fs.readFileSync(outputPath, 'utf-8') - ); - } - - var actual = fs.readFileSync(outputPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - } - ); - }); - - group.test('--readme-file', function(t) { - fs.copySync( - path.join(fixtures, 'README.input.md'), - path.join(d, 'other.md') - ); - documentation( - ['readme index.js -s API --readme-file other.md'], - { cwd: d }, - function(err, stdout) { - t.error(err); - var actualPath = path.join(d, 'other.md'); - if (UPDATE) { - fs.writeFileSync(actualPath, expected); - } - var actual = fs.readFileSync(actualPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - } - ); - }); - - group.test('--diff-only: changes NOT needed', function(t) { - t.error(err); - fs.copySync( - path.join(fixtures, 'README.output.md'), - path.join(d, 'uptodate.md') - ); - documentation( - ['readme index.js --diff-only -s API --readme-file uptodate.md'], - { cwd: d }, - function(err, stdout, stderr) { - t.error(err); - t.match(stdout, 'is up to date.'); - t.end(); - } - ); - }); - - group.test('-s: not found', function(t) { - t.error(err); - fs.copySync( - path.join(fixtures, 'README.output.md'), - path.join(d, 'uptodate.md') - ); - documentation( - ['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.end(); - } - ); - }); - - group.test('requires -s option', function(t) { - documentation( - ['readme index.js'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.match(stderr, 'Missing required argument: s'); - t.end(); - } - ); - }); - - var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input'); - group.test('errors on invalid syntax', function(t) { - documentation( - ['readme ' + badFixturePath + ' -s API --parseExtension input'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.end(); - } - ); - }); - - group.end(); - }); -}); diff --git a/test/bin-watch-serve.js b/test/bin-watch-serve.js deleted file mode 100644 index 93036251f..000000000 --- a/test/bin-watch-serve.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - os = require('os'), - get = require('./utils').get, - spawn = require('child_process').spawn, - fs = require('fs'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); - - return spawn('node', args, options); -} - -function normalize(result) { - result.forEach(function(item) { - item.context.file = '[path]'; - }); - return result; -} - -var options = { timeout: 1000 * 120 }; - -test('harness', options, function(t) { - var docProcess = documentation(['fixture/simple.input.js', '--serve']); - t.ok(docProcess, 'creates a subprocess object'); - docProcess.kill(); - t.end(); -}); - -test('provides index.html', options, function(t) { - var docProcess = documentation(['serve', 'fixture/simple.input.js']); - docProcess.stdout.on('data', function(data) { - t.equal( - data.toString().trim(), - 'documentation.js serving on port 4001', - 'shows listening message' - ); - get('http://localhost:4001/', function(text) { - t.ok(text.match(//), 'sends an html index file'); - docProcess.kill(); - t.end(); - }); - }); -}); - -test('accepts port argument', options, function(t) { - var docProcess = documentation([ - 'serve', - 'fixture/simple.input.js', - '--port=4004' - ]); - docProcess.stdout.on('data', function(data) { - t.equal( - data.toString().trim(), - 'documentation.js serving on port 4004', - 'shows listening message' - ); - get('http://localhost:4004/', function(text) { - t.ok(text.match(//), 'sends an html index file'); - docProcess.kill(); - t.end(); - }); - }); -}); - -test('--watch', options, function(t) { - var tmpFile = path.join(os.tmpdir(), '/simple.js'); - fs.writeFileSync(tmpFile, '/** a function */function apples() {}'); - var docProcess = documentation(['serve', tmpFile, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/apples/), 'sends an html index file'); - fs.writeFileSync(tmpFile, '/** a function */function bananas() {}'); - function doGet() { - get('http://localhost:4001/', function(text) { - if (text.match(/bananas/)) { - docProcess.kill(); - t.end(); - } else { - setTimeout(doGet, 100); - } - }); - } - doGet(); - }); - }); -}); - -test('--watch', options, function(t) { - var tmpDir = os.tmpdir(); - var a = path.join(tmpDir, '/simple.js'); - var b = path.join(tmpDir, '/required.js'); - fs.writeFileSync(a, 'require("./required")'); - fs.writeFileSync(b, '/** soup */function soup() {}'); - var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/soup/), 'sends an html index file'); - fs.writeFileSync(b, '/** nuts */function nuts() {}'); - function doGet() { - get('http://localhost:4001/', function(text) { - if (text.match(/nuts/)) { - docProcess.kill(); - t.end(); - } else { - setTimeout(doGet, 100); - } - }); - } - doGet(); - }); - }); -}); - -test('error page', options, function(t) { - var tmpDir = os.tmpdir(); - var a = path.join(tmpDir, '/simple.js'); - fs.writeFileSync(a, '**'); - var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/Unexpected token/), 'emits an error page'); - docProcess.kill(); - t.end(); - }); - }); -}); diff --git a/test/bin.js b/test/bin.js deleted file mode 100644 index 9b412b493..000000000 --- a/test/bin.js +++ /dev/null @@ -1,593 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - os = require('os'), - exec = require('child_process').exec, - tmp = require('tmp'), - fs = require('fs-extra'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - parseJSON = callback; - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - - args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); - - exec(args.join(' '), options, function(err, stdout, stderr) { - if (err) { - return callback(err, stdout, stderr); - } - if (parseJSON === false) { - callback(err, stdout, stderr); - } else { - callback(err, JSON.parse(stdout), stderr); - } - }); -} - -function normalize(result) { - result.forEach(function(item) { - item.context.file = '[path]'; - }); - return result; -} - -var options = { timeout: 1000 * 120 }; - -test('documentation binary', options, function(t) { - documentation(['build fixture/simple.input.js'], function(err, data) { - t.error(err); - t.equal(data.length, 1, 'simple has no dependencies'); - t.end(); - }); -}); - -test('defaults to parsing package.json main', options, function(t) { - documentation( - ['build'], - { cwd: path.join(__dirname, '..') }, - function(err, data) { - t.error(err); - t.ok(data.length, 'we document ourself'); - t.end(); - } - ); -}); - -test('polyglot mode', options, function(t) { - documentation( - ['build fixture/polyglot/blend.cpp --polyglot'], - function(err, data) { - t.ifError(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), - JSON.stringify(normalize(data), null, 2), - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), - 'utf8' - ); - t.deepEqual(normalize(data), JSON.parse(expected), 'parsed C++ file'); - t.end(); - } - ); -}); - -test('accepts config file', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config.json'], - function(err, data) { - t.error(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output.json'), - JSON.stringify(normalize(data), null, 2), - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output.json'), - 'utf8' - ); - t.deepEqual( - normalize(data), - JSON.parse(expected), - 'respected sort order from config file' - ); - t.end(); - } - ); -}); - -test('accepts config file - reports failures', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config-bad.yml'], - {}, - function(err, data, stderr) { - t.error(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), - stderr, - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), - 'utf8' - ); - t.equal(stderr, expected, 'reported a missing toc entry'); - t.end(); - }, - false - ); -}); - -test('accepts config file - reports parse failures', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config-malformed.json'], - {}, - function(err, data, stderr) { - t.match(stderr, /SyntaxError/g, 'Reports a SyntaxError with bad config'); - t.end(); - }, - false - ); -}); - -test('--shallow option', function(t) { - documentation( - ['build --shallow fixture/internal.input.js'], - function(err, data) { - t.error(err); - t.equal(data.length, 0, 'should not check dependencies'); - t.end(); - } - ); -}); - -test('external modules option', function(t) { - documentation( - [ - 'build fixture/external.input.js ' + - '--external=external --external=external/node_modules' - ], - function(err, data) { - t.ifError(err); - t.equal(data.length, 2, 'Includes external file'); - t.end(); - } - ); -}); - -test('when a file is specified both in a glob and explicitly, it is only documented once', function(t) { - documentation( - ['build fixture/simple.input.js fixture/simple.input.*'], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'File is documented only once'); - t.end(); - } - ); -}); - -test('extension option', function(t) { - documentation( - [ - 'build fixture/extension/index.otherextension ' + - '--requireExtension=otherextension --parseExtension=otherextension' - ], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - } - ); -}); - -/* - * This tests that parseExtension adds extensions to smartGlob's - * look through directories. - */ -test('polyglot + parseExtension + smartGlob', function(t) { - documentation( - ['build fixture/polyglot ' + '--polyglot --parseExtension=cpp'], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - } - ); -}); - -test('extension option', function(t) { - documentation(['build fixture/extension.jsx'], function(err, data) { - t.ifError(err); - t.end(); - }); -}); - -test('invalid arguments', function(group) { - group.test('bad -f option', options, function(t) { - documentation( - ['build -f DOES-NOT-EXIST fixture/internal.input.js'], - {}, - function(err) { - t.ok(err, 'returns error'); - t.end(); - }, - false - ); - }); - - group.test('html with no destination', options, function(t) { - documentation(['build -f html fixture/internal.input.js'], function(err) { - t.ok( - err - .toString() - .match( - /The HTML output mode requires a destination directory set with -o/ - ), - 'needs dest for html' - ); - t.end(); - }); - }); - - group.test('bad command', function(t) { - documentation( - ['-f html fixture/internal.input.js'], - {}, - function(err, stdout, stderr) { - t.ok(err.code, 'exits nonzero'); - t.end(); - }, - false - ); - }); - - group.end(); -}); - -test('--config', options, function(t) { - var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dst); - var outputIndex = path.join(dst, 'index.html'); - var expectedOutputPath = path.join( - __dirname, - 'fixture/html/nested.config-output.html' - ); - documentation( - [ - 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + - dst - ], - function(err) { - t.notOk(err); - var output = fs.readFileSync(outputIndex, 'utf8'); - if (process.env.UPDATE) { - fs.writeFileSync(expectedOutputPath, output); - } - var expectedOutput = fs.readFileSync(expectedOutputPath, 'utf8'); - t.equal(expectedOutput, output, 'generates correct output'); - t.end(); - }, - false - ); -}); - -test('--version', options, function(t) { - documentation( - ['--version'], - {}, - function(err, output) { - t.ok(output, 'outputs version'); - t.end(); - }, - false - ); -}); - -test('lint command', function(group) { - group.test('generates lint output', options, function(t) { - documentation(['lint fixture/lint/lint.input.js'], function(err, data) { - var output = path.join(__dirname, 'fixture', 'lint', 'lint.output'); - data = data.toString().split('\n').slice(2).join('\n'); - if (process.env.UPDATE) { - fs.writeFileSync(output, data); - } - t.equal(err.code, 1); - if (os.type() === 'Windows_NT') { - data = data.replace('‼', '⚠'); - } - t.equal(data, fs.readFileSync(output, 'utf8'), 'outputs lint'); - t.end(); - }); - }); - - group.test('generates no output on a good file', options, function(t) { - documentation( - ['lint fixture/simple.input.js'], - {}, - function(err, data) { - t.equal(err, null); - t.equal(data, '', 'no output'); - t.end(); - }, - false - ); - }); - - group.test('exposes syntax error on a bad file', options, function(t) { - documentation( - ['lint fixture/bad/syntax.input', '--parseExtension input'], - {}, - function(err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, - false - ); - }); - - group.test('lint with no inputs', options, function(t) { - documentation( - ['lint'], - { - cwd: path.join(__dirname, 'fixture/bad') - }, - function(err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, - false - ); - }); - - group.end(); -}); - -test('given no files', options, function(t) { - documentation(['build'], function(err) { - t.ok( - err - .toString() - .match( - /documentation was given no files and was not run in a module directory/ - ), - 'no files given' - ); - t.end(); - }); -}); - -test('with an invalid command', options, function(t) { - documentation( - ['invalid'], - {}, - function(err) { - t.ok(err, 'returns error'); - t.end(); - }, - false - ); -}); - -test('--access flag', function(t) { - documentation( - ['build --shallow fixture/internal.input.js -a public'], - {}, - function(err, data) { - t.error(err); - t.equal(data, '[]'); - t.end(); - }, - false - ); -}); - -test('--private flag', function(t) { - documentation( - ['build fixture/internal.input.js --private'], - {}, - function(err, data) { - t.error(err); - t.ok(data.length > 2, 'outputs docs'); - t.end(); - }, - false - ); -}); - -test('--infer-private flag', function(t) { - documentation( - ['build fixture/infer-private.input.js --infer-private ^_'], - {}, - function(err, data) { - t.error(err); - - // This uses JSON.parse with a reviver used as a visitor. - JSON.parse(data, function(n, v) { - // Make sure we do not see any names that match `^_`. - if (n === 'name') { - t.equal(typeof v, 'string'); - t.ok(!/_$/.test(v)); - } - return v; - }); - t.end(); - }, - false - ); -}); - -test('write to file', options, function(t) { - var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - - documentation( - ['build --shallow fixture/internal.input.js -o ' + dst], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok(fs.existsSync(dst), 'created file'); - t.end(); - }, - false - ); -}); - -test('write to html', options, function(t) { - var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dstDir); - - documentation( - ['build --shallow fixture/internal.input.js -f html -o ' + dstDir], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok( - fs.existsSync(path.join(dstDir, 'index.html')), - 'created index.html' - ); - t.end(); - }, - false - ); -}); - -test('write to html with custom theme', options, function(t) { - var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dstDir); - - documentation( - [ - 'build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + - dstDir - ], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok( - fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'), - 'Hello world' - ); - t.end(); - }, - false - ); -}); - -test('write to html, highlightAuto', options, function(t) { - var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js', - config = 'fixture/auto_lang_hljs/config.yml', - dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - - fs.mkdirSync(dstDir); - - documentation( - ['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], - {}, - function(err) { - t.ifErr(err); - var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'); - t.ok( - result.indexOf('42') > 0, - 'javascript is recognized by highlightjs' - ); - t.ok( - result.indexOf('[data-foo]') > - 0, - 'css is recognized by highlightjs' - ); - t.ok( - result.indexOf('data-foo') > 0, - 'html is recognized by highlightjs' - ); - t.end(); - }, - false - ); -}); - -test('fatal error', options, function(t) { - documentation( - ['build --shallow fixture/bad/syntax.input --parseExtension input'], - {}, - function(err) { - t.ok(err.toString().match(/Unexpected token/), 'reports syntax error'); - t.end(); - }, - false - ); -}); - -test( - 'build --document-exported', - function(t) { - documentation( - ['build fixture/document-exported.input.js --document-exported -f md'], - {}, - function(err, data) { - t.error(err); - - var outputfile = path.join( - __dirname, - 'fixture', - 'document-exported.output.md' - ); - if (process.env.UPDATE) { - fs.writeFileSync(outputfile, data, 'utf8'); - } - - var expect = fs.readFileSync(outputfile, 'utf-8'); - t.equal(data, expect); - t.end(); - }, - false - ); - }, - options -); - -test( - 'build large file without error (no deoptimized styling error)', - function(t) { - var dstFile = path.join( - os.tmpdir(), - (Date.now() + Math.random()).toString() - ) + '.js'; - var contents = ''; - for (var i = 0; i < 4e4; i++) { - contents += '/* - */\n'; - } - fs.writeFileSync(dstFile, contents, 'utf8'); - - documentation( - ['build ' + dstFile], - {}, - function(err, data, stderr) { - t.error(err); - t.equal(stderr, ''); - fs.unlinkSync(dstFile); - t.end(); - }, - false - ); - }, - options -); diff --git a/test/fixture/boolean-literal-type.output.json b/test/fixture/boolean-literal-type.output.json deleted file mode 100644 index fb5f85589..000000000 --- a/test/fixture/boolean-literal-type.output.json +++ /dev/null @@ -1,89 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "t", - "lineNumber": 2, - "type": { - "type": "BooleanLiteralType", - "value": true - } - }, - { - "title": "param", - "name": "f", - "lineNumber": 2, - "type": { - "type": "BooleanLiteralType", - "value": false - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "ArrayType", - "elements": [ - { - "type": "BooleanLiteralType", - "value": true - }, - { - "type": "BooleanLiteralType", - "value": false - } - ] - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - } -] \ No newline at end of file diff --git a/test/fixture/boolean-literal-type.output.md b/test/fixture/boolean-literal-type.output.md deleted file mode 100644 index da400ec81..000000000 --- a/test/fixture/boolean-literal-type.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [f](#f) - -## f - -**Parameters** - -- `t` **`true`** -- `f` **`false`** - -Returns **\[`true`, `false`]** diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json deleted file mode 100644 index c6e85d7d4..000000000 --- a/test/fixture/boolean-literal-type.output.md.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "t" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "inlineCode", - "value": "true" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "inlineCode", - "value": "false" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[" - }, - { - "type": "inlineCode", - "value": "true" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "inlineCode", - "value": "false" - }, - { - "type": "text", - "value": "]" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md deleted file mode 100644 index ff4da14ba..000000000 --- a/test/fixture/class.config.output.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## MyClass - -This is my class, a demo thing. - -**Properties** - -- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. - -## Hello - -World - diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json deleted file mode 100644 index 37f1d9b70..000000000 --- a/test/fixture/class.output.json +++ /dev/null @@ -1,613 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "MyClass" - }, - { - "title": "property", - "description": "how many things it contains", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "howMany" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "howMany", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how many things it contains", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "MyClass", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "param", - "description": "whether to get the number", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "name": "getIt" - }, - { - "title": "returns", - "description": "forty-two", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 14, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "getIt", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getFoo", - "kind": "function", - "memberof": "MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getFoo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getFoo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "does not return anything.", - "lineNumber": 2, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 22, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 47 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getUndefined", - "kind": "function", - "memberof": "MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getUndefined", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getUndefined" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - } - ], - "namespace": "MyClass" - } -] \ No newline at end of file diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md deleted file mode 100644 index 0c88fe44d..000000000 --- a/test/fixture/class.output.md +++ /dev/null @@ -1,31 +0,0 @@ - - -### Table of Contents - -- [MyClass](#myclass) - - [getFoo](#getfoo) - - [getUndefined](#getundefined) - -## MyClass - -This is my class, a demo thing. - -**Properties** - -- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json deleted file mode 100644 index 4292255b6..000000000 --- a/test/fixture/class.output.md.json +++ /dev/null @@ -1,448 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "howMany" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how many things it contains", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getFoo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "getIt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getUndefined" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/default-export-function.output.json b/test/fixture/default-export-function.output.json deleted file mode 100644 index 41c8774b9..000000000 --- a/test/fixture/default-export-function.output.json +++ /dev/null @@ -1,214 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "default-export-function.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "default-export-function.input", - "kind": "function" - } - ], - "namespace": "default-export-function.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo's son", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 22 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to default-export-function.input not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "kind": "function", - "memberof": "default-export-function.input", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "bar", - "kind": "function", - "scope": "static" - } - ], - "namespace": ".bar" - } -] \ No newline at end of file diff --git a/test/fixture/default-export-function.output.md b/test/fixture/default-export-function.output.md deleted file mode 100644 index f5751264f..000000000 --- a/test/fixture/default-export-function.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [default-export-function.input](#default-export-functioninput) -- [bar](#bar) - -## default-export-function.input - -i am foo - -## bar - -i am foo's son diff --git a/test/fixture/default-export-function.output.md.json b/test/fixture/default-export-function.output.md.json deleted file mode 100644 index bebb70b41..000000000 --- a/test/fixture/default-export-function.output.md.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "default-export-function.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo's son", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-object.output.json b/test/fixture/document-exported-export-default-object.output.json deleted file mode 100644 index 891d8bc4c..000000000 --- a/test/fixture/document-exported-export-default-object.output.json +++ /dev/null @@ -1,108 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "document-exported-export-default-object.input", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "document-exported-export-default-object.input" - } - ], - "namespace": "document-exported-export-default-object.input" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to document-exported-export-default-object.input not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "memberof": "document-exported-export-default-object.input", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x", - "scope": "static" - } - ], - "namespace": ".x" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-object.output.md b/test/fixture/document-exported-export-default-object.output.md deleted file mode 100644 index b2ffbf9a7..000000000 --- a/test/fixture/document-exported-export-default-object.output.md +++ /dev/null @@ -1,10 +0,0 @@ - - -### Table of Contents - -- [document-exported-export-default-object.input](#document-exported-export-default-objectinput) -- [x](#x) - -## document-exported-export-default-object.input - -## x diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json deleted file mode 100644 index c79cb8e64..000000000 --- a/test/fixture/document-exported-export-default-object.output.md.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "document-exported-export-default-object.input" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-value.output.json b/test/fixture/document-exported-export-default-value.output.json deleted file mode 100644 index 78ffad1f7..000000000 --- a/test/fixture/document-exported-export-default-value.output.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "document-exported-export-default-value.input", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "document-exported-export-default-value.input" - } - ], - "namespace": "document-exported-export-default-value.input" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-value.output.md b/test/fixture/document-exported-export-default-value.output.md deleted file mode 100644 index f003118a1..000000000 --- a/test/fixture/document-exported-export-default-value.output.md +++ /dev/null @@ -1,7 +0,0 @@ - - -### Table of Contents - -- [document-exported-export-default-value.input](#document-exported-export-default-valueinput) - -## document-exported-export-default-value.input diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json deleted file mode 100644 index 686f080df..000000000 --- a/test/fixture/document-exported-export-default-value.output.md.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "document-exported-export-default-value.input" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json deleted file mode 100644 index a5fbd453b..000000000 --- a/test/fixture/document-exported.output.json +++ /dev/null @@ -1,1808 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "z", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "zMethod", - "kind": "function", - "memberof": "z", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "z", - "kind": "class" - }, - { - "name": "zMethod", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "z#zMethod" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "z", - "kind": "class" - } - ], - "namespace": "z" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "yparam", - "lineNumber": 1 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x", - "kind": "function" - } - ], - "namespace": "x" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Class", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classMethod", - "kind": "function", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classMethod", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Class#classMethod" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 22 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classGetter", - "kind": "member", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Class#classGetter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 7 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classSetter", - "kind": "member", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classSetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Class#classSetter" - } - ], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 26 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticMethod", - "kind": "function", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticMethod", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Class.staticMethod" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 30 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 30 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticGetter", - "kind": "member", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticGetter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "Class.staticGetter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 31 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 10 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticSetter", - "kind": "member", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticSetter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "Class.staticSetter" - } - ] - }, - "path": [ - { - "name": "Class", - "kind": "class" - } - ], - "namespace": "Class" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T5", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T5", - "kind": "typedef" - } - ], - "namespace": "T5" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "y2Default", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "y2Default" - } - ], - "namespace": "y2Default" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Description of y3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 24 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "p", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "VoidLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "y4", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "y4", - "kind": "function" - } - ], - "namespace": "y4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "object", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 13 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "method", - "kind": "function", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "method", - "kind": "function", - "scope": "static" - } - ], - "namespace": "object.method" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "getter", - "kind": "member", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "getter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "object.getter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 16 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "setter", - "kind": "member", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "setter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "object.setter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 10 - } - }, - "context": { - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "prop", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "prop", - "scope": "static" - } - ], - "namespace": "object.prop" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 21 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "func", - "kind": "function", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "func", - "kind": "function", - "scope": "static" - } - ], - "namespace": "object.func" - } - ] - }, - "path": [ - { - "name": "object" - } - ], - "namespace": "object" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 55, - "column": 0 - }, - "end": { - "line": 55, - "column": 16 - } - }, - "context": { - "loc": { - "start": { - "line": 55, - "column": 0 - }, - "end": { - "line": 55, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f1", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f1", - "kind": "function" - } - ], - "namespace": "f1" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 56, - "column": 0 - }, - "end": { - "line": 56, - "column": 16 - } - }, - "context": { - "loc": { - "start": { - "line": 56, - "column": 0 - }, - "end": { - "line": 56, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f3", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f3", - "kind": "function" - } - ], - "namespace": "f3" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 60, - "column": 0 - }, - "end": { - "line": 60, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 60, - "column": 0 - }, - "end": { - "line": 60, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "number" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T2", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "string" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T2", - "kind": "typedef" - } - ], - "namespace": "T2" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 62, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 62, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T4", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "string" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T4", - "kind": "typedef" - } - ], - "namespace": "T4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 68, - "column": 0 - }, - "end": { - "line": 68, - "column": 34 - } - }, - "context": { - "loc": { - "start": { - "line": 68, - "column": 0 - }, - "end": { - "line": 68, - "column": 34 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 68, - "type": { - "type": "NameExpression", - "name": "X" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f4", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f4", - "kind": "function" - } - ], - "namespace": "f4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 72, - "column": 0 - }, - "end": { - "line": 74, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 72, - "column": 0 - }, - "end": { - "line": 74, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "o1", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - }, - "context": { - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om1", - "kind": "function", - "memberof": "o1", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "o1" - }, - { - "name": "om1", - "kind": "function", - "scope": "static" - } - ], - "namespace": "o1.om1" - } - ] - }, - "path": [ - { - "name": "o1" - } - ], - "namespace": "o1" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "f5 comment", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 76, - "column": 0 - }, - "end": { - "line": 76, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 77, - "column": 0 - }, - "end": { - "line": 80, - "column": 4 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "y", - "lineNumber": 77, - "type": { - "type": "NameExpression", - "name": "Y" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f5", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f5", - "kind": "function" - } - ], - "namespace": "f5" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 80, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 80, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "o2", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - }, - "context": { - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om2", - "kind": "function", - "memberof": "o2", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "o2" - }, - { - "name": "om2", - "kind": "function", - "scope": "static" - } - ], - "namespace": "o2.om2" - } - ] - }, - "path": [ - { - "name": "o2" - } - ], - "namespace": "o2" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md deleted file mode 100644 index a75a60be3..000000000 --- a/test/fixture/document-exported.output.md +++ /dev/null @@ -1,140 +0,0 @@ - - -### Table of Contents - -- [z](#z) - - [zMethod](#zmethod) -- [x](#x) -- [Class](#class) - - [classMethod](#classmethod) - - [classGetter](#classgetter) - - [classSetter](#classsetter) - - [staticMethod](#staticmethod) - - [staticGetter](#staticgetter) - - [staticSetter](#staticsetter) -- [T5](#t5) -- [y2Default](#y2default) -- [y4](#y4) -- [object](#object) - - [method](#method) - - [getter](#getter) - - [setter](#setter) - - [prop](#prop) - - [func](#func) -- [f1](#f1) -- [f3](#f3) -- [T](#t) -- [T2](#t2) -- [T4](#t4) -- [f4](#f4) -- [o1](#o1) - - [om1](#om1) -- [f5](#f5) -- [o2](#o2) - - [om2](#om2) - -## z - -### zMethod - -## x - -**Parameters** - -- `yparam` - -## Class - -**Parameters** - -- `a` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -### classMethod - -### classGetter - -### classSetter - -**Parameters** - -- `v` - -### staticMethod - -### staticGetter - -### staticSetter - -**Parameters** - -- `v` - -## T5 - -Type: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) - -## y2Default - -## y4 - -Description of y3 - -**Parameters** - -- `p` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **void** - -## object - -### method - -### getter - -### setter - -**Parameters** - -- `v` - -### prop - -### func - -## f1 - -## f3 - -## T - -Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) - -## T2 - -Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## T4 - -Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## f4 - -**Parameters** - -- `x` **X** - -## o1 - -### om1 - -## f5 - -f5 comment - -**Parameters** - -- `y` **Y** - -## o2 - -### om2 diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json deleted file mode 100644 index f2c9224c7..000000000 --- a/test/fixture/document-exported.output.md.json +++ /dev/null @@ -1,827 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "z" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "zMethod" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "yparam" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Class" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classMethod" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classGetter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classSetter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticMethod" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticGetter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticSetter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T5" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "y2Default" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "y4" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Description of y3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "p" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "void" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "object" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "setter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "prop" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "func" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f1" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f3" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T4" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f4" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "X" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "o1" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "om1" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f5" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "f5 comment", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "y" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Y" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "o2" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "om2" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json deleted file mode 100644 index 946da68c4..000000000 --- a/test/fixture/es6-class.output.json +++ /dev/null @@ -1,480 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my component. This is from issue #458", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 36 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "React.Component" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - } - ], - "namespace": "Foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Does nothing. This is from issue #556", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "str" - } - ], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 18, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "str", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Bar", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A useless property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [ - { - "title": "type", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 15, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 4 - }, - "end": { - "line": 16, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "memberof": "Bar", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Bar", - "kind": "class" - }, - { - "name": "bar", - "scope": "instance" - } - ], - "namespace": "Bar#bar" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Bar", - "kind": "class" - } - ], - "namespace": "Bar" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This class has fully inferred constructor parameters.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 22, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 25, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "n", - "lineNumber": 24, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "l", - "lineNumber": 24, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Baz", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Baz", - "kind": "class" - } - ], - "namespace": "Baz" - } -] \ No newline at end of file diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md deleted file mode 100644 index 2d128e772..000000000 --- a/test/fixture/es6-class.output.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Table of Contents - -- [Foo](#foo) -- [Bar](#bar) - - [bar](#bar-1) -- [Baz](#baz) - -## Foo - -**Extends React.Component** - -This is my component. This is from issue #458 - -## Bar - -Does nothing. This is from issue #556 - -**Parameters** - -- `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -### bar - -A useless property - -## Baz - -This class has fully inferred constructor parameters. - -**Parameters** - -- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `l` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json deleted file mode 100644 index 7b9f040a4..000000000 --- a/test/fixture/es6-class.output.md.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "React.Component" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my component. This is from issue #458", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Does nothing. This is from issue #556", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "str" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A useless property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Baz" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This class has fully inferred constructor parameters.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "n" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "l" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json deleted file mode 100644 index 148b861ea..000000000 --- a/test/fixture/es6-default2.output.json +++ /dev/null @@ -1,66 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 1 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 39 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "thisIsTheArgument", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "public", - "name": "es6-default2.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6-default2.input", - "kind": "function" - } - ], - "namespace": "es6-default2.input" - } -] \ No newline at end of file diff --git a/test/fixture/es6-default2.output.md b/test/fixture/es6-default2.output.md deleted file mode 100644 index 9cb89de6e..000000000 --- a/test/fixture/es6-default2.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [es6-default2.input](#es6-default2input) - -## es6-default2.input - -**Parameters** - -- `thisIsTheArgument` diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json deleted file mode 100644 index 3e6561ebd..000000000 --- a/test/fixture/es6-default2.output.md.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6-default2.input" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "thisIsTheArgument" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json deleted file mode 100644 index 30eeb9928..000000000 --- a/test/fixture/es6-import.output.json +++ /dev/null @@ -1,452 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 41 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 9 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "multiplyTwice", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "multiplyTwice", - "kind": "function" - } - ], - "namespace": "multiplyTwice" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is the default export frogs!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "es6-ext", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6-ext" - } - ], - "namespace": "es6-ext" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md deleted file mode 100644 index 9ca299da6..000000000 --- a/test/fixture/es6-import.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [multiplyTwice](#multiplytwice) -- [es6-ext](#es6-ext) -- [simple.input](#simpleinput) - -## multiplyTwice - -This function returns the number one. - -**Parameters** - -- `a` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## es6-ext - -This is the default export frogs! - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json deleted file mode 100644 index a07e50523..000000000 --- a/test/fixture/es6-import.output.md.json +++ /dev/null @@ -1,309 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiplyTwice" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6-ext" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is the default export frogs!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json deleted file mode 100644 index d90207223..000000000 --- a/test/fixture/es6.output.json +++ /dev/null @@ -1,2892 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 4 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "$0", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$0.phoneNumbers", - "lineNumber": 6, - "default": "[]" - }, - { - "title": "param", - "name": "$0.emailAddresses", - "lineNumber": 6, - "default": "[]" - }, - { - "title": "param", - "name": "$0.params", - "lineNumber": 6, - "type": { - "type": "RestType" - } - } - ], - "default": "{}" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "destructure", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "example", - "description": "destructure([1, 2, 3])", - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 34 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "destructure([1, 2, 3])" - } - ], - "params": [ - { - "title": "param", - "name": "$0", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "$0.0", - "lineNumber": 14 - }, - { - "title": "param", - "name": "$0.1", - "lineNumber": 14 - }, - { - "title": "param", - "name": "$0.2", - "lineNumber": 14 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "destructure", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": "an array of numbers", - "lineNumber": 2, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "a" - }, - { - "title": "returns", - "description": "numberone", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "title": "param", - "name": "b", - "lineNumber": 21 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "multiply", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "multiply", - "kind": "function" - } - ], - "namespace": "multiply" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the height of the thing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "height" - }, - { - "title": "param", - "description": "the width of the thing", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "width" - } - ], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 27, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 60, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "height", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "width", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Sink", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 36, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 37, - "column": 2 - }, - "end": { - "line": 37, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticProp", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "staticProp", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#staticProp" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 39, - "column": 2 - }, - "end": { - "line": 41, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 44, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "empty", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "empty", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#empty" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 53, - "column": 2 - }, - "end": { - "line": 56, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 57, - "column": 2 - }, - "end": { - "line": 59, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "aGetter", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "aGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#aGetter" - } - ], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 48, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 49, - "column": 2 - }, - "end": { - "line": 51, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "hello", - "kind": "function", - "memberof": "Sink", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "hello", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Sink.hello" - } - ] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - } - ], - "namespace": "Sink" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a basket. The type should not be linked.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "a basket", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Basket" - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 66, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 67, - "column": 0 - }, - "end": { - "line": 67, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a basket", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Basket" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "makeABasket", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "makeABasket", - "kind": "function" - } - ], - "namespace": "makeABasket" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "Sink", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "sink" - } - ], - "position": { - "start": { - "line": 1, - "column": 23, - "offset": 22 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ". The type should be linked.\nIt takes a ", - "position": { - "start": { - "line": 1, - "column": 40, - "offset": 39 - }, - "end": { - "line": 2, - "column": 12, - "offset": 79 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "number", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "number" - } - ], - "position": { - "start": { - "line": 2, - "column": 12, - "offset": 79 - }, - "end": { - "line": 2, - "column": 26, - "offset": 93 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " which should also be linked.", - "position": { - "start": { - "line": 2, - "column": 26, - "offset": 93 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "a sink", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Sink" - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 0 - }, - "end": { - "line": 74, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 75, - "column": 0 - }, - "end": { - "line": 75, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Sink" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "makeASink", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "makeASink", - "kind": "function" - } - ], - "namespace": "makeASink" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 77, - "column": 0 - }, - "end": { - "line": 79, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 80, - "column": 0 - }, - "end": { - "line": 80, - "column": 43 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 80, - "type": { - "type": "RestType" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "functionWithRest", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRest", - "kind": "function" - } - ], - "namespace": "functionWithRest" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 82, - "column": 0 - }, - "end": { - "line": 84, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 85, - "column": 0 - }, - "end": { - "line": 92, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 85, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "functionWithRestAndType", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRestAndType", - "kind": "function" - } - ], - "namespace": "functionWithRestAndType" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 96, - "column": 0 - }, - "end": { - "line": 98, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 99, - "column": 0 - }, - "end": { - "line": 99, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 103, - "column": 0 - }, - "end": { - "line": 106, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 107, - "column": 0 - }, - "end": { - "line": 107, - "column": 36 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "es6.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6.input", - "kind": "function" - } - ], - "namespace": "es6.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 109, - "column": 0 - }, - "end": { - "line": 111, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 112, - "column": 0 - }, - "end": { - "line": 114, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "foo", - "lineNumber": 112, - "default": "'bar'" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "veryImportantTransform", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "veryImportantTransform", - "kind": "function" - } - ], - "namespace": "veryImportantTransform" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "protected", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 124, - "column": 0 - }, - "end": { - "line": 127, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 128, - "column": 0 - }, - "end": { - "line": 128, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "protected", - "name": "iAmProtected", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "iAmProtected", - "kind": "function" - } - ], - "namespace": "iAmProtected" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 130, - "column": 0 - }, - "end": { - "line": 133, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 134, - "column": 0 - }, - "end": { - "line": 134, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "public", - "name": "iAmPublic", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "iAmPublic", - "kind": "function" - } - ], - "namespace": "iAmPublic" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 142, - "column": 0 - }, - "end": { - "line": 144, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 145, - "column": 0 - }, - "end": { - "line": 145, - "column": 42 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "execute", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "execute" - } - ], - "namespace": "execute" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 147, - "column": 0 - }, - "end": { - "line": 147, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 148, - "column": 0 - }, - "end": { - "line": 154, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "array1", - "lineNumber": 149, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "array2", - "lineNumber": 150, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "compareFunction", - "lineNumber": 151, - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - }, - { - "type": "ParameterType", - "name": "b", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "boolean" - } - }, - "default": "(a:T,b:T):boolean=>a===b" - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "isArrayEqualWith", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "isArrayEqualWith", - "kind": "function" - } - ], - "namespace": "isArrayEqualWith" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #749", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 156, - "column": 0 - }, - "end": { - "line": 156, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 157, - "column": 0 - }, - "end": { - "line": 159, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 157, - "type": { - "type": "NameExpression", - "name": "atype.property" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "paramWithMemberType", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "paramWithMemberType", - "kind": "function" - } - ], - "namespace": "paramWithMemberType" - } -] \ No newline at end of file diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md deleted file mode 100644 index f43d25dd4..000000000 --- a/test/fixture/es6.output.md +++ /dev/null @@ -1,171 +0,0 @@ - - -### Table of Contents - -- [destructure](#destructure) -- [destructure](#destructure-1) -- [multiply](#multiply) -- [Sink](#sink) - - [staticProp](#staticprop) - - [empty](#empty) - - [aGetter](#agetter) - - [hello](#hello) -- [makeABasket](#makeabasket) -- [makeASink](#makeasink) -- [functionWithRest](#functionwithrest) -- [functionWithRestAndType](#functionwithrestandtype) -- [foo](#foo) -- [es6.input](#es6input) -- [veryImportantTransform](#veryimportanttransform) -- [iAmProtected](#iamprotected) -- [iAmPublic](#iampublic) -- [execute](#execute) -- [isArrayEqualWith](#isarrayequalwith) -- [paramWithMemberType](#paramwithmembertype) - -## destructure - -This function destructures with defaults. It should not -have any parameter descriptions. - -**Parameters** - -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) - - `$0.phoneNumbers` (optional, default `[]`) - - `$0.emailAddresses` (optional, default `[]`) - - `$0.params` **...any** - -## destructure - -Similar, but with an array - -**Parameters** - -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `$0.0` - - `$0.1` - - `$0.2` - -**Examples** - -```javascript -destructure([1, 2, 3]) -``` - -## multiply - -This function returns the number one. - -**Parameters** - -- `a` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of numbers -- `b` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## Sink - -This is a sink - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - -### staticProp - -This is a property of the sink. - -### empty - -Is it empty - -### aGetter - -This is a getter method: it should be documented -as a property. - -### hello - -This method says hello - -## makeABasket - -This method returns a basket. The type should not be linked. - -Returns **Basket** a basket - -## makeASink - -This method returns a [sink](#sink). The type should be linked. -It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked. - -Returns **[Sink](#sink)** a sink - -## functionWithRest - -This function takes rest params - -**Parameters** - -- `someParams` **...any** - -## functionWithRestAndType - -So does this one, with types - -**Parameters** - -- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -## foo - -This is an async method - -## es6.input - -This function returns the number one. - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## veryImportantTransform - -This tests our support of optional parameters in ES6 - -**Parameters** - -- `foo` (optional, default `'bar'`) - -## iAmProtected - -A protected function - -## iAmPublic - -A public function - -## execute - -This is re-exported - -## isArrayEqualWith - -Regression check for #498 - -**Parameters** - -- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `(a:T,b:T):boolean=>a===b`) - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** - -## paramWithMemberType - -Regression check for #749 - -**Parameters** - -- `a` **atype.property** - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json deleted file mode 100644 index da94047e3..000000000 --- a/test/fixture/es6.output.md.json +++ /dev/null @@ -1,2339 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.phoneNumbers" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.emailAddresses" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.params" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "destructure([1, 2, 3])" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "height" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticProp" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "empty" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "aGetter" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "hello" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "makeABasket" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a basket. The type should not be linked.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Basket" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a basket", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "makeASink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "#sink", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "sink" - } - ], - "position": { - "start": { - "line": 1, - "column": 23, - "offset": 22 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ". The type should be linked.\nIt takes a ", - "position": { - "start": { - "line": 1, - "column": 40, - "offset": 39 - }, - "end": { - "line": 2, - "column": 12, - "offset": 79 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "number" - } - ], - "position": { - "start": { - "line": 2, - "column": 12, - "offset": 79 - }, - "end": { - "line": 2, - "column": 26, - "offset": 93 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " which should also be linked.", - "position": { - "start": { - "line": 2, - "column": 26, - "offset": 93 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "#sink", - "url": "#sink", - "type": "link", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRest" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRestAndType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "'bar'" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmProtected" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmPublic" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "execute" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "isArrayEqualWith" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "compareFunction" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "b: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "(a:T,b:T):boolean=>a===b" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "paramWithMemberType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #749", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "atype.property" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/event.output.json b/test/fixture/event.output.json deleted file mode 100644 index 5db9fa967..000000000 --- a/test/fixture/event.output.json +++ /dev/null @@ -1,262 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Mouse event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [ - { - "title": "event", - "description": "Map#mousemove", - "lineNumber": 3 - }, - { - "title": "type", - "description": null, - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Object" - } - }, - { - "title": "property", - "description": "the pixel location of the event", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "Point" - }, - "name": "point" - }, - { - "title": "property", - "description": "the original DOM event", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "Event" - }, - "name": "originalEvent" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 0 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "point", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the pixel location of the event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Point" - } - }, - { - "title": "property", - "name": "originalEvent", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the original DOM event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Event" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "event", - "name": "Map#mousemove", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Map#mousemove", - "kind": "event" - } - ], - "namespace": ".event:Map#mousemove" - } -] \ No newline at end of file diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md deleted file mode 100644 index 5ce6a3127..000000000 --- a/test/fixture/event.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [Map#mousemove](#mapmousemove) - -## Map#mousemove - -Mouse event - -**Properties** - -- `point` **Point** the pixel location of the event -- `originalEvent` **[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)** the original DOM event diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json deleted file mode 100644 index 4d7dc7416..000000000 --- a/test/fixture/event.output.md.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Map#mousemove" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Mouse event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "point" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Point" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the pixel location of the event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "originalEvent" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/API/Event", - "url": "https://developer.mozilla.org/en-US/docs/Web/API/Event", - "type": "link", - "children": [ - { - "type": "text", - "value": "Event" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the original DOM event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/example-caption.output.json b/test/fixture/example-caption.output.json deleted file mode 100644 index fbe9d6d85..000000000 --- a/test/fixture/example-caption.output.json +++ /dev/null @@ -1,236 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "example", - "description": "foo(1);", - "lineNumber": 3, - "caption": "demonstrates how to run foo" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "foo(1);", - "caption": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "demonstrates how to run foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - } - } - ], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/example-caption.output.md b/test/fixture/example-caption.output.md deleted file mode 100644 index 6d7d56769..000000000 --- a/test/fixture/example-caption.output.md +++ /dev/null @@ -1,19 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -This function returns the number one. - -**Examples** - -_demonstrates how to run foo_ - -```javascript -foo(1); -``` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json deleted file mode 100644 index fa77489fc..000000000 --- a/test/fixture/example-caption.output.md.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "emphasis", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "demonstrates how to run foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "foo(1);" - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/external.output.json b/test/fixture/external.output.json deleted file mode 100644 index 92a116ccc..000000000 --- a/test/fixture/external.output.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md deleted file mode 100644 index d037ab42c..000000000 --- a/test/fixture/external.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -I am in `external.input.js`. diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json deleted file mode 100644 index fcd4812e8..000000000 --- a/test/fixture/external.output.md.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json deleted file mode 100644 index 9930019b0..000000000 --- a/test/fixture/factory.output.json +++ /dev/null @@ -1,362 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an area chart generator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "chart", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "area" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "chart", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "area" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "area", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "area", - "kind": "function" - } - ], - "namespace": "area" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 1, - "type": null, - "name": "area" - } - ], - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 8, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 37 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "selection", - "lineNumber": 9 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "area", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "area", - "kind": "class" - } - ], - "namespace": "area" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Sets the chart data.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "function", - "description": null, - "lineNumber": 2, - "name": null - } - ], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 14, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 30 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to chart not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "_", - "lineNumber": 15 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "function", - "name": "data", - "memberof": "chart", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "data", - "kind": "function", - "scope": "static" - } - ], - "namespace": ".data" - } -] \ No newline at end of file diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md deleted file mode 100644 index b403983f3..000000000 --- a/test/fixture/factory.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [area](#area) -- [area](#area-1) -- [data](#data) - -## area - -an area chart generator - -Returns **[area](#area)** chart - -## area - -**Parameters** - -- `selection` - -## data - -Sets the chart data. - -**Parameters** - -- `_` diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json deleted file mode 100644 index a4ac3c232..000000000 --- a/test/fixture/factory.output.md.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "area" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an area chart generator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "#area", - "url": "#area", - "type": "link", - "children": [ - { - "type": "text", - "value": "area" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "chart", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "area" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "selection" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "data" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Sets the chart data.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "_" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/flow-unnamed-params.output.json b/test/fixture/flow-unnamed-params.output.json deleted file mode 100644 index bf5cf80cd..000000000 --- a/test/fixture/flow-unnamed-params.output.json +++ /dev/null @@ -1,510 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "string" - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x" - } - ], - "namespace": "x" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 9 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x2", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "string" - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x2" - } - ], - "namespace": "x2" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 39 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "", - "expression": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "result": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "num", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 9 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 43 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T2", - "kind": "typedef", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "result": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "num", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T2", - "kind": "typedef" - } - ], - "namespace": "T2" - } -] \ No newline at end of file diff --git a/test/fixture/flow-unnamed-params.output.md b/test/fixture/flow-unnamed-params.output.md deleted file mode 100644 index 44c844114..000000000 --- a/test/fixture/flow-unnamed-params.output.md +++ /dev/null @@ -1,32 +0,0 @@ - - -### Table of Contents - -- [x](#x) -- [x2](#x2) -- [T](#t) -- [T2](#t2) - -## x - -x - -Type: function ([T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## x2 - -x2 - -Type: function (a: [T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## T - -T - -Type: function ([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} - -## T2 - -T2 - -Type: function (a: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} diff --git a/test/fixture/flow-unnamed-params.output.md.json b/test/fixture/flow-unnamed-params.output.md.json deleted file mode 100644 index a21691184..000000000 --- a/test/fixture/flow-unnamed-params.output.md.json +++ /dev/null @@ -1,431 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "href": "#t", - "url": "#t", - "type": "link", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "href": "#t", - "url": "#t", - "type": "link", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "num: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "num: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/infer-params.output.json b/test/fixture/infer-params.output.json deleted file mode 100644 index c17a42800..000000000 --- a/test/fixture/infer-params.output.json +++ /dev/null @@ -1,345 +0,0 @@ -[ - { - "description": "This function returns the number one.", - "tags": [ - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 5 - }, - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - }, - { - "title": "param", - "name": "c", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$3.d", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.e", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.f", - "lineNumber": 5 - } - ] - } - ], - "name": "addThem", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "addThem" - ] - }, - { - "description": "This method has partially inferred params", - "tags": [ - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "$0.fishes" - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 15, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "$0.fishes" - }, - { - "title": "param", - "name": "$0.foxes", - "lineNumber": 13 - } - ] - } - ], - "name": "fishesAndFoxes", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "fishesAndFoxes" - ] - }, - { - "description": "This is foo's documentation", - "tags": [], - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 27, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 35, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "name": "Foo", - "kind": "class", - "members": { - "instance": [ - { - "description": "The method", - "tags": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 32, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 33, - "column": 2 - }, - "end": { - "line": 34, - "column": 3 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "name": "method", - "kind": "function", - "memberof": "Foo", - "scope": "instance", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "Foo", - "method" - ] - } - ], - "static": [] - }, - "path": [ - "Foo" - ] - }, - { - "description": "This method has a type in the description and a default in the code", - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 23, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - }, - "name": "x" - } - ], - "name": "withDefault", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "withDefault" - ] - } -] diff --git a/test/fixture/infer-params.output.md b/test/fixture/infer-params.output.md deleted file mode 100644 index 6ae10e7ff..000000000 --- a/test/fixture/infer-params.output.md +++ /dev/null @@ -1,43 +0,0 @@ -# addThem - -This function returns the number one. - -**Parameters** - -- `a` -- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param -- `c` -- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$3.d` - - `$3.e` - - `$3.f` - -# fishesAndFoxes - -This method has partially inferred params - -**Parameters** - -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - - `$0.foxes` - -# Foo - -This is foo's documentation - -## method - -The method - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method - -# withDefault - -This method has a type in the description and a default in the code - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)=(default 2)** diff --git a/test/fixture/infer-params.output.md.json b/test/fixture/infer-params.output.md.json deleted file mode 100644 index 1147857d1..000000000 --- a/test/fixture/infer-params.output.md.json +++ /dev/null @@ -1,737 +0,0 @@ -{ - "type": "root", - "children": [ - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fishesAndFoxes" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.fishes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "String" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.foxes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "withDefault" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 68 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 68 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "=" - }, - { - "type": "text", - "value": "(default 2)" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/infer-private.output.json b/test/fixture/infer-private.output.json deleted file mode 100644 index 431535636..000000000 --- a/test/fixture/infer-private.output.json +++ /dev/null @@ -1,214 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "C description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 20 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "C", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "m description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 22 - } - }, - "context": { - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "m", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "m", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#m" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - } - ], - "namespace": "C" - } -] \ No newline at end of file diff --git a/test/fixture/infer-private.output.md b/test/fixture/infer-private.output.md deleted file mode 100644 index be8571cd7..000000000 --- a/test/fixture/infer-private.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [C](#c) - - [m](#m) - -## C - -C description - -### m - -m description diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json deleted file mode 100644 index 38cfecf2a..000000000 --- a/test/fixture/infer-private.output.md.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "C" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "C description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "m" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "m description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json deleted file mode 100644 index cce7001ba..000000000 --- a/test/fixture/inheritance.output.json +++ /dev/null @@ -1,181 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "With ES6, built-in types are extensible!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "Array" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "SpecialArray", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "SpecialArray", - "kind": "class" - } - ], - "namespace": "SpecialArray" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "type": null, - "name": "Foo" - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 42 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "Bar" - } - ], - "errors": [ - { - "message": "@memberof reference to module not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Foo", - "memberof": "module", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class", - "scope": "static" - } - ], - "namespace": ".Foo" - } -] \ No newline at end of file diff --git a/test/fixture/inheritance.output.md b/test/fixture/inheritance.output.md deleted file mode 100644 index 897dad182..000000000 --- a/test/fixture/inheritance.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [SpecialArray](#specialarray) -- [Foo](#foo) - -## SpecialArray - -**Extends Array** - -With ES6, built-in types are extensible! - -## Foo - -**Extends Bar** diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json deleted file mode 100644 index 944577a5f..000000000 --- a/test/fixture/inheritance.output.md.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "SpecialArray" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "With ES6, built-in types are extensible!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Bar" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/inline-link.output.json b/test/fixture/inline-link.output.json deleted file mode 100644 index 95ae461d5..000000000 --- a/test/fixture/inline-link.output.json +++ /dev/null @@ -1,669 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Adds one to a number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the input", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "the output", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the output", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "addOne", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addOne", - "kind": "function" - } - ], - "namespace": "addOne" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one. Internally, this uses\n", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 1, - "offset": 60 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "addOne", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "addOne" - } - ], - "position": { - "start": { - "line": 2, - "column": 1, - "offset": 60 - }, - "end": { - "line": 2, - "column": 15, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " to do the math. This demonstrates\n", - "position": { - "start": { - "line": 2, - "column": 15, - "offset": 74 - }, - "end": { - "line": 3, - "column": 1, - "offset": 109 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "Addition" - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 109 - }, - "end": { - "line": 3, - "column": 56, - "offset": 164 - }, - "indent": [] - } - }, - { - "type": "text", - "value": "\nand ", - "position": { - "start": { - "line": 3, - "column": 56, - "offset": 164 - }, - "end": { - "line": 4, - "column": 5, - "offset": 169 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "https://en.wikipedia.org/wiki/Addition" - } - ], - "position": { - "start": { - "line": 4, - "column": 5, - "offset": 169 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [ - 1, - 1, - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This link refers to nothing: ", - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 30, - "offset": 246 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "nothing", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "nothing" - } - ], - "position": { - "start": { - "line": 6, - "column": 30, - "offset": 246 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the input", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "numberone", - "lineNumber": 9, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "inline-link.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "inline-link.input", - "kind": "function" - } - ], - "namespace": "inline-link.input" - } -] \ No newline at end of file diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md deleted file mode 100644 index 86d415599..000000000 --- a/test/fixture/inline-link.output.md +++ /dev/null @@ -1,31 +0,0 @@ - - -### Table of Contents - -- [addOne](#addone) -- [inline-link.input](#inline-linkinput) - -## addOne - -Adds one to a number - -**Parameters** - -- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the output - -## inline-link.input - -This function returns the number one. Internally, this uses -[addOne](#addone) to do the math. This demonstrates -[Addition](https://en.wikipedia.org/wiki/Addition) -and - -This link refers to nothing: [nothing](nothing) - -**Parameters** - -- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json deleted file mode 100644 index 4d2f11ca5..000000000 --- a/test/fixture/inline-link.output.md.json +++ /dev/null @@ -1,582 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addOne" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Adds one to a number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the output", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "inline-link.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one. Internally, this uses\n", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 1, - "offset": 60 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "#addone", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "addOne" - } - ], - "position": { - "start": { - "line": 2, - "column": 1, - "offset": 60 - }, - "end": { - "line": 2, - "column": 15, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " to do the math. This demonstrates\n", - "position": { - "start": { - "line": 2, - "column": 15, - "offset": 74 - }, - "end": { - "line": 3, - "column": 1, - "offset": 109 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "Addition" - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 109 - }, - "end": { - "line": 3, - "column": 56, - "offset": 164 - }, - "indent": [] - } - }, - { - "type": "text", - "value": "\nand ", - "position": { - "start": { - "line": 3, - "column": 56, - "offset": 164 - }, - "end": { - "line": 4, - "column": 5, - "offset": 169 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "https://en.wikipedia.org/wiki/Addition" - } - ], - "position": { - "start": { - "line": 4, - "column": 5, - "offset": 169 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [ - 1, - 1, - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This link refers to nothing: ", - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 30, - "offset": 246 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "nothing", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "nothing" - } - ], - "position": { - "start": { - "line": 6, - "column": 30, - "offset": 246 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/interface.output.json b/test/fixture/interface.output.json deleted file mode 100644 index 013e347e5..000000000 --- a/test/fixture/interface.output.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my interface.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - } - }, - "augments": [ - { - "title": "extends", - "name": "Bar" - }, - { - "title": "extends", - "name": "Baz" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "prop1", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "prop2", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "interface", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "interface" - } - ], - "namespace": "Foo" - } -] \ No newline at end of file diff --git a/test/fixture/interface.output.md b/test/fixture/interface.output.md deleted file mode 100644 index 7ef9cf99d..000000000 --- a/test/fixture/interface.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [Foo](#foo) - -## Foo - -**Extends Bar, Baz** - -This is my interface. - -**Properties** - -- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/test/fixture/interface.output.md.json b/test/fixture/interface.output.md.json deleted file mode 100644 index 96610ee59..000000000 --- a/test/fixture/interface.output.md.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Bar, Baz" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my interface.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/internal.output.json b/test/fixture/internal.output.json deleted file mode 100644 index 92a116ccc..000000000 --- a/test/fixture/internal.output.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md deleted file mode 100644 index d037ab42c..000000000 --- a/test/fixture/internal.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -I am in `external.input.js`. diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json deleted file mode 100644 index fcd4812e8..000000000 --- a/test/fixture/internal.output.md.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/lends.output.json b/test/fixture/lends.output.json deleted file mode 100644 index 4a231651f..000000000 --- a/test/fixture/lends.output.json +++ /dev/null @@ -1,630 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A neat layout view", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "TheClass" - }, - { - "title": "augments", - "description": null, - "lineNumber": 3, - "type": null, - "name": "Augmented" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "augments": [ - { - "title": "augments", - "description": null, - "lineNumber": 3, - "type": null, - "name": "Augmented" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "TheClass", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "your word", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "word" - }, - { - "title": "returns", - "description": "your word but one better", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 13, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 16, - "column": 5 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "word", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "memberof": "TheClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - }, - { - "name": "foo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "TheClass#foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "your word", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "word" - }, - { - "title": "returns", - "description": "your word but one better", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 21, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 24, - "column": 5 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "word", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "kind": "function", - "memberof": "TheClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - }, - { - "name": "bar", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "TheClass#bar" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - } - ], - "namespace": "TheClass" - } -] \ No newline at end of file diff --git a/test/fixture/lends.output.md b/test/fixture/lends.output.md deleted file mode 100644 index 23ccc043c..000000000 --- a/test/fixture/lends.output.md +++ /dev/null @@ -1,33 +0,0 @@ - - -### Table of Contents - -- [TheClass](#theclass) - - [foo](#foo) - - [bar](#bar) - -## TheClass - -**Extends Augmented** - -A neat layout view - -### foo - -My neat function - -**Parameters** - -- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word - -Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better - -### bar - -My neat function - -**Parameters** - -- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word - -Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better diff --git a/test/fixture/lends.output.md.json b/test/fixture/lends.output.md.json deleted file mode 100644 index 03620a2fe..000000000 --- a/test/fixture/lends.output.md.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "TheClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Augmented" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A neat layout view", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "word" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "word" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/literal_types.output.json b/test/fixture/literal_types.output.json deleted file mode 100644 index 858b92501..000000000 --- a/test/fixture/literal_types.output.json +++ /dev/null @@ -1,210 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 1, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 1, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 49 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 7, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "g", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "g", - "kind": "function" - } - ], - "namespace": "g" - } -] \ No newline at end of file diff --git a/test/fixture/literal_types.output.md b/test/fixture/literal_types.output.md deleted file mode 100644 index 57190ea7f..000000000 --- a/test/fixture/literal_types.output.md +++ /dev/null @@ -1,18 +0,0 @@ - - -### Table of Contents - -- [f](#f) -- [g](#g) - -## f - -**Parameters** - -- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)** - -## g - -**Parameters** - -- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)** diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json deleted file mode 100644 index 623c139b3..000000000 --- a/test/fixture/literal_types.output.md.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "type": "inlineCode", - "value": "\"a\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"b\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "-42" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "3.14" - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "g" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "type": "inlineCode", - "value": "\"a\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"b\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "-42" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "3.14" - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json deleted file mode 100644 index a817352c9..000000000 --- a/test/fixture/memberedclass.output.json +++ /dev/null @@ -1,553 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 3, - "type": null, - "name": "MyClass" - }, - { - "title": "memberof", - "description": "com.Test", - "lineNumber": 4 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to com.Test not found", - "commentLineNumber": 4 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "MyClass", - "memberof": "com.Test", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "param", - "description": "whether to get the number", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "name": "getIt" - }, - { - "title": "returns", - "description": "forty-two", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 17, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 20, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "getIt", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getFoo", - "kind": "function", - "memberof": "com.Test.MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getFoo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getFoo" - } - ], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "does not return anything.", - "lineNumber": 3, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 2 - }, - "end": { - "line": 26, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getUndefined", - "kind": "function", - "memberof": "com.Test.MyClass", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getUndefined", - "kind": "function", - "scope": "static" - } - ], - "namespace": "MyClass.getUndefined" - } - ] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - } - ], - "namespace": "MyClass" - } -] \ No newline at end of file diff --git a/test/fixture/memberedclass.output.md b/test/fixture/memberedclass.output.md deleted file mode 100644 index 1b0ad3188..000000000 --- a/test/fixture/memberedclass.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [MyClass](#myclass) - - [getFoo](#getfoo) - - [getUndefined](#getundefined) - -## MyClass - -This is my class, a demo thing. - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json deleted file mode 100644 index 6f4748b88..000000000 --- a/test/fixture/memberedclass.output.md.json +++ /dev/null @@ -1,360 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getFoo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "getIt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getUndefined" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/merge-infered-type.output.json b/test/fixture/merge-infered-type.output.json deleted file mode 100644 index 61f6b15c2..000000000 --- a/test/fixture/merge-infered-type.output.json +++ /dev/null @@ -1,274 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Add five to ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "The number to add five to.", - "lineNumber": 3, - "type": null, - "name": "x" - }, - { - "title": "returns", - "description": "x plus five.", - "lineNumber": 4, - "type": null - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The number to add five to.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x plus five.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "addFive", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addFive", - "kind": "function" - } - ], - "namespace": "addFive" - } -] \ No newline at end of file diff --git a/test/fixture/merge-infered-type.output.md b/test/fixture/merge-infered-type.output.md deleted file mode 100644 index 1a497d63a..000000000 --- a/test/fixture/merge-infered-type.output.md +++ /dev/null @@ -1,15 +0,0 @@ - - -### Table of Contents - -- [addFive](#addfive) - -## addFive - -Add five to `x`. - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The number to add five to. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** x plus five. diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json deleted file mode 100644 index ae3c81fa8..000000000 --- a/test/fixture/merge-infered-type.output.md.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addFive" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Add five to ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The number to add five to.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x plus five.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/meta.output.json b/test/fixture/meta.output.json deleted file mode 100644 index 9eb923915..000000000 --- a/test/fixture/meta.output.json +++ /dev/null @@ -1,454 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "description", - "description": "This function returns the number one.", - "lineNumber": 3 - }, - { - "title": "see", - "description": "{@link http://github.com/|github}", - "lineNumber": 4 - }, - { - "title": "see", - "description": "TestCase", - "lineNumber": 5 - }, - { - "title": "see", - "description": "[markdown link](http://foo.com/)", - "lineNumber": 6 - }, - { - "title": "version", - "description": "1.0.0", - "lineNumber": 7 - }, - { - "title": "since", - "description": "2.0.0", - "lineNumber": 8 - }, - { - "title": "copyright", - "description": "Tom MacWright", - "lineNumber": 9 - }, - { - "title": "license", - "description": "BSD", - "lineNumber": 10 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [ - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "link", - "url": "http://github.com/", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "github" - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TestCase", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "link", - "title": null, - "url": "http://foo.com/", - "children": [ - { - "type": "text", - "value": "markdown link", - "position": { - "start": { - "line": 1, - "column": 2, - "offset": 1 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - } - } - } - ], - "throws": [], - "todos": [], - "version": "1.0.0", - "since": "2.0.0", - "copyright": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tom MacWright", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "license": "BSD", - "name": "meta.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "meta.input", - "kind": "function" - } - ], - "namespace": "meta.input" - } -] \ No newline at end of file diff --git a/test/fixture/meta.output.md b/test/fixture/meta.output.md deleted file mode 100644 index d45e106d4..000000000 --- a/test/fixture/meta.output.md +++ /dev/null @@ -1,23 +0,0 @@ - - -### Table of Contents - -- [meta.input](#metainput) - -## meta.input - -- **See: [github](http://github.com/)** -- **See: TestCase** -- **See: [markdown link](http://foo.com/)** - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -**Meta** - -- **version**: 1.0.0 -- **since**: 2.0.0 -- **copyright**: Tom MacWright - -- **license**: BSD diff --git a/test/fixture/meta.output.md.json b/test/fixture/meta.output.md.json deleted file mode 100644 index d8cdaee45..000000000 --- a/test/fixture/meta.output.md.json +++ /dev/null @@ -1,470 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "meta.input" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "link", - "url": "http://github.com/", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "github" - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TestCase", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "link", - "title": null, - "url": "http://foo.com/", - "children": [ - { - "type": "text", - "value": "markdown link", - "position": { - "start": { - "line": 1, - "column": 2, - "offset": 1 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Meta" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "version" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "1.0.0" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "since" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "2.0.0" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "copyright" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tom MacWright", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "license" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "BSD" - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json deleted file mode 100644 index ba7426e9a..000000000 --- a/test/fixture/multisignature.output.json +++ /dev/null @@ -1,422 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "the current date", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "time", - "lineNumber": 13 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current date", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getTheTime", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "getTheTime", - "kind": "function" - } - ], - "namespace": "getTheTime" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the current time", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Date" - }, - "name": "time" - }, - { - "title": "returns", - "description": "nothing", - "lineNumber": 3, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "time", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getTheTime", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "getTheTime", - "kind": "function" - } - ], - "namespace": "getTheTime" - } -] \ No newline at end of file diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md deleted file mode 100644 index 70cc5c797..000000000 --- a/test/fixture/multisignature.output.md +++ /dev/null @@ -1,26 +0,0 @@ - - -### Table of Contents - -- [getTheTime](#getthetime) -- [getTheTime](#getthetime-1) - -## getTheTime - -Get the time - -**Parameters** - -- `time` - -Returns **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current date - -## getTheTime - -Set the time - -**Parameters** - -- `time` **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current time - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** nothing diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json deleted file mode 100644 index a6c7ccbc2..000000000 --- a/test/fixture/multisignature.output.md.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getTheTime" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "time" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "type": "link", - "children": [ - { - "type": "text", - "value": "Date" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current date", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getTheTime" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "time" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "type": "link", - "children": [ - { - "type": "text", - "value": "Date" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json deleted file mode 100644 index cbb783fe5..000000000 --- a/test/fixture/nearby_params.output.json +++ /dev/null @@ -1,529 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Attempt to establish a cookie-based session in exchange for credentials.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - } - } - }, - "tags": [ - { - "title": "function", - "description": null, - "lineNumber": 1, - "name": null - }, - { - "title": "name", - "description": null, - "lineNumber": 2, - "name": "sessions.create" - }, - { - "title": "param", - "description": null, - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "object" - }, - "name": "credentials" - }, - { - "title": "param", - "description": "Login username. Also accepted as `username` or `email`.", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "credentials.name" - }, - { - "title": "param", - "description": "Login password", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "credentials.password" - }, - { - "title": "param", - "description": "Gets passed `(err, { success:Boolean })`.", - "lineNumber": 6, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "function" - } - }, - "name": "callback" - }, - { - "title": "returns", - "description": "promise, to be resolved on success or rejected on failure", - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "Promise" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "credentials", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "object" - }, - "properties": [ - { - "title": "param", - "name": "credentials.name", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login username. Also accepted as ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "username", - "position": { - "start": { - "line": 1, - "column": 34, - "offset": 33 - }, - "end": { - "line": 1, - "column": 44, - "offset": 43 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " or ", - "position": { - "start": { - "line": 1, - "column": 44, - "offset": 43 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "email", - "position": { - "start": { - "line": 1, - "column": 48, - "offset": 47 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 55, - "offset": 54 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "credentials.password", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login password", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - { - "title": "param", - "name": "callback", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Gets passed ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "(err, { success:Boolean })", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 41, - "offset": 40 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "function" - } - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "promise, to be resolved on success or rejected on failure", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Promise" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "kind": "function", - "name": "sessions.create", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "sessions.create", - "kind": "function" - } - ], - "namespace": "sessions.create" - } -] \ No newline at end of file diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md deleted file mode 100644 index 2b01f3bab..000000000 --- a/test/fixture/nearby_params.output.md +++ /dev/null @@ -1,18 +0,0 @@ - - -### Table of Contents - -- [sessions.create](#sessionscreate) - -## sessions.create - -Attempt to establish a cookie-based session in exchange for credentials. - -**Parameters** - -- `credentials` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `credentials.name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login username. Also accepted as `username` or `email`. - - `credentials.password` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login password -- `callback` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)?** Gets passed `(err, { success:Boolean })`. - -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** promise, to be resolved on success or rejected on failure diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json deleted file mode 100644 index 72fa32537..000000000 --- a/test/fixture/nearby_params.output.md.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "sessions.create" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Attempt to establish a cookie-based session in exchange for credentials.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials.name" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login username. Also accepted as ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "username", - "position": { - "start": { - "line": 1, - "column": 34, - "offset": 33 - }, - "end": { - "line": 1, - "column": 44, - "offset": 43 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " or ", - "position": { - "start": { - "line": 1, - "column": 44, - "offset": 43 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "email", - "position": { - "start": { - "line": 1, - "column": 48, - "offset": 47 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 55, - "offset": 54 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials.password" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login password", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "callback" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", - "type": "link", - "children": [ - { - "type": "text", - "value": "function" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Gets passed ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "(err, { success:Boolean })", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 41, - "offset": 40 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", - "type": "link", - "children": [ - { - "type": "text", - "value": "Promise" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "promise, to be resolved on success or rejected on failure", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json deleted file mode 100644 index 4cea2bfd1..000000000 --- a/test/fixture/nest_params.output.json +++ /dev/null @@ -1,836 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "param", - "description": "The employees who are responsible for the project.", - "lineNumber": 1, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - }, - "name": "employees" - }, - { - "title": "param", - "description": "The name of an employee.", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "employees[].name" - }, - { - "title": "param", - "description": "The employee's department.", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "employees[].department" - }, - { - "title": "param", - "description": "The employee's type.", - "lineNumber": 4, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "string" - } - }, - "name": "type", - "default": "minion" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "employees", - "lineNumber": 1, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employees who are responsible for the project.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - }, - "properties": [ - { - "title": "param", - "name": "employees[].name", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The name of an employee.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "employees[].department", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's department.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - { - "title": "param", - "name": "type", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's type.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - }, - "default": "minion" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": "", - "tags": [ - { - "title": "name", - "description": null, - "lineNumber": 1, - "name": "foo" - }, - { - "title": "param", - "description": "some options", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "options" - }, - { - "title": "param", - "description": "how much", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "options.much" - }, - { - "title": "param", - "description": "something else", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "bar" - }, - { - "title": "property", - "description": "the current time", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "theTime" - }, - { - "title": "property", - "description": null, - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.hours" - }, - { - "title": "property", - "description": null, - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.minutes" - }, - { - "title": "property", - "description": null, - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.seconds" - }, - { - "title": "returns", - "description": "foo something else", - "lineNumber": 9, - "type": { - "type": "NameExpression", - "name": "Object" - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 19, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "options.much", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how much", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ] - }, - { - "title": "param", - "name": "bar", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [ - { - "title": "property", - "name": "theTime", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "property", - "name": "theTime.hours", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "theTime.minutes", - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "theTime.seconds", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - ], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "foo something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Object" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/nest_params.output.md b/test/fixture/nest_params.output.md deleted file mode 100644 index 54ef3e622..000000000 --- a/test/fixture/nest_params.output.md +++ /dev/null @@ -1,32 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) -- [foo](#foo-1) - -## foo - -**Parameters** - -- `employees` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The employees who are responsible for the project. - - `employees[].name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of an employee. - - `employees[].department` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's department. -- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's type. (optional, default `minion`) - -## foo - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** some options - - `options.much` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how much -- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something else - -**Properties** - -- `theTime` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the current time - - `theTime.hours` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - - `theTime.minutes` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - - `theTime.seconds` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** foo something else diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json deleted file mode 100644 index b03188cd0..000000000 --- a/test/fixture/nest_params.output.md.json +++ /dev/null @@ -1,890 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employees who are responsible for the project.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees[].name" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The name of an employee.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees[].department" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's department.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "type" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's type.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "minion" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.much" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how much", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.hours" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.minutes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.seconds" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "foo something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json deleted file mode 100644 index 11dac1a0d..000000000 --- a/test/fixture/newline-in-description.output.json +++ /dev/null @@ -1,180 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A function.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [ - { - "title": "param", - "description": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - }, - "name": "a" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 0 - } - } - }, - "augments": [], - "errors": [ - { - "message": "could not determine @name for hierarchy" - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [], - "namespace": "" - } -] \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.md b/test/fixture/newline-in-description.output.md deleted file mode 100644 index 6b7dc0a64..000000000 --- a/test/fixture/newline-in-description.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -## - -A function. - -**Parameters** - -- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The input to the function. - I should be able to continue the description on a new line, and have it - still work in the markdown table. diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json deleted file mode 100644 index 8d79efda6..000000000 --- a/test/fixture/newline-in-description.output.md.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A function.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json deleted file mode 100644 index 79026c20e..000000000 --- a/test/fixture/no-name.output.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "bar" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 0 - } - } - }, - "augments": [], - "errors": [ - { - "message": "could not determine @name for hierarchy" - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "bar", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [], - "namespace": "" - } -] \ No newline at end of file diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md deleted file mode 100644 index 6bfd3fb28..000000000 --- a/test/fixture/no-name.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -## - -Set the time - -**Parameters** - -- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json deleted file mode 100644 index fb1772a02..000000000 --- a/test/fixture/no-name.output.md.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json deleted file mode 100644 index 2f633ef1e..000000000 --- a/test/fixture/optional-record-field-type.output.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "opt", - "lineNumber": 3, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "title": "property", - "name": "req", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Record", - "kind": "typedef", - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "opt", - "value": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "type": "FieldType", - "key": "req", - "value": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Record", - "kind": "typedef" - } - ], - "namespace": "Record" - } -] \ No newline at end of file diff --git a/test/fixture/optional-record-field-type.output.md b/test/fixture/optional-record-field-type.output.md deleted file mode 100644 index b3a410e63..000000000 --- a/test/fixture/optional-record-field-type.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [Record](#record) - -## Record - -Type: {opt: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?, req: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)} - -**Properties** - -- `opt` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** -- `req` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json deleted file mode 100644 index bb20925b8..000000000 --- a/test/fixture/optional-record-field-type.output.md.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Record" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "opt: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "req: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "opt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "req" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json deleted file mode 100644 index 5d298de82..000000000 --- a/test/fixture/params.output.json +++ /dev/null @@ -1,2845 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 5 - }, - { - "title": "param", - "name": "b", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "c", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$3.d", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.e", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.f", - "lineNumber": 5 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "addThem", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addThem", - "kind": "function" - } - ], - "namespace": "addThem" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "options" - }, - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "options.fishes" - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "options.fishes", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "String" - } - }, - { - "title": "param", - "name": "options.foxes", - "lineNumber": 14 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "fishesAndFoxes", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "fishesAndFoxes", - "kind": "function" - } - ], - "namespace": "fishesAndFoxes" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 21, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 24, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "withDefault", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "withDefault", - "kind": "function" - } - ], - "namespace": "withDefault" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 28, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 35, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "tags": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 33, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "method", - "kind": "function", - "memberof": "Foo", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - }, - { - "name": "method", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Foo#method" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - } - ], - "namespace": "Foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Traditional object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 37, - "column": 0 - }, - "end": { - "line": 39, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 40, - "column": 0 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "TraditionalObject", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method should acquire the param x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 41, - "column": 2 - }, - "end": { - "line": 43, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 44, - "column": 2 - }, - "end": { - "line": 46, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 44 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "traditionalMethod", - "kind": "function", - "memberof": "TraditionalObject", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TraditionalObject" - }, - { - "name": "traditionalMethod", - "kind": "function", - "scope": "static" - } - ], - "namespace": "TraditionalObject.traditionalMethod" - } - ] - }, - "path": [ - { - "name": "TraditionalObject" - } - ], - "namespace": "TraditionalObject" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 4, - "type": null, - "name": "Address6" - }, - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "address" - }, - { - "title": "param", - "description": "How many octets to parse", - "lineNumber": 6, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "groups", - "default": "8" - }, - { - "title": "param", - "description": "A third argument", - "lineNumber": 7, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "prefix": true - }, - "name": "third" - }, - { - "title": "param", - "description": "to properly be parsed", - "lineNumber": 8, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Array" - } - }, - "name": "foo", - "default": "[1]" - }, - { - "title": "example", - "description": "var address = new Address6('2001::/32');", - "lineNumber": 9 - } - ], - "loc": { - "start": { - "line": 49, - "column": 0 - }, - "end": { - "line": 60, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 22 - } - } - }, - "augments": [], - "errors": [ - { - "message": "An explicit parameter named address was specified but didn't match inferred information ", - "commentLineNumber": 5 - }, - { - "message": "An explicit parameter named groups was specified but didn't match inferred information ", - "commentLineNumber": 6 - }, - { - "message": "An explicit parameter named third was specified but didn't match inferred information ", - "commentLineNumber": 7 - }, - { - "message": "An explicit parameter named foo was specified but didn't match inferred information ", - "commentLineNumber": 8 - } - ], - "examples": [ - { - "description": "var address = new Address6('2001::/32');" - } - ], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "groups", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "How many octets to parse", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "8" - }, - { - "title": "param", - "name": "third", - "lineNumber": 7, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A third argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "prefix": true - } - }, - { - "title": "param", - "name": "foo", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "to properly be parsed", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "default": "[1]" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Address6", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Address6", - "kind": "class" - } - ], - "namespace": "Address6" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Create a GeoJSON data source instance given an options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of nested parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 4, - "type": null, - "name": "GeoJSONSource" - }, - { - "title": "param", - "description": "optional options", - "lineNumber": 5, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "name": "options" - }, - { - "title": "param", - "description": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "lineNumber": 6, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "NameExpression", - "name": "Object" - }, - { - "type": "NameExpression", - "name": "string" - } - ] - }, - "name": "options.data" - }, - { - "title": "param", - "description": "Maximum zoom to preserve detail at.", - "lineNumber": 8, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.maxzoom", - "default": "14" - }, - { - "title": "param", - "description": "Tile buffer on each side.", - "lineNumber": 9, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.buffer" - }, - { - "title": "param", - "description": "Simplification tolerance (higher means simpler).", - "lineNumber": 10, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.tolerance" - } - ], - "loc": { - "start": { - "line": 63, - "column": 0 - }, - "end": { - "line": 74, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 75, - "column": 0 - }, - "end": { - "line": 77, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "optional options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "properties": [ - { - "title": "param", - "name": "options.data", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - } - } - }, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "NameExpression", - "name": "Object" - }, - { - "type": "NameExpression", - "name": "string" - } - ] - } - }, - { - "title": "param", - "name": "options.maxzoom", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Maximum zoom to preserve detail at.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "14" - }, - { - "title": "param", - "name": "options.buffer", - "lineNumber": 9, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tile buffer on each side.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "title": "param", - "name": "options.tolerance", - "lineNumber": 10, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Simplification tolerance (higher means simpler).", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "GeoJSONSource", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "GeoJSONSource", - "kind": "class" - } - ], - "namespace": "GeoJSONSource" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - } - } - }, - "tags": [ - { - "title": "param", - "description": "an argument", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - }, - { - "title": "returns", - "description": "some", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 79, - "column": 0 - }, - "end": { - "line": 86, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 87, - "column": 0 - }, - "end": { - "line": 87, - "column": 37 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "123" - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "myfunc", - "kind": "constant", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "myfunc", - "kind": "constant" - } - ], - "namespace": "myfunc" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - } - } - }, - "tags": [ - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 4, - "type": null, - "name": "address" - } - ], - "loc": { - "start": { - "line": 89, - "column": 0 - }, - "end": { - "line": 94, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 95, - "column": 0 - }, - "end": { - "line": 97, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "name": "input" - }, - { - "title": "param", - "description": "head of iterator", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "any" - }, - "name": "input.0" - }, - { - "title": "param", - "description": "body of iterator", - "lineNumber": 6, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "any" - } - }, - "name": "input.xs" - }, - { - "title": "returns", - "description": "rotated such that the last element was the first", - "lineNumber": 8, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "any" - } - ] - } - } - ], - "loc": { - "start": { - "line": 99, - "column": 0 - }, - "end": { - "line": 108, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 109, - "column": 0 - }, - "end": { - "line": 111, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "input", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "input.0", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "head of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "any" - } - }, - { - "title": "param", - "name": "input.xs", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "body of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "any" - } - } - } - ] - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "rotated such that the last element was the first", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - } - } - }, - "title": "returns", - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "any" - } - ] - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "rotate", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "rotate", - "kind": "function" - } - ], - "namespace": "rotate" - } -] \ No newline at end of file diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md deleted file mode 100644 index 8178ac3ad..000000000 --- a/test/fixture/params.output.md +++ /dev/null @@ -1,139 +0,0 @@ - - -### Table of Contents - -- [addThem](#addthem) -- [fishesAndFoxes](#fishesandfoxes) -- [withDefault](#withdefault) -- [Foo](#foo) - - [method](#method) -- [TraditionalObject](#traditionalobject) - - [traditionalMethod](#traditionalmethod) -- [Address6](#address6) -- [GeoJSONSource](#geojsonsource) -- [myfunc](#myfunc) -- [foo](#foo-1) -- [rotate](#rotate) - -## addThem - -This function returns the number one. - -**Parameters** - -- `a` -- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param -- `c` -- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$3.d` - - `$3.e` - - `$3.f` - -## fishesAndFoxes - -This method has partially inferred params - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `options.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - - `options.foxes` - -## withDefault - -This method has a type in the description and a default in the code - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** (optional, default `2`) - -## Foo - -This is foo's documentation - -### method - -The method - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method - -## TraditionalObject - -Traditional object - -### traditionalMethod - -This method should acquire the param x - -**Parameters** - -- `x` - -## Address6 - -Represents an IPv6 address - -This tests our support of optional parameters - -**Parameters** - -- `address` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** An IPv6 address string -- `groups` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** How many octets to parse (optional, default `8`) -- `third` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** A third argument -- `foo` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** to properly be parsed (optional, default `[1]`) - -**Examples** - -```javascript -var address = new Address6('2001::/32'); -``` - -## GeoJSONSource - -Create a GeoJSON data source instance given an options object - -This tests our support of nested parameters - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** optional options - - `options.data` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** A GeoJSON data object or URL to it. - The latter is preferable in case of large GeoJSON files. - - `options.maxzoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Maximum zoom to preserve detail at. (optional, default `14`) - - `options.buffer` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Tile buffer on each side. - - `options.tolerance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Simplification tolerance (higher means simpler). - -## myfunc - -This tests our support for parameters with explicit types but with default -values specified in code. - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** an argument (optional, default `123`) - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** some - -## foo - -This tests our support of JSDoc param tags without type information, -or any type information we could infer from annotations. - -**Parameters** - -- `address` An IPv6 address string - -## rotate - -This tests our support for iterator rest inside an -iterator destructure (RestElement) - -**Parameters** - -- `input` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `input.0` **any** head of iterator - - `input.xs` **...any** body of iterator - -Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<any>** rotated such that the last element was the first diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json deleted file mode 100644 index 234d9481d..000000000 --- a/test/fixture/params.output.md.json +++ /dev/null @@ -1,2535 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fishesAndFoxes" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.fishes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "String" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.foxes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "withDefault" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "2" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "TraditionalObject" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Traditional object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "traditionalMethod" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method should acquire the param x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "groups" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "How many octets to parse", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "8" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "third" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A third argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "to properly be parsed", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[1]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "var address = new Address6('2001::/32');" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "GeoJSONSource" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Create a GeoJSON data source instance given an options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of nested parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "optional options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.data" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": " | " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.maxzoom" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Maximum zoom to preserve detail at.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "14" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.buffer" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tile buffer on each side.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.tolerance" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Simplification tolerance (higher means simpler).", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "myfunc" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "123" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "rotate" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input.0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "head of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input.xs" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "body of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "any" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "rotated such that the last element was the first", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json deleted file mode 100644 index 1ffc1ba8f..000000000 --- a/test/fixture/react-jsx.output.json +++ /dev/null @@ -1,104 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "apples", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 20 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "apples", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "apples", - "kind": "function" - } - ], - "namespace": "apples" - } -] \ No newline at end of file diff --git a/test/fixture/react-jsx.output.md b/test/fixture/react-jsx.output.md deleted file mode 100644 index 96878014b..000000000 --- a/test/fixture/react-jsx.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [apples](#apples) - -## apples - -apples diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json deleted file mode 100644 index 7ebe87a39..000000000 --- a/test/fixture/react-jsx.output.md.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "apples" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "apples", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/require-json-no-extension.output.json b/test/fixture/require-json-no-extension.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/require-json-no-extension.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/require-json-no-extension.output.md b/test/fixture/require-json-no-extension.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/require-json-no-extension.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/require-json-no-extension.output.md.json b/test/fixture/require-json-no-extension.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/require-json-no-extension.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/require-json.output.json b/test/fixture/require-json.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/require-json.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/require-json.output.md b/test/fixture/require-json.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/require-json.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/require-json.output.md.json b/test/fixture/require-json.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/require-json.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json deleted file mode 100644 index f03bd9afb..000000000 --- a/test/fixture/simple-hashbang.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple-hashbang.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple-hashbang.input", - "kind": "function" - } - ], - "namespace": "simple-hashbang.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md deleted file mode 100644 index 362645dc1..000000000 --- a/test/fixture/simple-hashbang.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple-hashbang.input](#simple-hashbanginput) - -## simple-hashbang.input - -This function returns the number one. - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json deleted file mode 100644 index eea85db79..000000000 --- a/test/fixture/simple-hashbang.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple-hashbang.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-private.output.json b/test/fixture/simple-private.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-private.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-private.output.md b/test/fixture/simple-private.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-private.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-private.output.md.json b/test/fixture/simple-private.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-private.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-singlestar.output.json b/test/fixture/simple-singlestar.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-singlestar.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-singlestar.output.md b/test/fixture/simple-singlestar.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-singlestar.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-singlestar.output.md.json b/test/fixture/simple-singlestar.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-singlestar.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-triplestar.output.json b/test/fixture/simple-triplestar.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-triplestar.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-triplestar.output.md b/test/fixture/simple-triplestar.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-triplestar.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-triplestar.output.md.json b/test/fixture/simple-triplestar.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-triplestar.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json deleted file mode 100644 index a6d86ceea..000000000 --- a/test/fixture/simple-two.output.json +++ /dev/null @@ -1,255 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the number", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "numbertwo", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "example", - "description": "var result = returnTwo(4);\n// result is 6", - "lineNumber": 5 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "var result = returnTwo(4);\n// result is 6" - } - ], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "returnTwo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "returnTwo", - "kind": "function" - } - ], - "namespace": "returnTwo" - } -] \ No newline at end of file diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md deleted file mode 100644 index 31f744ae3..000000000 --- a/test/fixture/simple-two.output.md +++ /dev/null @@ -1,22 +0,0 @@ - - -### Table of Contents - -- [returnTwo](#returntwo) - -## returnTwo - -This function returns the number plus two. - -**Parameters** - -- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number - -**Examples** - -```javascript -var result = returnTwo(4); -// result is 6 -``` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numbertwo diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json deleted file mode 100644 index 87999cf26..000000000 --- a/test/fixture/simple-two.output.md.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "var result = returnTwo(4);\n// result is 6" - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json deleted file mode 100644 index fee8d21ce..000000000 --- a/test/fixture/simple.output.github.json +++ /dev/null @@ -1,175 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - }, - "github": "[github]" - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md deleted file mode 100644 index dd84d129c..000000000 --- a/test/fixture/simple.output.github.md +++ /dev/null @@ -1,9 +0,0 @@ - - -## simple.input - -[undefined:5-8](<> "Source code on GitHub") - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json deleted file mode 100644 index 94432e345..000000000 --- a/test/fixture/simple.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md deleted file mode 100644 index c2c8c1ec9..000000000 --- a/test/fixture/simple.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple.input](#simpleinput) - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json deleted file mode 100644 index 6ef343f9a..000000000 --- a/test/fixture/simple.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json deleted file mode 100644 index c2ae8e8f9..000000000 --- a/test/fixture/sort-order-alpha.output.json +++ /dev/null @@ -1,672 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 15 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "a", - "kind": "function" - } - ], - "namespace": "a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "b", - "kind": "function" - } - ], - "namespace": "b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "C", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "b", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "B", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "B", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#B" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "a", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "A", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "A", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#A" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - } - ], - "namespace": "C" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 31, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "D", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 23, - "column": 2 - }, - "end": { - "line": 23, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "b", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "B", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "B", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#B" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 27, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 2 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "a", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "A", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "A", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#A" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - } - ], - "namespace": "D" - } -] \ No newline at end of file diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md deleted file mode 100644 index 4b6e8d21c..000000000 --- a/test/fixture/sort-order-alpha.output.md +++ /dev/null @@ -1,40 +0,0 @@ - - -### Table of Contents - -- [a](#a) -- [b](#b) -- [C](#c) - - [b](#b-1) - - [B](#b-2) - - [a](#a-1) - - [A](#a-2) -- [D](#d) - - [b](#b-3) - - [B](#b-4) - - [a](#a-3) - - [A](#a-4) - -## a - -## b - -## C - -### b - -### B - -### a - -### A - -## D - -### b - -### B - -### a - -### A diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json deleted file mode 100644 index 31d018194..000000000 --- a/test/fixture/sort-order-alpha.output.md.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "C" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "B" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "A" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "D" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "B" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "A" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json deleted file mode 100644 index e8faeec6f..000000000 --- a/test/fixture/string-literal-key.output.json +++ /dev/null @@ -1,169 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "alias", - "description": null, - "lineNumber": 1, - "name": "MyContainerObject" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "alias": "MyContainerObject", - "name": "MyContainerObject", - "kind": "constant", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyContainerObject", - "kind": "constant" - } - ], - "namespace": "MyContainerObject" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The foo property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 7, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 10, - "column": 3 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to obj not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "memberof": "obj", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "scope": "static" - } - ], - "namespace": ".foo" - } -] \ No newline at end of file diff --git a/test/fixture/string-literal-key.output.md b/test/fixture/string-literal-key.output.md deleted file mode 100644 index a704fb0f8..000000000 --- a/test/fixture/string-literal-key.output.md +++ /dev/null @@ -1,12 +0,0 @@ - - -### Table of Contents - -- [MyContainerObject](#mycontainerobject) -- [foo](#foo) - -## MyContainerObject - -## foo - -The foo property diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json deleted file mode 100644 index c0bd30afe..000000000 --- a/test/fixture/string-literal-key.output.md.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyContainerObject" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The foo property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json deleted file mode 100644 index 94432e345..000000000 --- a/test/fixture/system-import.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md deleted file mode 100644 index c2c8c1ec9..000000000 --- a/test/fixture/system-import.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple.input](#simpleinput) - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json deleted file mode 100644 index 6ef343f9a..000000000 --- a/test/fixture/system-import.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json deleted file mode 100644 index 8e6091b02..000000000 --- a/test/fixture/this-class.output.json +++ /dev/null @@ -1,411 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "module", - "description": null, - "lineNumber": 0, - "type": null, - "name": "bookshelf" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "module", - "name": "bookshelf", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "bookshelf", - "kind": "module" - } - ], - "namespace": "bookshelf" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "name": null - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Book", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the book.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 31 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "title", - "memberof": "Book", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Book", - "kind": "class" - }, - { - "name": "title", - "scope": "instance" - } - ], - "namespace": "Book#title" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Book", - "kind": "class" - } - ], - "namespace": "Book" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "name": null - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 10 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "BookShelf", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the bookshelf.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 36 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "title", - "memberof": "BookShelf", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "BookShelf", - "kind": "class" - }, - { - "name": "title", - "scope": "instance" - } - ], - "namespace": "BookShelf#title" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "BookShelf", - "kind": "class" - } - ], - "namespace": "BookShelf" - } -] \ No newline at end of file diff --git a/test/fixture/this-class.output.md b/test/fixture/this-class.output.md deleted file mode 100644 index ea20b2510..000000000 --- a/test/fixture/this-class.output.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Table of Contents - -- [bookshelf](#bookshelf) -- [Book](#book) - - [title](#title) -- [BookShelf](#bookshelf-1) - - [title](#title-1) - -## bookshelf - -**Parameters** - -- `title` - -## Book - -**Parameters** - -- `title` - -### title - -The title of the book. - -## BookShelf - -**Parameters** - -- `title` - -### title - -The title of the bookshelf. diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json deleted file mode 100644 index e7b15ff40..000000000 --- a/test/fixture/this-class.output.md.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bookshelf" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Book" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "title" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the book.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "BookShelf" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "title" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the bookshelf.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json deleted file mode 100644 index d2c81ef6a..000000000 --- a/test/fixture/type_application.output.json +++ /dev/null @@ -1,202 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "Address6" - }, - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 3, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - }, - "name": "address" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 0 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Address6", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Address6", - "kind": "class" - } - ], - "namespace": "Address6" - } -] \ No newline at end of file diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md deleted file mode 100644 index 15b47e757..000000000 --- a/test/fixture/type_application.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -- [Address6](#address6) - -## Address6 - -Represents an IPv6 address - -**Parameters** - -- `address` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** An IPv6 address string diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json deleted file mode 100644 index a77cd28e9..000000000 --- a/test/fixture/type_application.output.md.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json deleted file mode 100644 index 3cd6a3c86..000000000 --- a/test/fixture/var-function-param-return.output.json +++ /dev/null @@ -1,71 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - } -] \ No newline at end of file diff --git a/test/fixture/var-function-param-return.output.md b/test/fixture/var-function-param-return.output.md deleted file mode 100644 index 5373d639c..000000000 --- a/test/fixture/var-function-param-return.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -- [f](#f) - -## f - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json deleted file mode 100644 index cc30bcd50..000000000 --- a/test/fixture/var-function-param-return.output.md.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js deleted file mode 100644 index da9d62bb7..000000000 --- a/test/lib/flow_doctrine.js +++ /dev/null @@ -1,430 +0,0 @@ -'use strict'; - -var flowDoctrine = require('../../lib/flow_doctrine.js'), - parse = require('../../lib/parsers/javascript'), - FLOW_TYPES = require('babel-types').FLOW_TYPES, - test = require('tap').test; - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -test('flowDoctrine', function(t) { - var types = FLOW_TYPES.filter(function(type) { - return type.match(/\wTypeAnnotation$/); - }); - - function toDoctrineType(flowType) { - var annotation = toComment( - '/** add */function add(a: ' + flowType + ' ) { }' - ).context.ast.node.params[0].typeAnnotation.typeAnnotation; - if (types.indexOf(annotation.type) !== -1) { - types.splice(types.indexOf(annotation.type), 1); - } - return flowDoctrine(annotation); - } - - t.deepEqual( - toDoctrineType('number'), - { - type: 'NameExpression', - name: 'number' - }, - 'number' - ); - - t.deepEqual( - toDoctrineType('string'), - { - type: 'NameExpression', - name: 'string' - }, - 'string' - ); - - t.deepEqual( - toDoctrineType('any'), - { - type: 'AllLiteral' - }, - 'all' - ); - - t.deepEqual( - toDoctrineType('(y:Foo) => Bar'), - { - type: 'FunctionType', - params: [ - { - type: 'ParameterType', - name: 'y', - expression: { - type: 'NameExpression', - name: 'Foo' - } - } - ], - result: { - type: 'NameExpression', - name: 'Bar' - } - }, - 'function type' - ); - - t.deepEqual( - toDoctrineType('?number'), - { - type: 'NullableType', - expression: { - type: 'NameExpression', - name: 'number' - } - }, - 'nullable' - ); - - t.deepEqual( - toDoctrineType('number | string'), - { - type: 'UnionType', - elements: [ - { - type: 'NameExpression', - name: 'number' - }, - { - type: 'NameExpression', - name: 'string' - } - ] - }, - 'union' - ); - - t.deepEqual( - toDoctrineType('Object'), - { - type: 'NameExpression', - name: 'Object' - }, - 'object' - ); - - t.deepEqual( - toDoctrineType('namedType.propertyOfType'), - { - type: 'NameExpression', - name: 'namedType.propertyOfType' - }, - 'named type with property' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - applications: [ - { - type: 'NameExpression', - name: 'namedType.propertyOfType' - } - ], - expression: { - name: 'Array', - type: 'NameExpression' - }, - type: 'TypeApplication' - }, - 'typeapplication of named type with property' - ); - - t.deepEqual( - toDoctrineType('Array>'), - { - applications: [ - { - applications: [ - { - name: 'boolean', - type: 'NameExpression' - } - ], - expression: { - type: 'NameExpression', - name: 'namedType.propertyOfType' - }, - type: 'TypeApplication' - } - ], - expression: { - name: 'Array', - type: 'NameExpression' - }, - type: 'TypeApplication' - }, - 'nested type application' - ); - - t.deepEqual( - toDoctrineType('{ a: foo.bar }'), - { - fields: [ - { - key: 'a', - type: 'FieldType', - value: { - name: 'foo.bar', - type: 'NameExpression' - } - } - ], - type: 'RecordType' - }, - 'object type expression with subtype' - ); - - t.deepEqual( - toDoctrineType('{ a: { b: foo.bar } }'), - { - fields: [ - { - key: 'a', - type: 'FieldType', - value: { - type: 'RecordType', - fields: [ - { - key: 'b', - type: 'FieldType', - value: { - name: 'foo.bar', - type: 'NameExpression' - } - } - ] - } - } - ], - type: 'RecordType' - }, - 'nested fieldtype' - ); - - t.deepEqual( - toDoctrineType('{ a: 1 }'), - { - type: 'RecordType', - fields: [ - { - type: 'FieldType', - key: 'a', - value: { - type: 'NumericLiteralType', - value: 1 - } - } - ] - }, - 'object with properties' - ); - - t.deepEqual( - toDoctrineType('mixed'), - { - type: 'AllLiteral' - }, - 'alias mixed to any for now' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - type: 'NameExpression', - name: 'Array' - }, - 'array' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - 'Array' - ); - - t.deepEqual( - toDoctrineType('number[]'), - { - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - 'number[]' - ); - - t.deepEqual( - toDoctrineType('[]'), - { - type: 'ArrayType', - elements: [] - }, - '[]' - ); - - t.deepEqual( - toDoctrineType('[number]'), - { - type: 'ArrayType', - elements: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - '[number]' - ); - - t.deepEqual( - toDoctrineType('[string, boolean]'), - { - type: 'ArrayType', - elements: [ - { - type: 'NameExpression', - name: 'string' - }, - { - type: 'NameExpression', - name: 'boolean' - } - ] - }, - '[string, boolean]' - ); - - t.deepEqual( - toDoctrineType('boolean'), - { - type: 'NameExpression', - name: 'boolean' - }, - 'boolean' - ); - - t.deepEqual( - toDoctrineType('any => any'), - { - type: 'FunctionType', - params: [ - { - expression: { type: 'AllLiteral' }, - name: '', - type: 'ParameterType' - } - ], - result: { type: 'AllLiteral' } - }, - '' - ); - - t.deepEqual( - toDoctrineType('undefined'), - { - type: 'NameExpression', - name: 'undefined' - }, - 'undefined' - ); - - t.deepEqual( - toDoctrineType('"value"'), - { - type: 'StringLiteralType', - value: 'value' - }, - 'StringLiteralType' - ); - - t.deepEqual( - toDoctrineType('1'), - { - type: 'NumericLiteralType', - value: '1' - }, - 'NumericLiteralType' - ); - - t.deepEqual( - toDoctrineType('true'), - { - type: 'BooleanLiteralType', - value: true - }, - 'BooleanLiteralType' - ); - - t.deepEqual( - toDoctrineType('false'), - { - type: 'BooleanLiteralType', - value: false - }, - 'BooleanLiteralType' - ); - - t.deepEqual( - toDoctrineType('null'), - { - type: 'NullLiteral' - }, - 'NullLiteral' - ); - - t.deepEqual( - toDoctrineType('void'), - { - type: 'VoidLiteral' - }, - 'VoidLiteral' - ); - - // TODO: remove all these types - t.deepEqual( - types, - [ - 'IntersectionTypeAnnotation', - 'EmptyTypeAnnotation', - 'ThisTypeAnnotation', - 'TypeofTypeAnnotation' - ], - 'Type coverage' - ); - - t.end(); -}); diff --git a/test/lib/git/find_git.js b/test/lib/git/find_git.js deleted file mode 100644 index 9e4578a92..000000000 --- a/test/lib/git/find_git.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var test = require('tap').test, - mock = require('mock-fs'), - mockRepo = require('./mock_repo'), - path = require('path'), - findGit = require('../../../lib/git/find_git'); - -test('findGit', function(t) { - mock(mockRepo.master); - - const root = path.parse(__dirname).root; - - t.equal( - findGit(root + path.join('my', 'repository', 'path', 'index.js')), - root + path.join('my', 'repository', 'path', '.git'), - 'finds git path' - ); - - mock.restore(); - - t.end(); -}); diff --git a/test/lib/git/url_prefix.js b/test/lib/git/url_prefix.js deleted file mode 100644 index b49f33635..000000000 --- a/test/lib/git/url_prefix.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -var test = require('tap').test, - mock = require('mock-fs'), - mockRepo = require('./mock_repo'), - getGithubURLPrefix = require('../../../lib/git/url_prefix'), - parsePackedRefs = getGithubURLPrefix.parsePackedRefs; - -test('getGithubURLPrefix', function(t) { - mock(mockRepo.master); - - t.equal( - getGithubURLPrefix('/my/repository/path/'), - 'https://github.com/foo/bar/blob/this_is_the_sha/', - 'finds git path on master branch' - ); - - mock.restore(); - - mock(mockRepo.detached); - - t.equal( - getGithubURLPrefix('/my/repository/path/'), - 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/', - 'finds git path with a detached head' - ); - - mock.restore(); - - t.end(); -}); - -test('parsePackedRefs', function(t) { - var input = '# pack-refs with: peeled fully-peeled\n' + - '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' + - '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types'; - t.equal( - parsePackedRefs(input, 'refs/heads/babel-6'), - '4acd658617928bd17ae7364ef2512630d97c007a', - 'Finds babel 6 ref' - ); - t.end(); -}); diff --git a/test/lib/github.js b/test/lib/github.js deleted file mode 100644 index 34f362e75..000000000 --- a/test/lib/github.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -/* eslint no-unused-vars: 0 */ - -var test = require('tap').test, - mock = require('mock-fs'), - path = require('path'), - mockRepo = require('./git/mock_repo'), - parse = require('../../lib/parsers/javascript'), - github = require('../../lib/github'); - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - ).map(github); -} - -const root = path.parse(__dirname).root; - -function evaluate(fn) { - return toComment( - fn, - root + path.join('my', 'repository', 'path', 'index.js') - ); -} - -test('github', function(t) { - mock(mockRepo.master); - - t.deepEqual( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - { - path: 'index.js', - url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, - 'gets github url' - ); - - mock.restore(); - - t.end(); -}); - -test('malformed repository', function(t) { - mock(mockRepo.malformed); - - t.equal( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - undefined, - 'does not crash' - ); - - mock.restore(); - - t.end(); -}); - -test('enterprise repository', function(t) { - mock(mockRepo.enterprise); - - t.deepEqual( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - { - path: 'index.js', - url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, - 'gets github enterprise url' - ); - - mock.restore(); - - t.end(); -}); diff --git a/test/lib/infer/access.js b/test/lib/infer/access.js deleted file mode 100644 index 21355671c..000000000 --- a/test/lib/infer/access.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name'), - inferAccess = require('../../../lib/infer/access'); - -function toComment(fn) { - return parse( - { - source: '(' + fn.toString() + ')' - }, - {} - )[0]; -} - -function evaluate(fn, re) { - return inferAccess(re)(inferName(toComment(fn))); -} - -test('inferAccess', function(t) { - t.equal( - evaluate( - function() { - /** Test */ - function _name() {} - }, - '^_' - ).access, - 'private' - ); - - t.equal( - evaluate( - function() { - /** @private */ - function name() {} - }, - '^_' - ).access, - 'private' - ); - - t.equal( - evaluate( - function() { - /** @public */ - function _name() {} - }, - '^_' - ).access, - 'public' - ); - - t.equal( - evaluate( - function() { - /** Test */ - function name_() {} - }, - '_$' - ).access, - 'private' - ); - - t.end(); -}); diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js deleted file mode 100644 index 65edac6bf..000000000 --- a/test/lib/infer/params.js +++ /dev/null @@ -1,379 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferParams = require('../../../lib/infer/params'); - -function toComment(fn, file) { - return parse( - { - file, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -function evaluate(fn, file) { - return inferParams(toComment(fn, file)); -} - -test('mergeTrees', function(t) { - t.deepEqual( - inferParams.mergeTrees( - [], - [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'string' - } - } - ] - ), - { - errors: [ - { - commentLineNumber: null, - message: "An explicit parameter named a was specified but didn't match inferred information " - } - ], - mergedParams: [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'string' - } - } - ] - } - ); - - t.deepEqual( - inferParams.mergeTrees( - [ - { - title: 'param', - name: '$0', - anonymous: true, - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'object' - }, - properties: [ - { - title: 'param', - name: '$0.a', - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'string' - }, - properties: [] - } - ] - } - ], - [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'object' - } - } - ] - ), - { - errors: [], - mergedParams: [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'object' - }, - properties: [ - { - title: 'param', - name: 'a.a', - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'string' - }, - properties: [] - } - ] - } - ] - } - ); - - t.end(); -}); - -test('inferParams', function(t) { - t.deepEqual( - evaluate(function() { - /** Test */ - function f(x) {} - }).params, - [{ lineNumber: 3, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate(function() { - /** Test */ - var f = function(x) {}; - }).params, - [{ lineNumber: 3, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate(`/** Test */function f({ x, ...xs }) {};`).params, - [ - { - title: 'param', - name: '$0', - anonymous: true, - type: { - type: 'NameExpression', - name: 'Object' - }, - properties: [ - { - title: 'param', - name: '$0.x', - lineNumber: 1 - }, - { - title: 'param', - name: '$0.xs', - lineNumber: 1, - type: { - type: 'RestType' - } - } - ] - } - ], - 'object spread property' - ); - - t.deepEqual( - evaluate( - ` - /** - * Test - * @param {Object} a renamed destructuring param - */ - var f = function({ x }) {}; - ` - ).params, - [ - { - description: { - children: [ - { - children: [ - { - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - indent: [], - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'text', - value: 'renamed destructuring param' - } - ], - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - indent: [], - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'paragraph' - } - ], - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'root' - }, - lineNumber: 2, - name: 'a', - properties: [ - { - lineNumber: 6, - name: 'a.x', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ] - ); - - t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.deepEqual( - evaluate(function() { - var x = 1, - g = function(y) {}, - /** Test */ - f = function(x) {}; - }).params, - [{ lineNumber: 5, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f(x = 4) {} - ` - ).params, - [ - { - default: '4', - name: 'x', - title: 'param', - lineNumber: 3, - type: null - } - ], - 'default params' - ); - - t.deepEqual( - evaluate( - ` - /** Test - * @param {number} x - */ - function f(x = 4) {} - ` - ).params, - [ - { - default: '4', - name: 'x', - title: 'param', - lineNumber: 1, - type: { - type: 'NameExpression', - name: 'number' - } - } - ], - 'default params with type' - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f({ x: y }) {} - ` - ).params, - [ - { - anonymous: true, - name: '$0', - properties: [ - { - lineNumber: 3, - name: '$0.x', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ], - 'renaming' - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f({ x: { y: { z } } }) {} - ` - ).params, - [ - { - anonymous: true, - name: '$0', - properties: [ - { - lineNumber: 3, - name: '$0.x.y.z', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ], - 'renaming' - ); - - t.deepEqual(evaluate('/** Test */ export function f(x) {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.deepEqual(evaluate('/** Test */ export default function f(x) {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.end(); -}); diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js deleted file mode 100644 index e770cc75d..000000000 --- a/test/lib/input/shallow.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - shallow = require('../../../lib/input/shallow'); - -test('shallow deps', function(t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], { - }).then(deps => { - t.equal(deps.length, 1); - t.ok(deps[0], 'has path'); - t.end(); - }); -}); - -test('shallow deps multi', function(t) { - shallow( - [ - path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), - path.resolve(path.join(__dirname, '../../fixture/es6.output.json')) - ], - {} - ).then(deps => { - t.equal(deps.length, 2); - t.ok(deps[0], 'has path'); - t.end(); - }); -}); - -test('shallow deps directory', function(t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/html'))], {}) - .then(deps => { - t.equal(deps.length, 1); - t.ok(deps[0].file.match(/input.js/), 'is the input file'); - t.end(); - }) - .catch(err => { - t.fail(err); - t.end(); - }); -}); - -test('throws on non-string or object input', function(t) { - shallow([true], {}).catch(err => { - t.equal(err.message, 'Indexes should be either strings or objects'); - t.end(); - }); -}); - -test('shallow deps literal', function(t) { - var obj = { - file: 'foo.js', - source: '//bar' - }; - shallow([obj], {}).then(deps => { - t.equal(deps[0], obj); - t.end(); - }); -}); diff --git a/test/lib/lint.js b/test/lib/lint.js deleted file mode 100644 index f64514ebd..000000000 --- a/test/lib/lint.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - lintComments = require('../../lib/lint').lintComments, - formatLint = require('../../lib/lint').formatLint; - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -function evaluate(fn) { - return lintComments(toComment(fn, 'input.js')); -} - -test('lintComments', function(t) { - t.deepEqual( - evaluate(function() { - /** - * @param {foo - */ - }).errors, - [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' } - ], - 'doctrine error' - ); - - t.deepEqual( - evaluate(function() { - /** - * @param {String} foo - * @param {array} bar - */ - }).errors, - [ - { - commentLineNumber: 1, - message: 'type String found, string is standard' - }, - { commentLineNumber: 2, message: 'type array found, Array is standard' } - ], - 'non-canonical' - ); - - t.deepEqual( - evaluate(function() { - /** - * @param {string} foo - */ - }).errors, - [], - 'no errors' - ); - - t.end(); -}); - -test('formatLint', function(t) { - var comment = evaluate(function() { - // 2 - // 3 - /** 4 - * @param {String} foo - * @param {array} bar - * @param {foo - */ - }); - - var formatted = formatLint([comment]); - - t.contains(formatted, 'input.js'); - t.contains(formatted, /4:1[^\n]+Braces are not balanced/); - t.contains(formatted, /4:1[^\n]+Missing or invalid tag name/); - t.contains(formatted, /5:1[^\n]+type String found, string is standard/); - t.contains(formatted, /6:1[^\n]+type array found, Array is standard/); - t.contains(formatted, '4 warnings'); - - t.end(); -}); diff --git a/test/lib/output/util/formatters.js b/test/lib/output/util/formatters.js deleted file mode 100644 index 26babb131..000000000 --- a/test/lib/output/util/formatters.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; -var test = require('tap').test; -var formatters = require('../../../../lib/output/util/formatters')(getHref); - -test('formatters.parameters -- long form', function(t) { - t.deepEqual(formatters.parameters({}), '()'); - t.deepEqual(formatters.parameters({ params: [] }), '()'); - t.deepEqual( - formatters.parameters({ params: [{ name: 'foo' }] }), - '(foo: any)' - ); - t.deepEqual( - formatters.parameters({ - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }), - '(foo: any?)' - ); - t.done(); -}); - -test('formatters.parameters -- short form', function(t) { - t.deepEqual(formatters.parameters({}, true), '()'); - t.deepEqual(formatters.parameters({ params: [] }, true), '()'); - t.deepEqual( - formatters.parameters({ params: [{ name: 'foo' }] }, true), - '(foo)' - ); - t.deepEqual( - formatters.parameters( - { - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }, - true - ), - '(foo?)' - ); - t.deepEqual( - formatters.parameters( - { - params: [ - { - title: 'param', - description: 'param', - type: { - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'number' - } - }, - name: 'bar', - default: '1' - } - ] - }, - true - ), - '(bar = 1)' - ); - t.done(); -}); - -function getHref(x) { - return x; -} diff --git a/test/lib/parse.js b/test/lib/parse.js deleted file mode 100644 index ebc18d566..000000000 --- a/test/lib/parse.js +++ /dev/null @@ -1,1452 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - remark = require('remark'), - visit = require('unist-util-visit'); - -function pick(obj, props) { - if (Array.isArray(props)) { - return props.reduce( - function(memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, - {} - ); - } - return obj[props]; -} - -function evaluate(fn, filename) { - return parse( - { - file: filename || 'test.js', - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - ); -} - -function addJSDocTag(tree) { - visit(tree, 'link', function(node) { - node.jsdoc = true; - }); - return tree; -} - -function removePosition(tree) { - visit(tree, function(node) { - delete node.position; - }); - return tree; -} - -test('parse - @abstract', function(t) { - t.equal( - evaluate(function() { - /** @abstract */ - })[0].abstract, - true - ); - - t.end(); -}); - -test('parse - @access', function(t) { - t.equal( - evaluate(function() { - /** @access public */ - })[0].access, - 'public', - 'access public' - ); - - t.equal( - evaluate(function() { - /** @access protected */ - })[0].access, - 'protected', - 'access protected' - ); - - t.equal( - evaluate(function() { - /** @access private */ - })[0].access, - 'private', - 'access private' - ); - - t.end(); -}); - -test('parse - @alias', function(t) { - t.end(); -}); - -test('parse - @arg', function(t) { - t.end(); -}); - -test('parse - @argument', function(t) { - t.end(); -}); - -test('parse - @augments', function(t) { - t.equal( - evaluate(function() { - /** @augments Foo */ - })[0].augments[0].name, - 'Foo', - 'augments' - ); - - t.end(); -}); - -test('parse - @description', function(t) { - t.deepEqual( - evaluate(function() { - /** - * This is a free-form description - * @description This tagged description wins, and [is markdown](http://markdown.com). - */ - })[0].description, - remark().parse( - 'This tagged description wins, and [is markdown](http://markdown.com).' - ), - 'description' - ); - - t.end(); -}); - -/* - * Dossier-style augments tag - * https://github.com/google/closure-library/issues/746 - */ -test('parse - @augments in dossier style', function(t) { - t.equal( - evaluate(function() { - /** @augments {Foo} */ - })[0].augments[0].name, - 'Foo', - 'augments' - ); - - t.end(); -}); - -test('parse - @augments of complex passes through', function(t) { - t.deepEqual( - evaluate(function() { - /** @augments {function()} */ - })[0].augments, - [] - ); - - t.end(); -}); - -test('parse - @author', function(t) { - t.end(); -}); - -test('parse - @borrows', function(t) { - t.end(); -}); - -test('parse - @callback', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @callback name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'typedef', - type: { - type: 'NameExpression', - name: 'Function' - } - } - ); - - t.end(); -}); - -test('parse - @class', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @class */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'class' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @class name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'class' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @class {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'class', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @classdesc', function(t) { - t.deepEqual( - evaluate(function() { - /** @classdesc test */ - })[0].classdesc, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @const', function(t) { - t.end(); -}); - -test('parse - @constant', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @constant */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant {Object} */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @constructor', function(t) { - t.end(); -}); - -test('parse - @constructs', function(t) { - t.end(); -}); - -test('parse - @copyright', function(t) { - t.deepEqual( - evaluate(function() { - /** @copyright test */ - })[0].copyright, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @default', function(t) { - t.end(); -}); - -test('parse - @defaultvalue', function(t) { - t.end(); -}); - -test('parse - @deprecated', function(t) { - t.deepEqual( - evaluate(function() { - /** @deprecated test */ - })[0].deprecated, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @desc', function(t) { - t.deepEqual( - evaluate(function() { - /** @desc test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @description', function(t) { - t.deepEqual( - evaluate(function() { - /** @description test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - description', function(t) { - t.deepEqual( - evaluate(function() { - /** test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @emits', function(t) { - t.end(); -}); - -test('parse - @enum', function(t) { - t.end(); -}); - -test('parse - @event', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @event name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'event', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @example', function(t) { - t.deepEqual( - evaluate(function() { - /** @example test */ - })[0].examples[0], - { - description: 'test' - }, - 'single line' - ); - - t.deepEqual( - evaluate(function() { - /** - * @example - * a - * b - */ - })[0].examples[0], - { - description: 'a\nb' - }, - 'multiline' - ); - - t.deepEqual( - evaluate(function() { - /** - * @example caption - * a - * b - */ - })[0].examples[0], - { - description: 'a\nb', - caption: remark().parse('caption') - }, - 'with caption' - ); - - t.deepEqual( - evaluate(function() { - /** @example */ - })[0].errors[0], - { - message: '@example without code', - commentLineNumber: 0 - }, - 'missing description' - ); - - t.end(); -}); - -test('parse - @exception', function(t) { - t.end(); -}); - -test('parse - @exports', function(t) { - t.end(); -}); - -test('parse - @extends', function(t) { - t.deepEqual( - evaluate(function() { - /** @extends Foo */ - })[0].augments[0].name, - 'Foo', - 'extends' - ); - - t.end(); -}); - -test('parse - @external', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @external name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'external', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @file', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @file */ - })[0], - ['kind'] - ), - { - kind: 'file' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @file desc */ - })[0], - ['kind', 'description'] - ), - { - kind: 'file', - description: remark().parse('desc') - } - ); - - t.end(); -}); - -test('parse - @fileoverview', function(t) { - t.end(); -}); - -test('parse - @fires', function(t) { - t.end(); -}); - -test('parse - @func', function(t) { - t.end(); -}); - -test('parse - @function', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @function */ - })[0], - ['kind', 'name'] - ), - { - kind: 'function' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @function name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'function', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @global', function(t) { - t.equal( - evaluate(function() { - /** @global */ - })[0].scope, - 'global', - 'global' - ); - - t.end(); -}); - -test('parse - @host', function(t) { - t.end(); -}); - -test('parse - @ignore', function(t) { - t.equal( - evaluate(function() { - /** @ignore */ - })[0].ignore, - true - ); - - t.end(); -}); - -test('parse - @implements', function(t) { - t.end(); -}); - -test('parse - @inheritdoc', function(t) { - t.end(); -}); - -test('parse - @inner', function(t) { - t.equal( - evaluate(function() { - /** @inner*/ - })[0].scope, - 'inner', - 'inner' - ); - - t.end(); -}); - -test('parse - @instance', function(t) { - t.equal( - evaluate(function() { - /** @instance*/ - })[0].scope, - 'instance', - 'instance' - ); - - t.end(); -}); - -test('parse - @interface', function(t) { - t.deepEqual( - evaluate(function() { - /** @interface */ - })[0].interface, - true, - 'anonymous' - ); - - t.deepEqual( - evaluate(function() { - /** @interface Foo */ - })[0].name, - 'Foo', - 'named' - ); - - t.end(); -}); - -test('parse - @kind', function(t) { - t.equal( - evaluate(function() { - /** @kind class */ - })[0].kind, - 'class', - 'kind' - ); - - t.end(); -}); - -test('parse - @license', function(t) { - t.end(); -}); - -test('parse - @listens', function(t) { - t.end(); -}); - -test('parse - @member', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @member */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member {Object} */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @memberof', function(t) { - t.equal( - evaluate(function() { - /** @memberof test */ - })[0].memberof, - 'test', - 'memberof' - ); - - t.end(); -}); - -test('parse - @method', function(t) { - t.end(); -}); - -test('parse - @mixes', function(t) { - t.end(); -}); - -test('parse - @mixin', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @mixin */ - })[0], - ['kind', 'name'] - ), - { - kind: 'mixin' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @mixin name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'mixin', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @module', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @module */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @module name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @module {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @name', function(t) { - t.equal( - evaluate(function() { - /** @name test */ - })[0].name, - 'test', - 'name' - ); - - t.end(); -}); - -test('parse - @namespace', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @namespace */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @namespace name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @namespace {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @override', function(t) { - t.equal( - evaluate(function() { - /** @override */ - })[0].override, - true - ); - - t.end(); -}); - -test('parse - @overview', function(t) { - t.end(); -}); - -test('parse - @param', function(t) { - t.deepEqual( - evaluate(function() { - /** @param test */ - })[0].params[0], - { - name: 'test', - title: 'param', - lineNumber: 0 - }, - 'name' - ); - - t.deepEqual( - evaluate(function() { - /** @param {number} test */ - })[0].params[0], - { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @param {number} test - desc */ - })[0].params[0], - { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @private', function(t) { - t.equal( - evaluate(function() { - /** @private */ - })[0].access, - 'private', - 'private' - ); - - t.end(); -}); - -test('parse - @prop', function(t) { - t.deepEqual( - evaluate(function() { - /** @prop {number} test */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @prop {number} test - desc */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @property', function(t) { - t.deepEqual( - evaluate(function() { - /** @property {number} test */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @property {number} test - desc */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @protected', function(t) { - t.equal( - evaluate(function() { - /** @protected */ - })[0].access, - 'protected', - 'protected' - ); - - t.end(); -}); - -test('parse - @public', function(t) { - t.end(); -}); - -test('parse - @readonly', function(t) { - t.equal( - evaluate(function() { - /** @readonly */ - })[0].readonly, - true - ); - - t.end(); -}); - -test('parse - @requires', function(t) { - t.end(); -}); - -test('parse - @return', function(t) { - t.deepEqual( - evaluate(function() { - /** @return test */ - })[0].returns[0], - { - title: 'returns', - description: remark().parse('test') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @return {number} test */ - })[0].returns[0], - { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, - 'description and type' - ); - - t.end(); -}); - -test('parse - @returns', function(t) { - t.deepEqual( - evaluate(function() { - /** @returns test */ - })[0].returns[0], - { - title: 'returns', - description: remark().parse('test') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @returns {number} test */ - })[0].returns[0], - { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, - 'description and type' - ); - - t.end(); -}); - -test('parse - @see', function(t) { - t.deepEqual( - evaluate(function() { - /** @see test */ - })[0].sees, - [remark().parse('test')], - 'single' - ); - - t.deepEqual( - evaluate(function() { - /** - * @see a - * @see b - */ - })[0].sees, - [remark().parse('a'), remark().parse('b')], - 'multiple' - ); - - t.end(); -}); - -test('parse - @since', function(t) { - t.end(); -}); - -test('parse - @static', function(t) { - t.equal( - evaluate(function() { - /** @static */ - })[0].scope, - 'static', - 'static' - ); - - t.end(); -}); - -test('parse - @summary', function(t) { - t.deepEqual( - evaluate(function() { - /** @summary test */ - })[0].summary, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @this', function(t) { - t.end(); -}); - -test('parse - @throws', function(t) { - t.deepEqual( - evaluate(function() { - /** @throws desc */ - })[0].throws[0], - { - description: remark().parse('desc') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @throws {Error} */ - })[0].throws[0], - { - type: { - name: 'Error', - type: 'NameExpression' - } - }, - 'type' - ); - - t.deepEqual( - evaluate(function() { - /** @throws {Error} desc */ - })[0].throws[0], - { - type: { - name: 'Error', - type: 'NameExpression' - }, - description: remark().parse('desc') - }, - 'type and description' - ); - - t.deepEqual( - evaluate(function() { - /** - * @throws a - * @throws b - */ - })[0].throws, - [ - { - description: remark().parse('a') - }, - { - description: remark().parse('b') - } - ], - 'multiple' - ); - - t.end(); -}); - -test('parse - @todo', function(t) { - t.deepEqual( - evaluate(function() { - /** @todo test */ - })[0].todos, - [remark().parse('test')], - 'single' - ); - - t.deepEqual( - evaluate(function() { - /** - * @todo a - * @todo b - */ - })[0].todos, - [remark().parse('a'), remark().parse('b')], - 'multiple' - ); - - t.end(); -}); - -test('parse - @tutorial', function(t) { - t.end(); -}); - -test('parse - @type', function(t) { - t.end(); -}); - -test('parse - @typedef', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @typedef {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'typedef', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @var', function(t) { - t.end(); -}); - -test('parse - @variation', function(t) { - t.equal( - evaluate(function() { - /** @variation 1 */ - })[0].variation, - 1, - 'variation' - ); - - t.end(); -}); - -test('parse - @version', function(t) { - t.end(); -}); - -test('parse - @virtual', function(t) { - t.end(); -}); - -test('parse - unknown tag', function(t) { - t.deepEqual( - evaluate(function() { - /** @unknown */ - })[0].errors[0], - { - message: 'unknown tag @unknown', - commentLineNumber: 0 - } - ); - - t.end(); -}); - -test('parse - {@link}', function(t) { - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[Foo](Foo)'))) - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo|text} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[text](Foo)'))) - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo text} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[text](Foo)'))) - ); - - t.done(); -}); - -test('parse - {@linkcode}', function(t) { - t.end(); -}); - -test('parse - {@linkplain}', function(t) { - t.end(); -}); - -test('parse - {@tutorial}', function(t) { - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'id' - } - ] - } - ] - } - ] - } - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id|text} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'text' - } - ] - } - ] - } - ] - } - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id text} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'text' - } - ] - } - ] - } - ] - } - ); - - t.done(); -}); diff --git a/test/lib/parsers/javascript.js b/test/lib/parsers/javascript.js deleted file mode 100644 index 022506bee..000000000 --- a/test/lib/parsers/javascript.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -var test = require('tap').test, - remark = require('remark'), - parse = require('../../../lib/parsers/javascript'); - -function toComments(source, filename, opts) { - source = typeof source === 'string' ? source : '(' + source.toString() + ')'; - return parse( - { - file: filename || 'test.js', - source - }, - opts || {} - ); -} - -test('parse - leading comment', function(t) { - t.deepEqual( - toComments(function() { - /** one */ - /** two */ - function two() {} - }).map(function(c) { - return c.description; - }), - [remark().parse('one'), remark().parse('two')] - ); - t.end(); -}); - -test('parse - trailing comment', function(t) { - t.deepEqual( - toComments(function() { - /** one */ - function one() {} - /** two */ - }).map(function(c) { - return c.description; - }), - [remark().parse('one'), remark().parse('two')] - ); - t.end(); -}); - -test('parse - unknown tag', function(t) { - t.equal( - toComments(function() { - /** @unknown */ - })[0].tags[0].title, - 'unknown' - ); - t.end(); -}); - -test('parse - error', function(t) { - t.deepEqual( - toComments(function() { - /** @param {foo */ - })[0].errors, - [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' } - ] - ); - t.end(); -}); - -test('parse - document exported', function(t) { - t.equal( - toComments( - ` - export class C {} - ` - ).length, - 0 - ); - t.equal( - toComments( - ` - export class C {} - `, - 'test.js', - { documentExported: true } - ).length, - 1 - ); - t.equal( - toComments( - ` - export class C { - method() {} - } - `, - 'test.js', - { documentExported: true } - ).length, - 2 - ); - t.end(); -}); diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js deleted file mode 100644 index 9025fac35..000000000 --- a/test/lib/parsers/polyglot.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var test = require('tap').test, - fs = require('fs'), - path = require('path'), - remark = require('remark'), - polyglot = require('../../../lib/parsers/polyglot'); - -test('polyglot', function(t) { - var file = path.resolve( - path.join(__dirname, '../../fixture/polyglot/blend.cpp') - ); - var result = polyglot({ - file, - source: fs.readFileSync(file, 'utf8') - }); - delete result[0].context.file; - delete result[0].context.sortKey; - t.deepEqual( - result, - [ - { - errors: [], - augments: [], - examples: [], - properties: [], - throws: [], - todos: [], - sees: [], - context: { - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } - }, - description: remark().parse('This method moves a hex to a color'), - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, - name: 'hexToUInt32Color', - params: [ - { - lineNumber: 3, - title: 'param', - name: 'hex', - type: { - name: 'string', - type: 'NameExpression' - } - } - ], - returns: [ - { - title: 'returns', - description: remark().parse('color'), - type: { - name: 'number', - type: 'NameExpression' - } - } - ], - tags: [ - { - description: null, - lineNumber: 2, - name: 'hexToUInt32Color', - title: 'name' - }, - { - description: null, - lineNumber: 3, - name: 'hex', - title: 'param', - type: { - name: 'string', - type: 'NameExpression' - } - }, - { - description: 'color', - lineNumber: 4, - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - } - ] - } - ], - 'polyglot parser' - ); - t.end(); -}); diff --git a/test/lib/server.js b/test/lib/server.js deleted file mode 100644 index ab2fbc3e6..000000000 --- a/test/lib/server.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var test = require('tap').test, - get = require('../utils').get, - File = require('vinyl'), - Server = require('../../lib/serve/server'); - -var jsFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/file.js', - contents: new Buffer('var test = 123;') -}); - -var coffeeFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/file.coffee', - contents: new Buffer('test = 123') -}); - -var indexFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/index.html', - contents: new Buffer('') -}); - -test('server - throws on bad port', function(t) { - t.throws( - function() { - var server = new Server('4001'); - }, - 'port must be a number' - ); - t.throws( - function() { - var server = new Server(); - }, - 'port must be provided' - ); - t.end(); -}); - -test('server', function(t) { - var server = new Server(4001); - t.ok(server, 'server is initialized'); - server.start().then(function() { - t.test( - 'start can be called more than once, without a callback', - function(tt) { - server.start(); - tt.end(); - } - ); - - t.test('base path', function(tt) { - get('http://localhost:4001/file.coffee', function(code) { - tt.equal(code, 404, 'does not have a file, emits 404'); - tt.end(); - }); - }); - - t.test('base path', function(tt) { - server.setFiles([coffeeFile]); - get('http://localhost:4001/file.coffee', function(text) { - tt.equal(text, 'test = 123', 'emits response'); - tt.end(); - }); - }); - - t.test('reset files', function(tt) { - server.setFiles([coffeeFile, jsFile]); - get('http://localhost:4001/file.js', function(text) { - tt.equal(text, 'var test = 123;', 'emits response'); - tt.end(); - }); - }); - - t.test('index.html special case', function(tt) { - server.setFiles([coffeeFile, indexFile, jsFile]); - get('http://localhost:4001/', function(text) { - tt.equal(text, '', 'sends index.html when / is requested'); - tt.end(); - }); - }); - - t.test('cleanup', function(tt) { - server.stop().then(function() { - tt.end(); - }); - }); - - t.test( - 'stop can be called more than once, without a callback', - function(tt) { - server.stop(); - tt.end(); - } - ); - - t.end(); - }); -}); diff --git a/test/lib/walk.js b/test/lib/walk.js deleted file mode 100644 index 10d9645e8..000000000 --- a/test/lib/walk.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -var test = require('tap').test, walk = require('../../lib/walk'); - -test('walk', function(group) { - group.test('flat comments', function(t) { - var comments = [{ name: 'Tom' }]; - - function renamer(comment, options) { - if (options) { - comment.name = options.name; - } else { - comment.name = 'Tim'; - } - } - - t.deepEqual(walk(comments, renamer), [{ name: 'Tim' }], 'no-option case'); - - t.deepEqual( - walk(comments, renamer, { name: 'John' }), - [{ name: 'John' }], - 'with options' - ); - - t.end(); - }); - - group.test('nested comments', function(t) { - var comments = [ - { - name: 'Tom', - members: { - static: [ - { - name: 'Billy' - } - ] - } - } - ]; - - function renamer(comment, options) { - if (options) { - comment.name = options.name; - } else { - comment.name = 'Tim'; - } - } - - t.deepEqual( - walk(comments, renamer), - [ - { - name: 'Tim', - members: { - static: [ - { - name: 'Tim' - } - ] - } - } - ], - 'no-option case' - ); - - t.deepEqual( - walk(comments, renamer, { - name: 'Bob' - }), - [ - { - name: 'Bob', - members: { - static: [ - { - name: 'Bob' - } - ] - } - } - ], - 'with options' - ); - - t.end(); - }); - - group.end(); -}); diff --git a/test/linker.js b/test/linker.js deleted file mode 100644 index 2a4192e82..000000000 --- a/test/linker.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; -var LinkerStack = require('../lib/output/util/linker_stack'), - test = require('tap').test; - -test('linkerStack', function(t) { - var linkerStack = new LinkerStack({}); - - t.equal( - linkerStack.link('string'), - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String', - 'Default global resolution of string' - ); - - t.equal( - new LinkerStack({ - paths: { - Point: 'http://geojson.org/geojson-spec.html#point' - } - }).link('Point'), - 'http://geojson.org/geojson-spec.html#point', - 'Custom hardcoded path for a GeoJSON type' - ); - - t.equal( - new LinkerStack({ - paths: { - Image: 'http://custom.com/' - } - }).link('Image'), - 'http://custom.com/', - 'Prefers config link to native.' - ); - - var linker = new LinkerStack({ - paths: { - Image: 'http://custom.com/' - } - }); - - linker.namespaceResolver( - [ - { - namespace: 'Image' - } - ], - function(namespace) { - return '#' + namespace; - } - ); - - t.equal(linker.link('Image'), '#Image', 'Prefers local link over all.'); - - t.end(); -}); diff --git a/test/normalize.js b/test/normalize.js deleted file mode 100644 index fe457040c..000000000 --- a/test/normalize.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var walk = require('../lib/walk'); - -module.exports = function(comments) { - return walk(comments, function(comment) { - var hasGithub = !!comment.context.github; - var path = comment.context.path; - comment.context = { - loc: comment.context.loc - }; - if (hasGithub) { - comment.context.github = '[github]'; - } - if (path) { - comment.context.path = path; - } - }); -}; diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 71bc9faf3..000000000 --- a/test/test.js +++ /dev/null @@ -1,337 +0,0 @@ -'use strict'; - -var test = require('tap').test, - documentationSchema = require('documentation-schema'), - validate = require('json-schema'), - documentation = require('../'), - outputMarkdown = require('../lib/output/markdown.js'), - outputMarkdownAST = require('../lib/output/markdown_ast.js'), - outputHtml = require('../lib/output/html.js'), - normalize = require('./normalize'), - glob = require('glob'), - path = require('path'), - fs = require('fs'), - _ = require('lodash'), - chdir = require('chdir'); - -var UPDATE = !!process.env.UPDATE; - -function makePOJO(ast) { - return JSON.parse(JSON.stringify(ast)); -} - -function readOptionsFromFile(file) { - var s = fs.readFileSync(file, 'utf-8'); - var lines = s.split(/\n/, 20); - for (var i = 0; i < lines.length; i++) { - var m = lines[i].match(/^\/\/\s+Options:\s*(.+)$/); - if (m) { - return JSON.parse(m[1]); - } - } - return {}; -} - -if (fs.existsSync(path.join(__dirname, '../.git'))) { - test('git option', function(t) { - var file = path.join(__dirname, './fixture/simple.input.js'); - documentation.build([file], { github: true }).then(result => { - normalize(result); - var outputfile = file.replace('.input.js', '.output.github.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect, 'produces correct JSON'); - - outputMarkdown(result, {}).then(result => { - var outputfile = file.replace('.input.js', '.output.github.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }); - }); - }); -} - -test('document-exported error', function(t) { - var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); - documentation.build([file], { documentExported: true }).then( - result => {}, - err => { - t.match( - err.message, - /Unable to find the value x/g, - 'Produces a descriptive error' - ); - t.end(); - } - ); -}); - -test('external modules option', function(t) { - documentation - .build([path.join(__dirname, 'fixture', 'external.input.js')], { - external: '(external|external/node_modules/*)' - }) - .then(result => { - normalize(result); - var outputfile = path.join( - __dirname, - 'fixture', - '_external-deps-included.json' - ); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); -}); - -test('bad input', function(tt) { - glob - .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) - .forEach(function(file) { - tt.test(path.basename(file), function(t) { - documentation - .build([file], readOptionsFromFile(file)) - .then(res => { - t.equal(res, undefined); - }) - .catch(error => { - // make error a serializable object - error = JSON.parse(JSON.stringify(error)); - // remove system-specific path - delete error.filename; - delete error.codeFrame; - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(error, null, 2)); - } - var expect = JSON.parse(fs.readFileSync(outputfile)); - t.deepEqual(error, expect); - t.end(); - }); - }); - }); - tt.end(); -}); - -test('html', function(tt) { - glob - .sync(path.join(__dirname, 'fixture/html', '*.input.js')) - .forEach(function(file) { - tt.test(path.basename(file), function(t) { - documentation - .build([file], readOptionsFromFile(file)) - .then(result => outputHtml(result, {})) - .then(result => { - var clean = result - .sort((a, b) => a.path > b.path) - .filter(r => r.path.match(/(html)$/)) - .map(r => r.contents) - .join('\n'); - var outputfile = file.replace('.input.js', '.output.files'); - if (UPDATE) { - fs.writeFileSync(outputfile, clean, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.deepEqual(clean, expect); - t.end(); - }) - .catch(err => { - t.fail(err); - }); - }); - }); - tt.end(); -}); - -test('outputs', function(ttt) { - glob - .sync(path.join(__dirname, 'fixture', '*.input.js')) - .forEach(function(file) { - ttt.test(path.basename(file), function(tt) { - documentation.build([file], readOptionsFromFile(file)).then(result => { - tt.test('markdown', function(t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: true }) - .then(result => { - var outputfile = file.replace('.input.js', '.output.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - - if (file.match(/es6.input.js/)) { - tt.test('no markdown TOC', function(t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: false }) - .then(result => { - var outputfile = file.replace('.input.js', '.output-toc.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - } - - tt.test('markdown AST', function(t) { - outputMarkdownAST(_.cloneDeep(result), {}) - .then(result => { - var outputfile = file.replace('.input.js', '.output.md.json'); - if (UPDATE) { - fs.writeFileSync( - outputfile, - JSON.stringify(result, null, 2), - 'utf8' - ); - } - var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); - t.deepEqual(result, expect, 'markdown AST output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - - tt.test('JSON', function(t) { - normalize(result); - result.forEach(function(comment) { - validate( - comment, - documentationSchema.jsonSchema - ).errors.forEach(function(error) { - t.ifError(error); - }); - }); - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(makePOJO(result), expect); - t.end(); - }); - - tt.end(); - }); - }); - }); - ttt.end(); -}); - -test('highlightAuto md output', function(t) { - var file = path.join( - __dirname, - 'fixture/auto_lang_hljs/multilanguage.input.js' - ), - hljsConfig = { - hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } - }; - - documentation.build(file, {}).then(result => { - outputMarkdown(result, hljsConfig).then(result => { - var outputfile = file.replace('.input.js', '.output.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal( - result.toString(), - expect, - 'recognizes examples in html, css and js' - ); - t.end(); - }); - }); -}); - -test('config', function(t) { - var file = path.join(__dirname, 'fixture', 'class.input.js'); - var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); - documentation - .build([file], { - config: path.join(__dirname, 'fixture', 'simple.config.yml') - }) - .then(out => outputMarkdown(out, {})) - .then(md => { - if (UPDATE) { - fs.writeFileSync(outputfile, md); - } - var result = fs.readFileSync(outputfile, 'utf8'); - - t.equal(md, result, 'rendered markdown is equal'); - t.end(); - }) - .catch(err => { - t.fail(err); - }); -}); - -test('multi-file input', function(t) { - documentation - .build( - [ - path.join(__dirname, 'fixture', 'simple.input.js'), - path.join(__dirname, 'fixture', 'simple-two.input.js') - ], - {} - ) - .then(result => { - normalize(result); - var outputfile = path.join( - __dirname, - 'fixture', - '_multi-file-input.json' - ); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); -}); - -test('accepts simple relative paths', function(t) { - chdir(__dirname, function() { - documentation.build('test/fixture/simple.input.js', {}).then(data => { - t.equal(data.length, 1, 'simple has no dependencies'); - t.end(); - }); - }); -}); - -test('.lint', function(t) { - chdir(__dirname, function() { - documentation.lint('test/fixture/simple.input.js', {}).then(data => { - t.equal(data, '', 'outputs lint information'); - t.end(); - }); - }); -}); - -test('.lint with bad input', function(t) { - chdir(__dirname, function() { - documentation - .lint('test/fixture/bad/syntax.input', { - parseExtension: ['input'] - }) - .catch(err => { - t.ok(err, 'returns an error when syntax is incorrect'); - t.end(); - }); - }); -}); diff --git a/test/utils.js b/test/utils.js deleted file mode 100644 index ad1614cd0..000000000 --- a/test/utils.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -var http = require('http'), concat = require('concat-stream'); - -function get(url, callback) { - http.get(url, function(res) { - res.pipe( - concat(function(text) { - if (res.statusCode >= 400) { - return callback(res.statusCode); - } - callback(text.toString()); - }) - ); - }); -} - -module.exports.get = get; diff --git a/yarn.lock b/yarn.lock index b70657610..4bf77782a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,10 +9,20 @@ JSONStream@^1.0.3, JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +abab@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" + abbrev@1: version "1.1.0" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -23,7 +33,7 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.3: +acorn@^4.0.3, acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" @@ -54,7 +64,7 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: +ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -97,10 +107,6 @@ aproba@^1.0.3: version "1.1.1" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - are-we-flow-yet@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/are-we-flow-yet/-/are-we-flow-yet-1.0.0.tgz#951dd9ea78cc9e4f00b47b4cd1d53d7ddf220908" @@ -130,6 +136,10 @@ arr-flatten@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -174,13 +184,9 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -ast-types@0.8.18: - version "0.8.18" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af" - -ast-types@0.9.4: - version "0.9.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.4.tgz#410d1f81890aeb8e0a38621558ba5869ae53c91b" +ast-types@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078" async-each@^1.0.0: version "1.0.1" @@ -190,6 +196,12 @@ async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.1.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + dependencies: + lodash "^4.14.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -202,6 +214,27 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" +babel-cli@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.1.tgz#207cd705bba61489b2ea41b5312341cf6aca2283" + dependencies: + babel-core "^6.24.1" + babel-polyfill "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + commander "^2.8.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.0.0" + glob "^7.0.0" + lodash "^4.2.0" + output-file-sync "^1.1.0" + path-is-absolute "^1.0.0" + slash "^1.0.0" + source-map "^0.5.0" + v8flags "^2.0.10" + optionalDependencies: + chokidar "^1.6.1" + babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -210,7 +243,7 @@ babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: +babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" dependencies: @@ -382,6 +415,14 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" +babel-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^19.0.0" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -394,6 +435,18 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-istanbul@^4.0.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.1" + test-exclude "^4.1.0" + +babel-plugin-jest-hoist@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" + babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -759,6 +812,14 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" +babel-polyfill@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" + dependencies: + babel-runtime "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + babel-preset-es2015@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" @@ -794,6 +855,12 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" +babel-preset-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" + dependencies: + babel-plugin-jest-hoist "^19.0.0" + babel-preset-react@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" @@ -899,9 +966,9 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" +babylon@7.0.0-beta.8: + version "7.0.0-beta.8" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" babylon@^6.11.0, babylon@^6.11.4, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: version "6.17.0" @@ -925,20 +992,12 @@ binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" -bind-obj-methods@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-1.0.0.tgz#4f5979cac15793adf70e488161e463e209ca509c" - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" dependencies: inherits "~2.0.0" -bluebird@^3.3.1: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" - body@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" @@ -969,12 +1028,24 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -browser-resolve@^1.7.0: +browser-resolve@^1.11.2, browser-resolve@^1.7.0: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" dependencies: resolve "1.1.7" +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + buffer-shims@^1.0.0, buffer-shims@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" @@ -987,14 +1058,6 @@ bytes@1: version "1.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" -caching-transform@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" - dependencies: - md5-hex "^1.2.0" - mkdirp "^0.5.1" - write-file-atomic "^1.1.4" - caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1005,6 +1068,10 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1073,7 +1140,7 @@ chdir@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/chdir/-/chdir-0.0.0.tgz#c29bdb85f391834c83ddbf090f18a11b0ed96bee" -chokidar@^1.2.0: +chokidar@^1.2.0, chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -1096,10 +1163,6 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -clean-yaml-object@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz#63fb110dc2ce1a84dc21f6d9334876d010ae8b68" - cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1183,14 +1246,6 @@ color-name@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" -color-support@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.2.tgz#49cc99b89d1bdef1292e9d9323c66971a33eb89d" - -colors@>=0.6.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1203,16 +1258,12 @@ comma-separated-tokens@^1.0.1: dependencies: trim "0.0.1" -commander@^2.9.0: +commander@^2.8.1, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: graceful-readlink ">= 1.0.0" -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -1244,6 +1295,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +content-type-parser@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" + continuable-cache@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" @@ -1388,7 +1443,7 @@ conventional-recommended-bump@^0.3.0: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.3.0: +convert-source-map@^1.1.0, convert-source-map@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -1413,9 +1468,9 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" -coveralls@^2.11.2: - version "2.13.0" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.0.tgz#df933876e8c6f478efb04f4d3ab70dc96b7e5a8e" +coveralls@^2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.1.tgz#d70bb9acc1835ec4f063ff9dac5423c17b11f178" dependencies: js-yaml "3.6.1" lcov-parse "0.0.10" @@ -1423,13 +1478,6 @@ coveralls@^2.11.2: minimist "1.2.0" request "2.79.0" -cross-spawn@^4: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1444,6 +1492,16 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1490,11 +1548,7 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug-log@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -debug@^2.1.1, debug@^2.1.3, debug@^2.2.0: +debug@^2.1.1, debug@^2.2.0, debug@^2.6.3: version "2.6.4" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" dependencies: @@ -1518,10 +1572,6 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" -deeper@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deeper/-/deeper-2.1.0.tgz#bc564e5f73174fdf201e08b00030e8a14da74368" - default-require-extensions@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" @@ -1575,6 +1625,10 @@ diff@^1.3.2: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" +diff@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + disparity@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/disparity/-/disparity-2.0.0.tgz#57ddacb47324ae5f58d2cc0da886db4ce9eeb718" @@ -1641,6 +1695,12 @@ end-of-stream@1.0.0: dependencies: once "~1.3.0" +"errno@>=0.1.1 <0.2.0-0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -1706,10 +1766,21 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@^1.6.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -1719,6 +1790,12 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-config-prettier@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" + dependencies: + get-stdin "^5.0.1" + eslint-plugin-flowtype@^2.32.1: version "2.32.1" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.32.1.tgz#bbee185dedf97e5f63ec975cdcddd199bd2a2501" @@ -1772,7 +1849,7 @@ espree@^3.4.0: acorn "^5.0.1" acorn-jsx "^3.0.0" -esprima@^2.6.0: +esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1793,6 +1870,10 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1812,9 +1893,11 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -events-to-array@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.1.2.tgz#2d41f563e1fe400ed4962fe1a4d5c6a7539df7f6" +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" + dependencies: + merge "^1.1.3" execa@^0.6.0: version "0.6.3" @@ -1874,6 +1957,18 @@ faye-websocket@~0.10.0: dependencies: websocket-driver ">=0.5.1" +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + figures@^1.3.5, figures@^1.5.0, figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -1892,6 +1987,13 @@ filename-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -1902,26 +2004,18 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" -find-up@^1.0.0, find-up@^1.1.2: +find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: @@ -1940,17 +2034,13 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.44.0: - version "0.44.2" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.44.2.tgz#3893c7db5de043ed82674f327a04b1309db208b5" +flow-bin@^0.45.0: + version "0.45.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.45.0.tgz#009dd0f577a3f665c74ca8be827ae8c2dd8fd6b5" -flow-parser@0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc" - dependencies: - ast-types "0.8.18" - colors ">=0.6.2" - minimist ">=0.2.0" +flow-parser@0.43.0: + version "0.43.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7" for-in@^1.0.1: version "1.0.2" @@ -1962,13 +2052,6 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" -foreground-child@^1.3.3, foreground-child@^1.5.3: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -1987,10 +2070,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-exists-cached@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz#cf25554ca050dc49ae6656b41de42258989dcbce" - fs-extra@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.0.tgz#244e0c4b0b8818f54040ec049d8a2bddc1202861" @@ -1999,6 +2078,10 @@ fs-extra@^3.0.0: jsonfile "^3.0.0" universalify "^0.1.0" +fs-readdir-recursive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2031,10 +2114,6 @@ function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" -function-loop@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/function-loop/-/function-loop-1.0.1.tgz#8076bb305e8e6a3cceee2920765f330d190f340c" - gauge@~2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" @@ -2076,7 +2155,11 @@ get-pkg-repo@^1.0.0: parse-github-repo-url "^1.3.0" through2 "^2.0.0" -get-stdin@5.0.1: +get-port@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e" + +get-stdin@5.0.1, get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" @@ -2187,7 +2270,7 @@ glob-stream@^5.3.2: to-absolute-glob "^0.1.1" unique-stream "^2.0.2" -glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -2237,7 +2320,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.0.0, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2245,6 +2328,10 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + gulp-sourcemaps@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" @@ -2365,6 +2452,12 @@ hosted-git-info@^2.1.4: version "2.4.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" +html-encoding-sniffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz#79bf7a785ea495fe66165e734153f363ff5437da" + dependencies: + whatwg-encoding "^1.0.1" + html-void-elements@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.1.tgz#f929bea267a19e3535950502ca12c159f1b559af" @@ -2386,6 +2479,10 @@ husky@^0.13.3: is-ci "^1.0.9" normalize-path "^1.0.0" +iconv-lite@0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + ignore@^3.2.0: version "3.2.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" @@ -2690,10 +2787,6 @@ isarray@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" -isexe@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2708,52 +2801,166 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" +istanbul-api@^1.1.0-alpha.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" -istanbul-lib-hook@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" +istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" + +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz#b8e0dc25709bb44e17336ab47b7bb5c97c23f659" +istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" semver "^5.3.0" -istanbul-lib-report@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0.tgz#d83dac7f26566b521585569367fe84ccfc7aaecb" +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" dependencies: - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.1.tgz#f8c8c2e8f2160d1d91526d97e5bd63b2079af71c" +istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" dependencies: - istanbul-lib-coverage "^1.0.2" + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" - rimraf "^2.4.4" + rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" dependencies: handlebars "^4.0.3" +jest-changed-files@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-19.0.2.tgz#16c54c84c3270be408e06d2e8af3f3e37a885824" + +jest-cli@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-19.0.2.tgz#cc3620b62acac5f2d93a548cb6ef697d4ec85443" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.1" + graceful-fs "^4.1.6" + is-ci "^1.0.9" + istanbul-api "^1.1.0-alpha.1" + istanbul-lib-coverage "^1.0.0" + istanbul-lib-instrument "^1.1.1" + jest-changed-files "^19.0.2" + jest-config "^19.0.2" + jest-environment-jsdom "^19.0.2" + jest-haste-map "^19.0.0" + jest-jasmine2 "^19.0.2" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve-dependencies "^19.0.0" + jest-runtime "^19.0.2" + jest-snapshot "^19.0.2" + jest-util "^19.0.2" + micromatch "^2.3.11" + node-notifier "^5.0.1" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.1.1" + worker-farm "^1.3.1" + yargs "^6.3.0" + +jest-config@^19.0.2: + version "19.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" + dependencies: + chalk "^1.1.1" + jest-environment-jsdom "^19.0.2" + jest-environment-node "^19.0.2" + jest-jasmine2 "^19.0.2" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.2" + jest-validate "^19.0.2" + pretty-format "^19.0.0" + +jest-diff@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" + dependencies: + chalk "^1.1.3" + diff "^3.0.0" + jest-matcher-utils "^19.0.0" + pretty-format "^19.0.0" + +jest-environment-jsdom@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + jsdom "^9.11.0" + +jest-environment-node@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + +jest-file-exists@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" + +jest-haste-map@^19.0.0: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.6" + micromatch "^2.3.11" + sane "~1.5.0" + worker-farm "^1.3.1" + +jest-jasmine2@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" + dependencies: + graceful-fs "^4.1.6" + jest-matcher-utils "^19.0.0" + jest-matchers "^19.0.0" + jest-message-util "^19.0.0" + jest-snapshot "^19.0.2" + jest-matcher-utils@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" @@ -2761,6 +2968,89 @@ jest-matcher-utils@^19.0.0: chalk "^1.1.3" pretty-format "^19.0.0" +jest-matchers@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" + dependencies: + jest-diff "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + +jest-message-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" + dependencies: + chalk "^1.1.1" + micromatch "^2.3.11" + +jest-mock@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" + +jest-regex-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" + +jest-resolve-dependencies@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-19.0.0.tgz#a741ad1fa094140e64ecf2642a504f834ece22ee" + dependencies: + jest-file-exists "^19.0.0" + +jest-resolve@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" + dependencies: + browser-resolve "^1.11.2" + jest-haste-map "^19.0.0" + resolve "^1.2.0" + +jest-runtime@^19.0.2: + version "19.0.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.3.tgz#a163354ace46910ee33f0282b6bff6b0b87d4330" + dependencies: + babel-core "^6.0.0" + babel-jest "^19.0.0" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.6" + jest-config "^19.0.2" + jest-file-exists "^19.0.0" + jest-haste-map "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.2" + jest-util "^19.0.2" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^6.3.0" + +jest-snapshot@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" + dependencies: + chalk "^1.1.3" + jest-diff "^19.0.0" + jest-file-exists "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-util "^19.0.2" + natural-compare "^1.4.0" + pretty-format "^19.0.0" + +jest-util@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" + dependencies: + chalk "^1.1.1" + graceful-fs "^4.1.6" + jest-file-exists "^19.0.0" + jest-message-util "^19.0.0" + jest-mock "^19.0.0" + jest-validate "^19.0.2" + leven "^2.0.0" + mkdirp "^0.5.1" + jest-validate@19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" @@ -2770,6 +3060,21 @@ jest-validate@19.0.0: leven "^2.0.0" pretty-format "^19.0.0" +jest-validate@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + +jest@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-19.0.2.tgz#b794faaf8ff461e7388f28beef559a54f20b2c10" + dependencies: + jest-cli "^19.0.2" + jodid25519@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" @@ -2787,7 +3092,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.2.7, js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1: +js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0: version "3.8.3" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" dependencies: @@ -2798,6 +3103,30 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^9.11.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -3005,7 +3334,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3054,6 +3383,12 @@ lru-cache@^4.0.1: pseudomap "^1.0.1" yallist "^2.0.0" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + map-cache@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -3070,16 +3405,6 @@ markdown-table@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.0.tgz#1f5ae61659ced8808d882554c32e8b3f38dd1143" -md5-hex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" - dependencies: - md5-o-matic "^0.1.1" - -md5-o-matic@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" - mdast-util-compact@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.0.tgz#4c94dedfe35932d5457f29b650b330fdc73e994a" @@ -3144,18 +3469,16 @@ meow@^3.3.0: redent "^1.0.0" trim-newlines "^1.0.0" -merge-source-map@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.3.tgz#da1415f2722a5119db07b14c4f973410863a2abf" - dependencies: - source-map "^0.5.3" - merge-stream@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" dependencies: readable-stream "^2.0.1" +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + micromatch@^2.1.5, micromatch@^2.1.6, micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" @@ -3188,7 +3511,7 @@ mime@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -3198,7 +3521,7 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@>=0.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3255,6 +3578,19 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.0.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" + dependencies: + growly "^1.3.0" + semver "^5.3.0" + shellwords "^0.1.0" + which "^1.2.12" + node-pre-gyp@^0.6.29: version "0.6.34" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" @@ -3336,37 +3672,9 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -nyc@^10.0.0: - version "10.2.2" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.2.tgz#1b1c8ca4636d810cb3e281558dc9fcb08389f204" - dependencies: - archy "^1.0.0" - arrify "^1.0.1" - caching-transform "^1.0.0" - convert-source-map "^1.3.0" - debug-log "^1.0.1" - default-require-extensions "^1.0.0" - find-cache-dir "^0.1.1" - find-up "^1.1.2" - foreground-child "^1.5.3" - glob "^7.0.6" - istanbul-lib-coverage "^1.0.2" - istanbul-lib-hook "^1.0.5" - istanbul-lib-instrument "^1.7.0" - istanbul-lib-report "^1.0.0" - istanbul-lib-source-maps "^1.1.1" - istanbul-reports "^1.0.2" - md5-hex "^1.2.0" - merge-source-map "^1.0.2" - micromatch "^2.3.11" - mkdirp "^0.5.0" - resolve-from "^2.0.0" - rimraf "^2.5.4" - signal-exit "^3.0.1" - spawn-wrap "1.2.4" - test-exclude "^4.0.0" - yargs "^7.0.2" - yargs-parser "^4.0.2" +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.3.9" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" oauth-sign@~0.8.1: version "0.8.2" @@ -3383,7 +3691,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@^1.3.0, once@^1.3.3: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -3399,14 +3707,6 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" -only-shallow@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/only-shallow/-/only-shallow-1.2.0.tgz#71cecedba9324bc0518aef10ec080d3249dc2465" - -opener@^1.4.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" - optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -3414,7 +3714,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.2: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -3441,7 +3741,7 @@ ordered-read-streams@^0.3.0: is-stream "^1.0.1" readable-stream "^2.0.1" -os-homedir@1.0.1, os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.1.tgz#0d62bdf44b916fd3bbdcf2cab191948fb094f007" @@ -3462,13 +3762,17 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -own-or-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/own-or-env/-/own-or-env-1.0.0.tgz#9ef920fc81e2e63cf59d41101258368cf4fca4fb" +output-file-sync@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" -own-or@^1.0.0: +p-event@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/own-or/-/own-or-1.0.0.tgz#4e877fbeda9a2ec8000fbc0bcae39645ee8bf8dc" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.0.0.tgz#f3e5ea67c501cc34c12cc68715c214948142c46f" p-finally@^1.0.0: version "1.0.0" @@ -3548,6 +3852,10 @@ parse-url@^1.3.0: is-ssh "^1.3.0" protocols "^1.4.0" +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -3624,12 +3932,6 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - plur@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" @@ -3648,16 +3950,16 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-0.22.0.tgz#7b37c4480d0858180407e5a8e13f0f47da7385d2" +prettier@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e" dependencies: - ast-types "0.9.4" + ast-types "0.9.8" babel-code-frame "6.22.0" - babylon "6.15.0" + babylon "7.0.0-beta.8" chalk "1.1.3" esutils "2.0.2" - flow-parser "0.40.0" + flow-parser "0.43.0" get-stdin "5.0.1" glob "7.1.1" jest-validate "19.0.0" @@ -3689,11 +3991,15 @@ protocols@^1.1.0, protocols@^1.4.0: version "1.4.5" resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.5.tgz#21de1f441c4ef7094408ed9f1c94f7a114b87557" +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -punycode@^1.3.2, punycode@^1.4.1: +punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -3771,7 +4077,7 @@ read-pkg@^2.0.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" dependencies: @@ -4006,7 +4312,7 @@ request@2.79.0: tunnel-agent "~0.4.1" uuid "^3.0.0" -request@^2.81.0: +request@^2.79.0, request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -4056,15 +4362,11 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.3, resolve@^1.1.6: +resolve@^1.1.3, resolve@^1.1.6, resolve@^1.2.0: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -4087,7 +4389,7 @@ right-pad@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -4117,6 +4419,22 @@ safe-json-parse@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" +sane@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sax@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" + "semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -4147,11 +4465,11 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-2.1.2.tgz#375879b1f92ebc3b334480d038dc546a6d558564" +shellwords@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" -signal-exit@^3.0.0, signal-exit@^3.0.1: +signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4163,17 +4481,13 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" -slide@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: hoek "2.x.x" -source-map-support@^0.4.2, source-map-support@^0.4.3: +source-map-support@^0.4.2: version "0.4.14" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" dependencies: @@ -4189,23 +4503,18 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + space-separated-tokens@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.0.tgz#9e8c60407aa527742cd9eaee2541dec639f1269b" dependencies: trim "0.0.1" -spawn-wrap@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40" - dependencies: - foreground-child "^1.3.3" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.3.3" - signal-exit "^2.0.0" - which "^1.2.4" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -4251,10 +4560,6 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -stack-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" - staged-git-files@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" @@ -4297,6 +4602,12 @@ stream-to-observable@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" @@ -4353,16 +4664,16 @@ strip-bom-stream@^1.0.0: first-chunk-stream "^1.0.0" strip-bom "^2.0.0" +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: is-utf8 "^0.2.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -4397,6 +4708,10 @@ symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -4408,62 +4723,6 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -tap-mocha-reporter@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/tap-mocha-reporter/-/tap-mocha-reporter-3.0.3.tgz#e5917fad3d9a70957f9b7c736e793beb87d7daf1" - dependencies: - color-support "^1.1.0" - debug "^2.1.3" - diff "^1.3.2" - escape-string-regexp "^1.0.3" - glob "^7.0.5" - js-yaml "^3.3.1" - tap-parser "^5.1.0" - unicode-length "^1.0.0" - optionalDependencies: - readable-stream "^2.1.5" - -tap-parser@^5.1.0, tap-parser@^5.3.1: - version "5.3.3" - resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-5.3.3.tgz#53ec8a90f275d6fff43f169e56a679502a741185" - dependencies: - events-to-array "^1.0.1" - js-yaml "^3.2.7" - optionalDependencies: - readable-stream "^2" - -tap@^10.3.2: - version "10.3.2" - resolved "https://registry.yarnpkg.com/tap/-/tap-10.3.2.tgz#77982f08368d8b1803a3b0ab5fc300e1817f31e7" - dependencies: - bind-obj-methods "^1.0.0" - bluebird "^3.3.1" - clean-yaml-object "^0.1.0" - color-support "^1.1.0" - coveralls "^2.11.2" - deeper "^2.1.0" - foreground-child "^1.3.3" - fs-exists-cached "^1.0.0" - function-loop "^1.0.1" - glob "^7.0.0" - isexe "^1.0.0" - js-yaml "^3.3.1" - nyc "^10.0.0" - only-shallow "^1.0.2" - opener "^1.4.1" - os-homedir "1.0.1" - own-or "^1.0.0" - own-or-env "^1.0.0" - readable-stream "^2.0.2" - signal-exit "^3.0.0" - source-map-support "^0.4.3" - stack-utils "^1.0.0" - tap-mocha-reporter "^3.0.1" - tap-parser "^5.3.1" - tmatch "^3.0.0" - trivial-deferred "^1.0.1" - yapool "^1.0.0" - tar-pack@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" @@ -4485,9 +4744,9 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -test-exclude@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -4503,6 +4762,10 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +throat@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" + through2-filter@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" @@ -4539,16 +4802,16 @@ tiny-lr@^1.0.3: object-assign "^4.1.0" qs "^6.2.0" -tmatch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tmatch/-/tmatch-3.0.0.tgz#7d2071dedbbc587f194acda3067bd0747b670991" - tmp@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" dependencies: os-tmpdir "~1.0.1" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-absolute-glob@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" @@ -4559,12 +4822,16 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" -tough-cookie@~2.3.0: +tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: punycode "^1.4.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + trim-lines@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.0.tgz#9926d03ede13ba18f7d42222631fb04c79ff26fe" @@ -4589,10 +4856,6 @@ trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" -trivial-deferred@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" - trough@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" @@ -4653,13 +4916,6 @@ unherit@^1.0.4: inherits "^2.0.1" xtend "^4.0.1" -unicode-length@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/unicode-length/-/unicode-length-1.0.3.tgz#5ada7a7fed51841a418a328cf149478ac8358abb" - dependencies: - punycode "^1.3.2" - strip-ansi "^3.0.1" - unified@^6.0.0: version "6.1.2" resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.2.tgz#b3904c3254ffbea7ff6d806c5d5b6248838cecb6" @@ -4725,6 +4981,10 @@ universalify@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -4739,6 +4999,12 @@ uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" +v8flags@^2.0.10: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + vali-date@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" @@ -4829,6 +5095,24 @@ vinyl@^2.0.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + websocket-driver@>=0.5.1: version "0.6.5" resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36" @@ -4839,11 +5123,24 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +whatwg-encoding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" + dependencies: + iconv-lite "0.4.13" + +whatwg-url@^4.3.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.2.10, which@^1.2.4, which@^1.2.9: +which@^1.1.1, which@^1.2.10, which@^1.2.12, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -4875,6 +5172,13 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +worker-farm@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" + dependencies: + errno ">=0.1.1 <0.2.0-0" + xtend ">=4.0.0 <4.1.0-0" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4886,14 +5190,6 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^1.1.4: - version "1.3.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.2.tgz#f80ac5e06d3a38996ab51b5d310db57102deb902" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -4908,6 +5204,10 @@ x-is-string@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -4920,23 +5220,13 @@ yallist@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yapool@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yapool/-/yapool-1.0.0.tgz#f693f29a315b50d9a9da2646a7a6645c96985b6a" - -yargs-parser@^4.0.2, yargs-parser@^4.2.0: +yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" dependencies: camelcase "^3.0.0" -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - dependencies: - camelcase "^3.0.0" - -yargs@^6.0.0: +yargs@^6.0.0, yargs@^6.3.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" dependencies: @@ -4954,24 +5244,6 @@ yargs@^6.0.0: y18n "^3.2.1" yargs-parser "^4.2.0" -yargs@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^5.0.0" - yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From e7cba18a652fe737e299b20cbe98087d22595237 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 11 May 2017 10:32:45 -0400 Subject: [PATCH 052/555] chore(package): update jest to version 20.0.1 (#780) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1282ab71c..afee60cc2 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "flow-bin": "^0.45.0", "fs-extra": "^3.0.0", "husky": "^0.13.3", - "jest": "^19.0.2", + "jest": "^20.0.1", "json-schema": "0.2.3", "lint-staged": "^3.4.0", "mock-fs": "^4.2.0", From c055aecee8d568b426341cb9ed4a4022624dd679 Mon Sep 17 00:00:00 2001 From: Julien Vanier Date: Thu, 11 May 2017 10:33:29 -0400 Subject: [PATCH 053/555] docs: Provide syntax for specifying configuration (#778) --- docs/CONFIG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/CONFIG.md b/docs/CONFIG.md index b5976dbbb..7abdfc5ff 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -9,6 +9,11 @@ Configuration - a `documentation.yml` file - will accomplish two goals: * Organization: you can put top level documentation in order of importance * Narration: you can add narrative sections - plain English writing - in between autogenerated API documentation. + +Specify the configuration file with the `--config` command-line option. +```sh +$ documentation build --config documentation.yml ... +``` Here's how `documentation.yml` works: From 290fc09b91133838cb1486565477723467151984 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 11 May 2017 10:33:45 -0400 Subject: [PATCH 054/555] test: Improve coverage of infer/kind, remove unused filterAccess line (#776) --- __tests__/lib/infer/kind.js | 18 ++++++++++++++++++ src/filter_access.js | 2 -- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/__tests__/lib/infer/kind.js b/__tests__/lib/infer/kind.js index fa9c8d3d7..3c015b94c 100644 --- a/__tests__/lib/infer/kind.js +++ b/__tests__/lib/infer/kind.js @@ -58,6 +58,24 @@ test('inferKind', function() { ).kind ).toBe('function'); + expect( + inferKind(toComment('/** Exported interface */' + 'interface myinter {}')) + .kind + ).toBe('interface'); + + expect( + inferKind( + toComment( + '/** Exported interface */' + 'module.exports.foo = function() {}' + ) + ).kind + ).toBe('function'); + + expect( + inferKind(toComment('class A { /** Exported interface */' + 'foo: 1 }')) + .kind + ).toBe('member'); + expect( inferKind( toComment('/** Exported function */' + 'export function foo() {}') diff --git a/src/filter_access.js b/src/filter_access.js index 94fb89495..ca05409a5 100644 --- a/src/filter_access.js +++ b/src/filter_access.js @@ -12,8 +12,6 @@ import { walk } from './walk'; * @return {Array} filtered comments */ function filterAccess(levels: Array, comments: Array) { - levels = levels || ['public', 'undefined', 'protected']; - function filter(comment) { return ( comment.kind === 'note' || From 961d4a7ec59a81bbed6160055e90ed58b3bec0f8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 11 May 2017 11:52:38 -0400 Subject: [PATCH 055/555] chore(package): update flow-bin to version 0.46.0 (#777) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index afee60cc2..3659d589e 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^3.19.0", "eslint-config-prettier": "^1.7.0", "eslint-plugin-flowtype": "^2.32.1", - "flow-bin": "^0.45.0", + "flow-bin": "^0.46.0", "fs-extra": "^3.0.0", "husky": "^0.13.3", "jest": "^20.0.1", From 8131cf78ef94bd63ecf4afe3e8bc6597b06f7308 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 11 May 2017 11:58:03 -0400 Subject: [PATCH 056/555] chore(package): update babel-jest to version 20.0.1 (#779) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3659d589e..d2ba6a453 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "are-we-flow-yet": "^1.0.0", "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", - "babel-jest": "^19.0.0", + "babel-jest": "^20.0.1", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", From 4ba0a822a2475b36e7a68405391d9841c33c08a0 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 12 May 2017 09:57:34 -0400 Subject: [PATCH 057/555] docs(api): Update API docs (#784) --- docs/NODE_API.md | 184 ++++++++++++++++------------------------------- package.json | 2 +- 2 files changed, 62 insertions(+), 124 deletions(-) diff --git a/docs/NODE_API.md b/docs/NODE_API.md index e509a838c..8be51f979 100644 --- a/docs/NODE_API.md +++ b/docs/NODE_API.md @@ -2,163 +2,105 @@ ### Table of Contents -- [build](#build) -- [buildSync](#buildsync) - [lint](#lint) +- [build](#build) - [formats](#formats) - [formats.html](#formatshtml) - [formats.markdown](#formatsmarkdown) - [formats.json](#formatsjson) -## build +## lint -Generate JavaScript documentation as a list of parsed JSDoc -comments, given a root file as a path. +Lint files for non-standard or incorrect documentation +information, returning a potentially-empty string +of lint information intended for human-readable output. **Parameters** - `indexes` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** files to process -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options - - `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** args + - `args.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern that defines what external modules will be whitelisted and included in the generated documentation. - - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than + - `args.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse comments with a regex rather than a proper parser. This enables support of non-JavaScript languages but reduces documentation's ability to infer structure of code. (optional, default `false`) - - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing + - `args.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to avoid dependency parsing even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`) - - `options.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>?** optional array that - defines sorting order of documentation (optional, default `[]`) - - `options.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** an array of access levels - to output in documentation (optional, default `[]`) - - `options.hljs` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** hljs optional options - - `options.hljs.highlightAuto` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** hljs automatically detect language (optional, default `false`) - - `options.hljs.languages` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** languages for hljs to choose from - - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string + - `args.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string to infer whether a code element should be private, given its naming structure. For instance, you can specify `inferPrivate: '^_'` to automatically treat methods named like `_myMethod` as private. - - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions + - `args.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions as JavaScript, extending the default set of `js`, `es6`, and `jsx`. -- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation - is complete, with (err, result) argumentsj **Examples** ```javascript -var documentation = require('documentation'); - -documentation.build(['index.js'], { - - // only output comments with an explicit @public tag - access: ['public'] - -}, function (err, res) { - - // res is an array of parsed comments with inferred properties - // and more: everything you need to build documentation or - // any other kind of code data. - +documentation.lint('file.js').then(lintOutput => { + if (lintOutput) { + console.log(lintOutput); + process.exit(1); + } else { + process.exit(0); + } }); ``` -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** promise with lint results -## buildSync +## build -Generate JavaScript documentation given a list of inputs. This internal -method does not support require-following and it returns its results -synchronously, rather than by calling a callback. +Generate JavaScript documentation as a list of parsed JSDoc +comments, given a root file as a path. **Parameters** -- `indexes` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** files to process -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options - - `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern +- `indexes` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** files to process +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** args + - `args.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern that defines what external modules will be whitelisted and included in the generated documentation. - - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than + - `args.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse comments with a regex rather than a proper parser. This enables support of non-JavaScript languages but reduces documentation's ability to infer structure of code. (optional, default `false`) - - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing + - `args.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to avoid dependency parsing even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`) - - `options.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>?** optional array that + - `args.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>** optional array that defines sorting order of documentation (optional, default `[]`) - - `options.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>?** an array of access levels + - `args.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** an array of access levels to output in documentation (optional, default `[]`) - - `options.hljs` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** hljs optional options - - `options.hljs.highlightAuto` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** hljs automatically detect language (optional, default `false`) - - `options.hljs.languages` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** languages for hljs to choose from - - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string + - `args.hljs` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** hljs optional args + - `args.hljs.highlightAuto` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** hljs automatically detect language (optional, default `false`) + - `args.hljs.languages` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)?** languages for hljs to choose from + - `args.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string to infer whether a code element should be private, given its naming structure. For instance, you can specify `inferPrivate: '^_'` to automatically treat methods named like `_myMethod` as private. - - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions + - `args.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions as JavaScript, extending the default set of `js`, `es6`, and `jsx`. -- `config` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** path to configuration file to load **Examples** ```javascript var documentation = require('documentation'); -var results = documentation.buildSync(['index.js']); -// results is an array of parsed comments with inferred properties -// and more: everything you need to build documentation or -// any other kind of code data. -``` - -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** list of results - -## lint - -Lint files for non-standard or incorrect documentation -information, returning a potentially-empty string -of lint information intended for human-readable output. - -**Parameters** - -- `indexes` **([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** files to process -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options - - `options.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern - that defines what external modules will be whitelisted and included in the - generated documentation. - - `options.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** parse comments with a regex rather than - a proper parser. This enables support of non-JavaScript languages but - reduces documentation's ability to infer structure of code. (optional, default `false`) - - `options.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** whether to avoid dependency parsing - even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`) - - `options.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string - to infer whether a code element should be private, given its naming structure. - For instance, you can specify `inferPrivate: '^_'` to automatically treat - methods named like `_myMethod` as private. - - `options.extension` **([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>)?** treat additional file extensions - as JavaScript, extending the default set of `js`, `es6`, and `jsx`. -- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** to be called when the documentation generation - is complete, with (err, result) arguments - -**Examples** - -```javascript -documentation.lint('file.js', {}, function (err, lintOutput) { - if (err) { - throw err; - } - if (lintOutput) { - console.log(lintOutput); - process.exit(1); - } else { - process.exit(0); - } +documentation.build(['index.js'], { + // only output comments with an explicit @public tag + access: ['public'] +}).then(res => { + // res is an array of parsed comments with inferred properties + // and more: everything you need to build documentation or + // any other kind of code data. }); ``` -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** results ## formats Documentation's formats are modular methods that take comments -and options as input and call a callback with writable objects, +and config as input and return Promises with results, like stringified JSON, markdown strings, or Vinyl objects for HTML output. @@ -168,10 +110,9 @@ Formats documentation as HTML. **Parameters** -- `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output - - `options.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** Name of a module used for an HTML theme. (optional, default `'default_theme'`) -- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** Called with array of results as vinyl-fs objects. +- `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment)>** parsed comments +- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output + - `config.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of a module used for an HTML theme. (optional, default `'default_theme'`) **Examples** @@ -180,14 +121,14 @@ var documentation = require('documentation'); var streamArray = require('stream-array'); var vfs = require('vinyl-fs'); -documentation.build(['index.js'], {}, function (err, res) { - documentation.formats.html(res, {}, function(err, output) { +documentation.build(['index.js']) + .then(documentation.formats.html) + .then(output => { streamArray(output).pipe(vfs.dest('./output-directory')); }); -}); ``` -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** Calls callback. +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>>** Promise with results ## formats.markdown @@ -197,8 +138,7 @@ Formats documentation as **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output -- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** called with null, string +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output **Examples** @@ -206,15 +146,15 @@ Formats documentation as var documentation = require('documentation'); var fs = require('fs'); -documentation.build(['index.js'], {}, function (err, res) { - documentation.formats.md(res, {}, function(err, output) { - // output is a string of JSON data +documentation.build(['index.js']) + .then(documentation.formats.md) + .then(output => { + // output is a string of Markdown data fs.writeFileSync('./output.md', output); }); -}); ``` -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a promise of the eventual value ## formats.json @@ -222,9 +162,7 @@ Formats documentation as a JSON string. **Parameters** -- `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `opts` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output -- `callback` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** called with null, string +- `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment)>** parsed comments **Examples** @@ -232,12 +170,12 @@ Formats documentation as a JSON string. var documentation = require('documentation'); var fs = require('fs'); -documentation.build(['index.js'], {}, function (err, res) { - documentation.formats.json(res, {}, function(err, output) { +documentation.build(['index.js']) + .then(documentation.formats.json) + .then(output => { // output is a string of JSON data fs.writeFileSync('./output.json', output); }); -}); ``` -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** calls callback +Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** diff --git a/package.json b/package.json index d2ba6a453..f1948b343 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "release": "standard-version", "precommit": "lint-staged --verbose", "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", - "doc": "./bin/documentation.js build lib/index.js -f md --access=public > docs/NODE_API.md", + "doc": "./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint src", "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", From 3f2bf90eb31627a45d1b99ac108fb52da2827170 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 31 May 2017 12:59:27 -0400 Subject: [PATCH 058/555] fix(package): update micromatch to version 3.0.0 (#792) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f1948b343..a8117019c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "js-yaml": "^3.3.1", "lodash": "^4.11.1", "mdast-util-inject": "^1.1.0", - "micromatch": "^2.1.6", + "micromatch": "^3.0.0", "mime": "^1.3.4", "module-deps-sortable": "4.0.6", "parse-filepath": "^1.0.1", From 74392cc83feacccd3881d52dedafefc731a5fcf8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 31 May 2017 12:59:38 -0400 Subject: [PATCH 059/555] fix(package): update github-slugger to version 1.1.3 (#793) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8117019c..49be7643c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "get-comments": "^1.0.1", "get-port": "^3.1.0", "git-url-parse": "^6.0.1", - "github-slugger": "1.1.1", + "github-slugger": "1.1.3", "glob": "^7.0.0", "globals-docs": "^2.3.0", "highlight.js": "^9.1.0", From 5fb77bcf480865fdc9eb4fc737d8d3efb90601ab Mon Sep 17 00:00:00 2001 From: David Halls Date: Tue, 6 Jun 2017 14:38:27 +0100 Subject: [PATCH 060/555] fix(html output): Fix links between navigation and items in HTML documentation --- __tests__/__snapshots__/bin.js.snap | 40 ++++++++++++++--------------- src/default_theme/index._ | 8 +++--- src/default_theme/section_list._ | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 878415f05..094c73747 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -50,31 +50,31 @@ exports[`--config 1`] = `
  • Static members
  • .isClass
  • .isWeird
  • .isBuffer
  • .isArrayOfBuffers
  • .MAGIC_NUMBER
  • @@ -86,13 +86,13 @@ exports[`--config 1`] = `
  • Instance members
  • #getFoo
  • #withOptions
  • @@ -105,7 +105,7 @@ exports[`--config 1`] = `
  • Events
  • ⓔ event
  • @@ -171,7 +171,7 @@ exports[`--config 1`] = `
  • Instance members
  • #bar
  • @@ -198,7 +198,7 @@ exports[`--config 1`] = `
  • Static members
  • .passthrough
  • @@ -311,7 +311,7 @@ PeerId.create({ bits: Static Members
    -
    +
    @@ -388,7 +388,7 @@ This is a [link to something that does not exist]DoesNot
    -
    +
    @@ -456,7 +456,7 @@ the referenced class type

    -
    +
    @@ -533,7 +533,7 @@ the referenced class type

    -
    +
    @@ -608,7 +608,7 @@ k.isArrayOfBuffers();
    -
    +
    @@ -662,7 +662,7 @@ k.isArrayOfBuffers();
    Instance Members
    -
    +
    @@ -723,7 +723,7 @@ k.isArrayOfBuffers();
    -
    +
    @@ -826,7 +826,7 @@ k.isArrayOfBuffers();
    Events
    -
    +
    @@ -1199,7 +1199,7 @@ like a klass. This needs a Instance Members
    -
    +
    @@ -1296,7 +1296,7 @@ like a klass. This needs a Static Members
    -
    +
    diff --git a/src/default_theme/index._ b/src/default_theme/index._ index 99392f6d8..69e28abb0 100644 --- a/src/default_theme/index._ +++ b/src/default_theme/index._ @@ -37,7 +37,7 @@
  • Static members
  • <% doc.members.static.forEach(function(member) { %>
  • .<%- member.name %>
  • @@ -49,7 +49,7 @@
  • Instance members
  • <% doc.members.instance.forEach(function(member) { %>
  • #<%- member.name %>
  • @@ -61,7 +61,7 @@
  • Inner members
  • <% doc.members.inner.forEach(function(member) { %>
  • #<%- member.name %>
  • @@ -73,7 +73,7 @@
  • Events
  • <% doc.members.events.forEach(function(member) { %>
  • ⓔ <%- member.name %>
  • diff --git a/src/default_theme/section_list._ b/src/default_theme/section_list._ index 904483ccc..7063465fe 100644 --- a/src/default_theme/section_list._ +++ b/src/default_theme/section_list._ @@ -1,6 +1,6 @@
    <% members.forEach(function(member) { %> -
    +
    From a0d0214dc076130f850d2b60e130a3fe723f1361 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 6 Jun 2017 14:22:54 -0400 Subject: [PATCH 061/555] chore: Upgrade dependencies that don't break everything (#798) --- package.json | 6 +- yarn.lock | 1405 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 967 insertions(+), 444 deletions(-) diff --git a/package.json b/package.json index 49be7643c..a412f95ba 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "mime": "^1.3.4", "module-deps-sortable": "4.0.6", "parse-filepath": "^1.0.1", - "pify": "^2.3.0", + "pify": "^3.0.0", "read-pkg-up": "^2.0.0", "remark": "^7.0.0", "remark-html": "6.0.0", @@ -55,7 +55,7 @@ "vfile-sort": "^2.0.0", "vinyl": "^2.0.0", "vinyl-fs": "^2.3.1", - "yargs": "^6.0.0" + "yargs": "^6.0.1" }, "devDependencies": { "are-we-flow-yet": "^1.0.0", @@ -69,7 +69,7 @@ "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", "eslint": "^3.19.0", - "eslint-config-prettier": "^1.7.0", + "eslint-config-prettier": "^2.1.1", "eslint-plugin-flowtype": "^2.32.1", "flow-bin": "^0.46.0", "fs-extra": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 4bf77782a..57d0dea69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -34,8 +34,8 @@ acorn@^3.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" acorn@^4.0.3, acorn@^4.0.4: - version "4.0.11" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" + version "4.0.13" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" acorn@^5.0.1: version "5.0.3" @@ -46,8 +46,8 @@ ajv-keywords@^1.0.0: resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0, ajv@^4.9.1: - version "4.11.7" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.7.tgz#8655a5d86d0824985cc471a1d913fb6729a0ec48" + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -72,7 +72,7 @@ ansi-html@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" -ansi-regex@^2.0.0: +ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -104,8 +104,8 @@ append-transform@^0.4.0: default-require-extensions "^1.0.0" aproba@^1.0.3: - version "1.1.1" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" + version "1.1.2" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" are-we-flow-yet@^1.0.0: version "1.0.0" @@ -132,10 +132,18 @@ arr-diff@^2.0.0: dependencies: arr-flatten "^1.0.1" -arr-flatten@^1.0.1: +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.0.1, arr-flatten@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" @@ -168,6 +176,10 @@ array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -184,10 +196,6 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -ast-types@0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078" - async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -197,8 +205,8 @@ async@^1.4.0: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.4.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + version "2.4.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" dependencies: lodash "^4.14.0" @@ -206,6 +214,10 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +atob@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -235,7 +247,7 @@ babel-cli@^6.24.1: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -415,13 +427,13 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" +babel-jest@^20.0.1, babel-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" dependencies: babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^19.0.0" + babel-preset-jest "^20.0.3" babel-messages@^6.23.0: version "6.23.0" @@ -436,16 +448,16 @@ babel-plugin-check-es2015-constants@^6.22.0: babel-runtime "^6.22.0" babel-plugin-istanbul@^4.0.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + version "4.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.4.tgz#18dde84bf3ce329fddf3f4103fae921456d8e587" dependencies: find-up "^2.1.0" - istanbul-lib-instrument "^1.7.1" - test-exclude "^4.1.0" + istanbul-lib-instrument "^1.7.2" + test-exclude "^4.1.1" -babel-plugin-jest-hoist@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" +babel-plugin-jest-hoist@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -855,11 +867,11 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" -babel-preset-jest@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" +babel-preset-jest@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" dependencies: - babel-plugin-jest-hoist "^19.0.0" + babel-plugin-jest-hoist "^20.0.3" babel-preset-react@^6.16.0: version "6.24.1" @@ -966,13 +978,9 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@7.0.0-beta.8: - version "7.0.0-beta.8" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" - babylon@^6.11.0, babylon@^6.11.4, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" + version "6.17.2" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.2.tgz#201d25ef5f892c41bae49488b08db0dd476e9f5c" bail@^1.0.0: version "1.0.1" @@ -982,6 +990,20 @@ balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +base@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.1.tgz#b36a7f11113853a342a15691d98e2dcc8a6cc270" + dependencies: + arr-union "^3.1.0" + cache-base "^0.8.4" + class-utils "^0.3.4" + component-emitter "^1.2.1" + define-property "^0.2.5" + isobject "^2.1.0" + lazy-cache "^2.0.1" + mixin-deep "^1.1.3" + pascalcase "^0.1.1" + bcrypt-pbkdf@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" @@ -1013,7 +1035,7 @@ boom@2.x.x: dependencies: hoek "2.x.x" -brace-expansion@^1.0.0: +brace-expansion@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" dependencies: @@ -1028,6 +1050,22 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +braces@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.2.2.tgz#241f868c2b2690d9febeee5a7c83fbbf25d00b1b" + dependencies: + arr-flatten "^1.0.3" + array-unique "^0.3.2" + define-property "^1.0.0" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.0" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^2.1.0" + to-regex "^3.0.1" + browser-resolve@^1.11.2, browser-resolve@^1.7.0: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" @@ -1046,7 +1084,7 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" -buffer-shims@^1.0.0, buffer-shims@~1.0.0: +buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" @@ -1058,6 +1096,21 @@ bytes@1: version "1.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" +cache-base@^0.8.4: + version "0.8.5" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-0.8.5.tgz#60ceb3504021eceec7011fd3384b7f4e95729bfa" + dependencies: + collection-visit "^0.2.1" + component-emitter "^1.2.1" + get-value "^2.0.5" + has-value "^0.3.1" + isobject "^3.0.0" + lazy-cache "^2.0.1" + set-value "^0.4.2" + to-object-path "^0.3.0" + union-value "^0.2.3" + unset-value "^0.1.1" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1091,6 +1144,10 @@ camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" +camelcase@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" @@ -1110,7 +1167,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@1.1.3, chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1141,8 +1198,8 @@ chdir@0.0.0: resolved "https://registry.yarnpkg.com/chdir/-/chdir-0.0.0.tgz#c29bdb85f391834c83ddbf090f18a11b0ed96bee" chokidar@^1.2.0, chokidar@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -1163,6 +1220,16 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" +class-utils@^0.3.4: + version "0.3.5" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.5.tgz#17e793103750f9627b2176ea34cfd1b565903c80" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + lazy-cache "^2.0.2" + static-extend "^0.1.1" + cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1236,6 +1303,14 @@ collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.2.tgz#9c463fb9c6d190d2dcae21a356a01bcae9eeef6d" +collection-visit@^0.2.1: + version "0.2.3" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-0.2.3.tgz#2f62483caecc95f083b9a454a3ee9e6139ad7957" + dependencies: + lazy-cache "^2.0.1" + map-visit "^0.1.5" + object-visit "^0.3.4" + color-convert@^1.0.0: version "1.9.0" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" @@ -1271,6 +1346,10 @@ compare-func@^1.3.1: array-ify "^1.0.0" dot-prop "^3.0.0" +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1431,22 +1510,26 @@ conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1: through2 "^2.0.0" trim-off-newlines "^1.0.0" -conventional-recommended-bump@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-0.3.0.tgz#e839de8f57cbb43445c8b4967401de0644c425d8" +conventional-recommended-bump@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.0.0.tgz#6d303a27837ae938b7c68c8ddeed34559b4b0789" dependencies: concat-stream "^1.4.10" conventional-commits-filter "^1.0.0" conventional-commits-parser "^1.0.1" - git-latest-semver-tag "^1.0.0" - git-raw-commits "^1.0.0" + git-raw-commits "^1.2.0" + git-semver-tags "^1.2.0" meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.1.1: +convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" @@ -1478,6 +1561,13 @@ coveralls@^2.13.1: minimist "1.2.0" request "2.79.0" +cross-spawn@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" + dependencies: + lru-cache "^4.0.1" + which "^1.2.9" + cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1538,8 +1628,8 @@ dashdash@^1.12.0: assert-plus "^1.0.0" date-fns@^1.27.2: - version "1.28.3" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.3.tgz#145d87adc3f5a82c6bda668de97eee1132c97ea1" + version "1.28.5" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" dateformat@^1.0.11, dateformat@^1.0.12: version "1.0.12" @@ -1548,11 +1638,11 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.1.1, debug@^2.2.0, debug@^2.6.3: - version "2.6.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" +debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: - ms "0.7.3" + ms "2.0.0" debug@~2.2.0: version "2.2.0" @@ -1565,8 +1655,8 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" deep-extend@~0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" deep-is@~0.1.3: version "0.1.3" @@ -1578,6 +1668,18 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" @@ -1625,7 +1727,7 @@ diff@^1.3.2: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" -diff@^3.0.0: +diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -1660,6 +1762,10 @@ dot-prop@^3.0.0: dependencies: is-obj "^1.0.0" +double-ended-queue@^2.1.0-0: + version "2.1.0-0" + resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" + duplexer2@^0.1.2, duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" @@ -1685,9 +1791,9 @@ elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" -emoji-regex@^6.0.0: - version "6.4.2" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.4.2.tgz#a30b6fee353d406d96cfb9fa765bdc82897eff6e" +"emoji-regex@>=6.0.0 <=6.1.1": + version "6.1.1" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" end-of-stream@1.0.0: version "1.0.0" @@ -1715,8 +1821,8 @@ error@^7.0.0: xtend "~4.0.0" es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.15" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" + version "0.10.23" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.23.tgz#7578b51be974207a5487821b56538c224e4e7b38" dependencies: es6-iterator "2" es6-symbol "~3.1" @@ -1790,15 +1896,15 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-prettier@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" +eslint-config-prettier@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.1.1.tgz#ab3923fb704eebecab6960906b7d0d6e801cde58" dependencies: get-stdin "^5.0.1" eslint-plugin-flowtype@^2.32.1: - version "2.32.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.32.1.tgz#bbee185dedf97e5f63ec975cdcddd199bd2a2501" + version "2.34.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" dependencies: lodash "^4.15.0" @@ -1843,8 +1949,8 @@ eslint@^3.19.0: user-home "^2.0.0" espree@^3.4.0: - version "3.4.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.2.tgz#38dbdedbedc95b8961a1fbf04734a8f6a9c8c592" + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: acorn "^5.0.1" acorn-jsx "^3.0.0" @@ -1882,7 +1988,7 @@ estraverse@~4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" -esutils@2.0.2, esutils@^2.0.0, esutils@^2.0.2: +esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1899,6 +2005,18 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" +execa@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" + dependencies: + cross-spawn "^4.0.0" + get-stream "^2.2.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + execa@^0.6.0: version "0.6.3" resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" @@ -1921,6 +2039,18 @@ expand-brackets@^0.1.4: dependencies: is-posix-bracket "^0.1.0" +expand-brackets@^2.0.1: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" @@ -1934,8 +2064,8 @@ extend-shallow@^2.0.1: is-extendable "^0.1.0" extend@^3.0.0, extend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + version "3.0.1" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" extglob@^0.3.1: version "0.3.2" @@ -1943,6 +2073,19 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" +extglob@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-1.1.0.tgz#0678b4e2ce45c0e4e50f5e5eafb1b0dab5b4e424" + dependencies: + array-unique "^0.3.2" + define-property "^0.2.5" + expand-brackets "^2.0.1" + extend-shallow "^2.0.1" + fragment-cache "^0.2.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^2.1.0" + extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" @@ -1984,8 +2127,8 @@ file-entry-cache@^2.0.0: object-assign "^4.0.1" filename-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" fileset@^2.0.2: version "2.0.3" @@ -2004,6 +2147,15 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" @@ -2034,15 +2186,11 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.45.0: - version "0.45.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.45.0.tgz#009dd0f577a3f665c74ca8be827ae8c2dd8fd6b5" - -flow-parser@0.43.0: - version "0.43.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7" +flow-bin@^0.46.0: + version "0.46.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.46.0.tgz#06ad7fe19dddb1042264438064a2a32fee12b872" -for-in@^1.0.1: +for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -2064,6 +2212,12 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +fragment-cache@^0.2.0, fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + fs-access@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" @@ -2071,8 +2225,8 @@ fs-access@^1.0.0: null-check "^1.0.0" fs-extra@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.0.tgz#244e0c4b0b8818f54040ec049d8a2bddc1202861" + version "3.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" dependencies: graceful-fs "^4.1.2" jsonfile "^3.0.0" @@ -2114,9 +2268,9 @@ function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" -gauge@~2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -2159,32 +2313,36 @@ get-port@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e" -get-stdin@5.0.1, get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" - get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + +get-stream@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" +get-value@^2.0.3, get-value@^2.0.5, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + getpass@^0.1.1: - version "0.1.6" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" dependencies: assert-plus "^1.0.0" -git-latest-semver-tag@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/git-latest-semver-tag/-/git-latest-semver-tag-1.0.2.tgz#061130cbf4274111cc6be4612b3ff3a6d93e2660" - dependencies: - git-semver-tags "^1.1.2" - meow "^3.3.0" - -git-raw-commits@^1.0.0, git-raw-commits@^1.2.0: +git-raw-commits@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.2.0.tgz#0f3a8bfd99ae0f2d8b9224d58892975e9a52d03c" dependencies: @@ -2201,7 +2359,7 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^1.1.2, git-semver-tags@^1.2.0: +git-semver-tags@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.0.tgz#b31fd02c8ab578bd6c9b5cacca5e1c64c1177ac1" dependencies: @@ -2227,11 +2385,11 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@1.1.1, github-slugger@^1.0.0, github-slugger@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.1.1.tgz#5444671f65e5a5a424cfa8ba3255cc1f7baf07ea" +github-slugger@1.1.3, github-slugger@^1.0.0, github-slugger@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.1.3.tgz#314a6e759a18c2b0cc5760d512ccbab549c549a7" dependencies: - emoji-regex "^6.0.0" + emoji-regex ">=6.0.0 <=6.1.1" github-url-from-git@^1.4.0: version "1.5.0" @@ -2270,17 +2428,6 @@ glob-stream@^5.3.2: to-absolute-glob "^0.1.1" unique-stream "^2.0.2" -glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^5.0.3: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" @@ -2301,6 +2448,17 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals-docs@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.3.0.tgz#dca4088af196f7800f4eba783eaeff335cb6759c" @@ -2320,7 +2478,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2343,8 +2501,8 @@ gulp-sourcemaps@1.6.0: vinyl "^1.0.0" handlebars@^4.0.2, handlebars@^4.0.3: - version "4.0.6" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7" + version "4.0.10" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" dependencies: async "^1.4.0" optimist "^0.6.1" @@ -2386,6 +2544,18 @@ has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -2434,8 +2604,8 @@ hawk@~3.1.3: sntp "1.x.x" highlight.js@^9.1.0: - version "9.11.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.11.0.tgz#47f98c7399918700db2caf230ded12cec41a84ae" + version "9.12.0" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e" hoek@2.x.x: version "2.16.3" @@ -2471,8 +2641,8 @@ http-signature@~1.1.0: sshpk "^1.7.0" husky@^0.13.3: - version "0.13.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.3.tgz#bc2066080badc8b8fe3516e881f5bc68a57052ff" + version "0.13.4" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407" dependencies: chalk "^1.1.3" find-parent-dir "^0.3.0" @@ -2484,8 +2654,8 @@ iconv-lite@0.4.13: resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" ignore@^3.2.0: - version "3.2.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" imurmurhash@^0.1.4: version "0.1.4" @@ -2559,6 +2729,12 @@ is-absolute@^0.2.3: is-relative "^0.2.1" is-windows "^0.2.0" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + is-alphabetical@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.0.tgz#e2544c13058255f2144cb757066cd3342a1c8c46" @@ -2584,7 +2760,7 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.0.2, is-buffer@^1.1.4: +is-buffer@^1.1.4, is-buffer@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" @@ -2594,19 +2770,43 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" -is-ci@^1.0.9: +is-ci@^1.0.10, is-ci@^1.0.9: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" dependencies: ci-info "^1.0.0" +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + is-decimal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.0.tgz#940579b6ea63c628080a69e62bda88c8470b4fe0" +is-descriptor@^0.1.0: + version "0.1.5" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.5.tgz#e3fb8b4ab65f3a37373388e18b401d78c58cbea7" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^3.0.2" + lazy-cache "^2.0.2" + +is-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.0.tgz#d6ec686f238f6b02f23757abe12cf6b2ea2790f9" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^3.0.2" + lazy-cache "^2.0.2" + is-dotfile@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" is-equal-shallow@^0.1.3: version "0.1.3" @@ -2622,7 +2822,7 @@ is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" -is-extglob@^2.1.0: +is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -2673,10 +2873,22 @@ is-number@^2.0.2, is-number@^2.1.0: dependencies: kind-of "^3.0.2" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-obj@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-odd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" + dependencies: + is-number "^3.0.0" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -2697,6 +2909,12 @@ is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" +is-plain-object@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.3.tgz#c15bf3e4b66b62d72efaf2925848663ecbc619b6" + dependencies: + isobject "^3.0.0" + is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" @@ -2783,297 +3001,297 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -isarray@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" -isobject@^2.0.0: +isobject@^2.0.0, isobject@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" dependencies: isarray "1.0.0" +isobject@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.0.tgz#39565217f3661789e8a0a0c080d5f7e6bc46e1a0" + isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-api@^1.1.0-alpha.1: - version "1.1.8" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" +istanbul-api@^1.1.1: + version "1.1.9" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.9.tgz#2827920d380d4286d857d57a2968a841db8a7ec8" dependencies: async "^2.1.4" fileset "^2.0.2" - istanbul-lib-coverage "^1.1.0" - istanbul-lib-hook "^1.0.6" - istanbul-lib-instrument "^1.7.1" - istanbul-lib-report "^1.1.0" - istanbul-lib-source-maps "^1.2.0" - istanbul-reports "^1.1.0" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-hook "^1.0.7" + istanbul-lib-instrument "^1.7.2" + istanbul-lib-report "^1.1.1" + istanbul-lib-source-maps "^1.2.1" + istanbul-reports "^1.1.1" js-yaml "^3.7.0" mkdirp "^0.5.1" once "^1.4.0" -istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" +istanbul-lib-coverage@^1.0.1, istanbul-lib-coverage@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" -istanbul-lib-hook@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" +istanbul-lib-hook@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.7.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" semver "^5.3.0" -istanbul-lib-report@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" +istanbul-lib-report@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" dependencies: - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" +istanbul-lib-source-maps@^1.1.0, istanbul-lib-source-maps@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" dependencies: debug "^2.6.3" - istanbul-lib-coverage "^1.1.0" + istanbul-lib-coverage "^1.1.1" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" +istanbul-reports@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" dependencies: handlebars "^4.0.3" -jest-changed-files@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-19.0.2.tgz#16c54c84c3270be408e06d2e8af3f3e37a885824" +jest-changed-files@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" -jest-cli@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-19.0.2.tgz#cc3620b62acac5f2d93a548cb6ef697d4ec85443" +jest-cli@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" dependencies: ansi-escapes "^1.4.0" callsites "^2.0.0" - chalk "^1.1.1" - graceful-fs "^4.1.6" - is-ci "^1.0.9" - istanbul-api "^1.1.0-alpha.1" - istanbul-lib-coverage "^1.0.0" - istanbul-lib-instrument "^1.1.1" - jest-changed-files "^19.0.2" - jest-config "^19.0.2" - jest-environment-jsdom "^19.0.2" - jest-haste-map "^19.0.0" - jest-jasmine2 "^19.0.2" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" - jest-resolve-dependencies "^19.0.0" - jest-runtime "^19.0.2" - jest-snapshot "^19.0.2" - jest-util "^19.0.2" + chalk "^1.1.3" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + istanbul-api "^1.1.1" + istanbul-lib-coverage "^1.0.1" + istanbul-lib-instrument "^1.4.2" + istanbul-lib-source-maps "^1.1.0" + jest-changed-files "^20.0.3" + jest-config "^20.0.4" + jest-docblock "^20.0.3" + jest-environment-jsdom "^20.0.3" + jest-haste-map "^20.0.4" + jest-jasmine2 "^20.0.4" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve-dependencies "^20.0.3" + jest-runtime "^20.0.4" + jest-snapshot "^20.0.3" + jest-util "^20.0.3" micromatch "^2.3.11" - node-notifier "^5.0.1" + node-notifier "^5.0.2" + pify "^2.3.0" slash "^1.0.0" string-length "^1.0.1" throat "^3.0.0" - which "^1.1.1" + which "^1.2.12" worker-farm "^1.3.1" - yargs "^6.3.0" + yargs "^7.0.2" -jest-config@^19.0.2: - version "19.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" +jest-config@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" dependencies: - chalk "^1.1.1" - jest-environment-jsdom "^19.0.2" - jest-environment-node "^19.0.2" - jest-jasmine2 "^19.0.2" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.2" - jest-validate "^19.0.2" - pretty-format "^19.0.0" - -jest-diff@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" + chalk "^1.1.3" + glob "^7.1.1" + jest-environment-jsdom "^20.0.3" + jest-environment-node "^20.0.3" + jest-jasmine2 "^20.0.4" + jest-matcher-utils "^20.0.3" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-validate "^20.0.3" + pretty-format "^20.0.3" + +jest-diff@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" dependencies: chalk "^1.1.3" - diff "^3.0.0" - jest-matcher-utils "^19.0.0" - pretty-format "^19.0.0" + diff "^3.2.0" + jest-matcher-utils "^20.0.3" + pretty-format "^20.0.3" -jest-environment-jsdom@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" - dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" - jsdom "^9.11.0" +jest-docblock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" -jest-environment-node@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" +jest-environment-jsdom@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" dependencies: - jest-mock "^19.0.0" - jest-util "^19.0.2" + jest-mock "^20.0.3" + jest-util "^20.0.3" + jsdom "^9.12.0" -jest-file-exists@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" +jest-environment-node@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" + dependencies: + jest-mock "^20.0.3" + jest-util "^20.0.3" -jest-haste-map@^19.0.0: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" +jest-haste-map@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" dependencies: fb-watchman "^2.0.0" - graceful-fs "^4.1.6" + graceful-fs "^4.1.11" + jest-docblock "^20.0.3" micromatch "^2.3.11" - sane "~1.5.0" + sane "~1.6.0" worker-farm "^1.3.1" -jest-jasmine2@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" +jest-jasmine2@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" dependencies: - graceful-fs "^4.1.6" - jest-matcher-utils "^19.0.0" - jest-matchers "^19.0.0" - jest-message-util "^19.0.0" - jest-snapshot "^19.0.2" + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-matchers "^20.0.3" + jest-message-util "^20.0.3" + jest-snapshot "^20.0.3" + once "^1.4.0" + p-map "^1.1.1" -jest-matcher-utils@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" +jest-matcher-utils@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" dependencies: chalk "^1.1.3" - pretty-format "^19.0.0" + pretty-format "^20.0.3" -jest-matchers@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" +jest-matchers@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" dependencies: - jest-diff "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-message-util "^19.0.0" - jest-regex-util "^19.0.0" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-message-util "^20.0.3" + jest-regex-util "^20.0.3" -jest-message-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" +jest-message-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" dependencies: - chalk "^1.1.1" + chalk "^1.1.3" micromatch "^2.3.11" + slash "^1.0.0" -jest-mock@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" +jest-mock@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" -jest-regex-util@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" +jest-regex-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" -jest-resolve-dependencies@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-19.0.0.tgz#a741ad1fa094140e64ecf2642a504f834ece22ee" +jest-resolve-dependencies@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" dependencies: - jest-file-exists "^19.0.0" + jest-regex-util "^20.0.3" -jest-resolve@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" +jest-resolve@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" dependencies: browser-resolve "^1.11.2" - jest-haste-map "^19.0.0" - resolve "^1.2.0" + is-builtin-module "^1.0.0" + resolve "^1.3.2" -jest-runtime@^19.0.2: - version "19.0.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.3.tgz#a163354ace46910ee33f0282b6bff6b0b87d4330" +jest-runtime@^20.0.4: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" dependencies: babel-core "^6.0.0" - babel-jest "^19.0.0" + babel-jest "^20.0.3" babel-plugin-istanbul "^4.0.0" chalk "^1.1.3" - graceful-fs "^4.1.6" - jest-config "^19.0.2" - jest-file-exists "^19.0.0" - jest-haste-map "^19.0.0" - jest-regex-util "^19.0.0" - jest-resolve "^19.0.2" - jest-util "^19.0.2" + convert-source-map "^1.4.0" + graceful-fs "^4.1.11" + jest-config "^20.0.4" + jest-haste-map "^20.0.4" + jest-regex-util "^20.0.3" + jest-resolve "^20.0.4" + jest-util "^20.0.3" json-stable-stringify "^1.0.1" micromatch "^2.3.11" strip-bom "3.0.0" - yargs "^6.3.0" + yargs "^7.0.2" -jest-snapshot@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" +jest-snapshot@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" dependencies: chalk "^1.1.3" - jest-diff "^19.0.0" - jest-file-exists "^19.0.0" - jest-matcher-utils "^19.0.0" - jest-util "^19.0.2" + jest-diff "^20.0.3" + jest-matcher-utils "^20.0.3" + jest-util "^20.0.3" natural-compare "^1.4.0" - pretty-format "^19.0.0" + pretty-format "^20.0.3" -jest-util@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" +jest-util@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" dependencies: - chalk "^1.1.1" - graceful-fs "^4.1.6" - jest-file-exists "^19.0.0" - jest-message-util "^19.0.0" - jest-mock "^19.0.0" - jest-validate "^19.0.2" - leven "^2.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.11" + jest-message-util "^20.0.3" + jest-mock "^20.0.3" + jest-validate "^20.0.3" + leven "^2.1.0" mkdirp "^0.5.1" -jest-validate@19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" - dependencies: - chalk "^1.1.1" - jest-matcher-utils "^19.0.0" - leven "^2.0.0" - pretty-format "^19.0.0" - -jest-validate@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" +jest-validate@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" dependencies: - chalk "^1.1.1" - jest-matcher-utils "^19.0.0" - leven "^2.0.0" - pretty-format "^19.0.0" + chalk "^1.1.3" + jest-matcher-utils "^20.0.3" + leven "^2.1.0" + pretty-format "^20.0.3" -jest@^19.0.2: - version "19.0.2" - resolved "https://registry.yarnpkg.com/jest/-/jest-19.0.2.tgz#b794faaf8ff461e7388f28beef559a54f20b2c10" +jest@^20.0.1: + version "20.0.4" + resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" dependencies: - jest-cli "^19.0.2" + jest-cli "^20.0.4" jodid25519@^1.0.0: version "1.0.2" @@ -3093,8 +3311,8 @@ js-yaml@3.6.1: esprima "^2.6.0" js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0: - version "3.8.3" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" @@ -3103,7 +3321,7 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" -jsdom@^9.11.0: +jsdom@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" dependencies: @@ -3164,8 +3382,8 @@ jsonify@~0.0.0: resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" jsonparse@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.0.tgz#85fc245b1d9259acc6941960b905adf64e7de0e8" + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" jsonpointer@^4.0.0: version "4.0.1" @@ -3184,16 +3402,28 @@ kebab-case@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/kebab-case/-/kebab-case-1.0.0.tgz#3f9e4990adcad0c686c0e701f7645868f75f91eb" -kind-of@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" dependencies: - is-buffer "^1.0.2" + is-buffer "^1.1.5" lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +lazy-cache@^2.0.1, lazy-cache@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" + dependencies: + set-getter "^0.1.0" + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -3210,7 +3440,7 @@ lcov-parse@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" -leven@^2.0.0: +leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3222,15 +3452,17 @@ levn@^0.3.0, levn@~0.3.0: type-check "~0.3.2" lint-staged@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.4.0.tgz#52fa85dfc92bb1c6fe8ad0d0d98ca13924e03e4b" + version "3.6.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.6.0.tgz#cda8f0bef16e7928cc14b735186ae12cd662599c" dependencies: app-root-path "^2.0.0" cosmiconfig "^1.1.0" execa "^0.6.0" - listr "^0.11.0" + listr "^0.12.0" + lodash.chunk "^4.2.0" minimatch "^3.0.0" npm-which "^3.0.1" + p-map "^1.1.1" staged-git-files "0.0.4" listr-silent-renderer@^1.1.1: @@ -3259,9 +3491,9 @@ listr-verbose-renderer@^0.4.0: date-fns "^1.27.2" figures "^1.7.0" -listr@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.11.0.tgz#5e778bc23806ac3ab984ed75564458151f39b03e" +listr@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -3275,6 +3507,7 @@ listr@^0.11.0: log-symbols "^1.0.2" log-update "^1.0.2" ora "^0.2.3" + p-map "^1.1.1" rxjs "^5.0.0-beta.11" stream-to-observable "^0.1.0" strip-ansi "^3.0.1" @@ -3313,6 +3546,10 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" +lodash.chunk@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" + lodash.isequal@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" @@ -3389,7 +3626,7 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -map-cache@^0.2.0: +map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -3397,6 +3634,13 @@ map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" +map-visit@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-0.1.5.tgz#dbe43927ce5525b80dfc1573a44d68c51f26816b" + dependencies: + lazy-cache "^2.0.1" + object-visit "^0.3.4" + markdown-escapes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.0.tgz#c8ca19f1d94d682459e0a93c86db27a7ef716b23" @@ -3454,6 +3698,12 @@ mdast-util-toc@^2.0.0: mdast-util-to-string "^1.0.2" unist-util-visit "^1.1.0" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -3479,7 +3729,7 @@ merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" -micromatch@^2.1.5, micromatch@^2.1.6, micromatch@^2.3.11, micromatch@^2.3.7: +micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -3497,6 +3747,24 @@ micromatch@^2.1.5, micromatch@^2.1.6, micromatch@^2.3.11, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" +micromatch@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.0.3.tgz#af3339640157ddad39b81a09956d8877cc4b421a" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.2.2" + define-property "^1.0.0" + extend-shallow "^2.0.1" + extglob "^1.1.0" + fragment-cache "^0.2.1" + kind-of "^4.0.0" + nanomatch "^1.2.0" + object.pick "^1.2.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + mime-db@~1.27.0: version "1.27.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" @@ -3508,14 +3776,18 @@ mime-types@^2.1.12, mime-types@~2.1.7: mime-db "~1.27.0" mime@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + version "1.3.6" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8, minimist@~0.0.1: version "0.0.8" @@ -3525,6 +3797,13 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +mixin-deep@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.2.0.tgz#d02b8c6f8b6d4b8f5982d3fd009c4919851c3fe2" + dependencies: + for-in "^1.0.2" + is-extendable "^0.1.1" + "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -3532,8 +3811,8 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 minimist "0.0.8" mock-fs@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.2.0.tgz#ef53ae17b77e64f67816dd0467f29208a3b26e19" + version "4.3.0" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.3.0.tgz#c2fab8d784283287e9b6ae7538f2dc56c1a05ed7" modify-values@^1.0.0: version "1.0.0" @@ -3562,9 +3841,9 @@ ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" -ms@0.7.3: - version "0.7.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" mute-stream@0.0.5: version "0.0.5" @@ -3574,6 +3853,23 @@ nan@^2.3.0: version "2.6.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" +nanomatch@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.0.tgz#76fdb3d4ae7617e37719e7a4047b840857c0cb1c" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^1.0.0" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + is-extglob "^2.1.1" + is-odd "^1.0.0" + kind-of "^4.0.0" + object.pick "^1.2.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -3582,7 +3878,7 @@ node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" -node-notifier@^5.0.1: +node-notifier@^5.0.2: version "5.1.2" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" dependencies: @@ -3592,8 +3888,8 @@ node-notifier@^5.0.1: which "^1.2.12" node-pre-gyp@^0.6.29: - version "0.6.34" - resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" + version "0.6.36" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" dependencies: mkdirp "^0.5.1" nopt "^4.0.1" @@ -3656,12 +3952,12 @@ npm-which@^3.0.1: which "^1.2.10" npmlog@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f" + version "4.1.0" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5" dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" - gauge "~2.7.1" + gauge "~2.7.3" set-blocking "~2.0.0" null-check@^1.0.0: @@ -3673,8 +3969,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.3.9" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" + version "1.4.0" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" oauth-sign@~0.8.1: version "0.8.2" @@ -3684,6 +3980,20 @@ object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-0.3.4.tgz#ae15cf86f0b2fdd551771636448452c54c3da829" + dependencies: + isobject "^2.0.0" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -3691,6 +4001,12 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" +object.pick@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.2.0.tgz#b5392bee9782da6d9fb7d6afaf539779f1234c2b" + dependencies: + isobject "^2.1.0" + once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -3742,8 +4058,8 @@ ordered-read-streams@^0.3.0: readable-stream "^2.0.1" os-homedir@^1.0.0, os-homedir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.1.tgz#0d62bdf44b916fd3bbdcf2cab191948fb094f007" + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" os-locale@^1.4.0: version "1.4.0" @@ -3751,6 +4067,14 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" +os-locale@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" + dependencies: + execa "^0.5.0" + lcid "^1.0.0" + mem "^1.1.0" + os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3771,8 +4095,10 @@ output-file-sync@^1.1.0: object-assign "^4.1.0" p-event@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.0.0.tgz#f3e5ea67c501cc34c12cc68715c214948142c46f" + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.2.0.tgz#837cfbeb652e497922f22162fb1f4c8487e27173" + dependencies: + p-timeout "^1.1.1" p-finally@^1.0.0: version "1.0.0" @@ -3788,6 +4114,14 @@ p-locate@^2.0.0: dependencies: p-limit "^1.1.0" +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + +p-timeout@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.1.1.tgz#d28e9fdf96e328886fbff078f886ad158c53bf6d" + pad-right@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" @@ -3856,6 +4190,10 @@ parse5@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -3922,6 +4260,10 @@ pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -3942,6 +4284,10 @@ pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -3951,24 +4297,14 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" prettier@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e" - dependencies: - ast-types "0.9.8" - babel-code-frame "6.22.0" - babylon "7.0.0-beta.8" - chalk "1.1.3" - esutils "2.0.2" - flow-parser "0.43.0" - get-stdin "5.0.1" - glob "7.1.1" - jest-validate "19.0.0" - minimist "1.2.0" + version "1.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.2.tgz#bcdd95ed1eca434ac7f98ca26ea4d25a2af6a2ac" -pretty-format@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-19.0.0.tgz#56530d32acb98a3fa4851c4e2b9d37b420684c84" +pretty-format@^20.0.3: + version "20.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" dependencies: + ansi-regex "^2.1.1" ansi-styles "^3.0.0" private@^0.1.6: @@ -4007,7 +4343,7 @@ q@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" -qs@^6.2.0, qs@~6.4.0: +qs@^6.4.0, qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" @@ -4078,14 +4414,14 @@ read-pkg@^2.0.0: string_decoder "~0.10.x" readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: - version "2.2.9" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" + version "2.2.10" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.10.tgz#effe72bb7c884c0dd335e2379d526196d9d011ee" dependencies: - buffer-shims "~1.0.0" core-util-is "~1.0.0" inherits "~2.0.1" isarray "~1.0.0" process-nextick-args "~1.0.6" + safe-buffer "^5.0.1" string_decoder "~1.0.0" util-deprecate "~1.0.1" @@ -4147,8 +4483,8 @@ regenerate@^1.2.1: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" regenerator-runtime@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" regenerator-transform@0.9.11: version "0.9.11" @@ -4165,6 +4501,16 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" +regex-not@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-0.1.2.tgz#bc7f1c4944b1188353d07deeb912b94e0ade25db" + +regex-not@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.0.tgz#42f83e39771622df826b02af176525d6a5f157f9" + dependencies: + extend-shallow "^2.0.1" + regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" @@ -4193,8 +4539,8 @@ remark-html@6.0.0: xtend "^4.0.1" remark-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-3.0.0.tgz#f078c8c9976efb0f2afd011c79f30708354593b1" + version "3.0.1" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-3.0.1.tgz#1b9f841a44d8f4fbf2246850265459a4eb354c80" dependencies: collapse-white-space "^1.0.2" has "^1.0.1" @@ -4222,8 +4568,8 @@ remark-slug@^4.0.0: unist-util-visit "^1.0.0" remark-stringify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-3.0.0.tgz#f1720893a3e7c845824d95bb573d628d1346ba2a" + version "3.0.1" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-3.0.1.tgz#79242bebe0a752081b5809516fa0c06edec069cf" dependencies: ccount "^1.0.0" is-alphanumeric "^1.0.0" @@ -4248,8 +4594,8 @@ remark-toc@^4.0.0: remark-slug "^4.0.0" remark@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-7.0.0.tgz#ce9c788c390d98d9a67cb7738e98246732e79144" + version "7.0.1" + resolved "https://registry.yarnpkg.com/remark/-/remark-7.0.1.tgz#a5de4dacfabf0f60a49826ef24c479807f904bfb" dependencies: remark-parse "^3.0.0" remark-stringify "^3.0.0" @@ -4269,7 +4615,7 @@ repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" -repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4: +repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -4362,11 +4708,15 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.3, resolve@^1.1.6, resolve@^1.2.0: +resolve@^1.1.3, resolve@^1.1.6, resolve@^1.3.2: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -4406,22 +4756,22 @@ rx-lite@^3.1.2: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" rxjs@^5.0.0-beta.11: - version "5.3.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.3.0.tgz#d88ccbdd46af290cbdb97d5d8055e52453fabe2d" + version "5.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.0.tgz#a7db14ab157f9d7aac6a56e655e7a3860d39bf26" dependencies: symbol-observable "^1.0.1" safe-buffer@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + version "5.1.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223" safe-json-parse@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" -sane@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" +sane@~1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" dependencies: anymatch "^1.3.0" exec-sh "^0.2.0" @@ -4443,10 +4793,25 @@ set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" +set-getter@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" + dependencies: + to-object-path "^0.3.0" + set-immediate-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" +set-value@^0.4.2, set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -4481,18 +4846,58 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +snapdragon-node@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.0.1.tgz#3b485cef2a6d55dfaeb52641a8388c6ea81cbea2" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.0" + +snapdragon-util@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.0.tgz#0ac6288d8409e45d04fd1034e0bb745701cae9c0" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^2.0.0" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: hoek "2.x.x" +source-map-resolve@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.0.tgz#fcad0b64b70afb27699e425950cb5ebcd410bc20" + dependencies: + atob "^2.0.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + source-map-support@^0.4.2: - version "0.4.14" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" + version "0.4.15" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" dependencies: source-map "^0.5.6" +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + source-map@^0.4.4: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" @@ -4529,6 +4934,12 @@ spdx-license-ids@^1.0.2: version "1.2.2" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" +split-string@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-2.1.1.tgz#af4b06d821560426446c3cd931cda618940d37d0" + dependencies: + extend-shallow "^2.0.1" + split2@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/split2/-/split2-2.1.1.tgz#7a1f551e176a90ecd3345f7246a0cfe175ef4fd0" @@ -4565,22 +4976,28 @@ staged-git-files@0.0.4: resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" standard-version@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.0.0.tgz#e578cefd43ab7b02944bd7569525052eac1b9787" + version "4.1.0" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.1.0.tgz#a049e87c302e7fce23f2f8a18e3ed7f1509436ec" dependencies: chalk "^1.1.3" conventional-changelog "^1.1.0" - conventional-recommended-bump "^0.3.0" + conventional-recommended-bump "^1.0.0" figures "^1.5.0" fs-access "^1.0.0" - object-assign "^4.1.0" semver "^5.1.0" - yargs "^6.0.0" + yargs "^8.0.1" state-toggle@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + stream-array@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/stream-array/-/stream-array-1.1.2.tgz#9e5f7345f2137c30ee3b498b9114e80b52bb7eb5" @@ -4632,10 +5049,10 @@ string_decoder@0.10, string_decoder@~0.10.x: resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" string_decoder@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.0.tgz#f06f41157b664d86069f84bdbdc9b0d8ab281667" + version "1.0.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" dependencies: - buffer-shims "~1.0.0" + safe-buffer "^5.0.1" stringify-entities@^1.0.1: version "1.3.0" @@ -4744,9 +5161,9 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -test-exclude@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" +test-exclude@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -4755,16 +5172,18 @@ test-exclude@^4.1.0: require-main-filename "^1.0.1" text-extensions@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.4.0.tgz#c385d2e80879fe6ef97893e1709d88d9453726e9" + version "1.5.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.5.0.tgz#d1cb2d14b5d0bc45bfdca8a08a473f68c7eb0cbc" text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" throat@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" + version "3.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.1.0.tgz#ef22d8855963b3fdc626d043508f24c4cdf7d3c3" + dependencies: + double-ended-queue "^2.1.0-0" through2-filter@^2.0.0: version "2.0.0" @@ -4792,15 +5211,15 @@ through@2, "through@>=2.2.7 <3", through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" tiny-lr@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.0.3.tgz#386731170ce521263a9d337f769ee8f11e88eb04" + version "1.0.4" + resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.0.4.tgz#d13becf37f8b7e963320f5743298e3e934c7329a" dependencies: body "^5.1.0" debug "~2.2.0" faye-websocket "~0.10.0" livereload-js "^2.2.2" object-assign "^4.1.0" - qs "^6.2.0" + qs "^6.4.0" tmp@^0.0.31: version "0.0.31" @@ -4819,8 +5238,37 @@ to-absolute-glob@^0.1.1: extend-shallow "^2.0.1" to-fast-properties@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-2.1.0.tgz#e3ad3a40cfe119559a05aea43e4caefacc5e901d" + dependencies: + define-property "^0.2.5" + extend-shallow "^2.0.1" + regex-not "^0.1.1" + +to-regex@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.1.tgz#15358bee4a2c83bd76377ba1dc049d0f18837aae" + dependencies: + define-property "^0.2.5" + extend-shallow "^2.0.1" + regex-not "^1.0.0" tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" @@ -4889,8 +5337,8 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.8.22" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.22.tgz#d54934778a8da14903fa29a326fb24c0ab51a1a0" + version "2.8.28" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.28.tgz#e335032df9bb20dcb918f164589d5af47f38834a" dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -4917,19 +5365,27 @@ unherit@^1.0.4: xtend "^4.0.1" unified@^6.0.0: - version "6.1.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.2.tgz#b3904c3254ffbea7ff6d806c5d5b6248838cecb6" + version "6.1.4" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.4.tgz#12d7a4ec35986c4a2fa0815cdfdec4be0245fca2" dependencies: bail "^1.0.0" extend "^3.0.0" has "^1.0.1" is-plain-obj "^1.1.0" - isarray "^2.0.1" trough "^1.0.0" vfile "^2.0.0" x-is-function "^1.0.4" x-is-string "^0.1.0" +union-value@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-0.2.4.tgz#7375152786679057e7b37aa676e83468fc0274f0" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + unique-stream@^2.0.2: version "2.2.1" resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" @@ -4948,8 +5404,8 @@ unist-util-generated@^1.1.0: resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.0.tgz#8c95657ff12b32eaffe0731fbb37da6995fae01b" unist-util-is@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.0.0.tgz#e536472c4f78739e164d0859fc3201b97cf46e7c" + version "2.1.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.0.tgz#d746a2702a8921b4cc356fbbd558ea05fc5052ec" unist-util-modify-children@^1.0.0: version "1.1.0" @@ -4968,10 +5424,8 @@ unist-util-remove-position@^1.0.0: unist-util-visit "^1.1.0" unist-util-stringify-position@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.0.tgz#e8ba9d6b6af891b5f8336b3a31c63a9dc85c2af0" - dependencies: - has "^1.0.1" + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" unist-util-visit@^1.0.0, unist-util-visit@^1.0.1, unist-util-visit@^1.1.0: version "1.1.1" @@ -4981,6 +5435,25 @@ universalify@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" +unset-value@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-0.1.2.tgz#506810b867f27c2a5a6e9b04833631f6de58d310" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +use@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" + dependencies: + define-property "^0.2.5" + isobject "^3.0.0" + lazy-cache "^2.0.2" + user-home@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" @@ -5044,14 +5517,12 @@ vfile-sort@^2.0.0: resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.0.0.tgz#7279458d111a9ba3b18effd9f8a0169bb7c5112b" vfile@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.0.1.tgz#bd48e68e8a2322dff0d162a37f45e70d9bb30466" + version "2.1.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.1.0.tgz#d3ce8b825e7b8d53b896164341273381936f02bd" dependencies: - has "^1.0.1" is-buffer "^1.1.4" replace-ext "1.0.0" unist-util-stringify-position "^1.0.0" - x-is-string "^0.1.0" vinyl-fs@^2.3.1: version "2.4.4" @@ -5130,8 +5601,8 @@ whatwg-encoding@^1.0.1: iconv-lite "0.4.13" whatwg-url@^4.3.0: - version "4.7.1" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + version "4.8.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.8.0.tgz#d2981aa9148c1e00a41c5a6131166ab4683bbcc0" dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" @@ -5140,25 +5611,29 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.1.1, which@^1.2.10, which@^1.2.12, which@^1.2.9: +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + +which@^1.2.10, which@^1.2.12, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: isexe "^2.0.0" wide-align@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" dependencies: - string-width "^1.0.1" + string-width "^1.0.2" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" word-wrap@^1.0.3: - version "1.2.1" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.1.tgz#248f459b465d179a17bc407c854d3151d07e45d8" + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" wordwrap@0.0.2: version "0.0.2" @@ -5226,7 +5701,19 @@ yargs-parser@^4.2.0: dependencies: camelcase "^3.0.0" -yargs@^6.0.0, yargs@^6.3.0: +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + dependencies: + camelcase "^3.0.0" + +yargs-parser@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + dependencies: + camelcase "^4.1.0" + +yargs@^6.0.1: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" dependencies: @@ -5244,6 +5731,42 @@ yargs@^6.0.0, yargs@^6.3.0: y18n "^3.2.1" yargs-parser "^4.2.0" +yargs@^7.0.2: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + +yargs@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa" + dependencies: + camelcase "^4.1.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + read-pkg-up "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1" + yargs-parser "^7.0.0" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From 35d24a20e7094d84b85ae5c1f282e8bc3d16953e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 6 Jun 2017 14:33:38 -0400 Subject: [PATCH 062/555] chore: Bump minimum required version of babylon Fixes #795 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a412f95ba..614d8e436 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "babel-traverse": "^6.16.0", "babel-types": "^6.16.0", "babelify": "^7.3.0", - "babylon": "^6.11.4", + "babylon": "^6.17.2", "chalk": "^1.1.1", "chokidar": "^1.2.0", "concat-stream": "^1.5.0", From 80799085d10b4dd832e3bc361609bcbfcc4e535a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 6 Jun 2017 14:42:56 -0400 Subject: [PATCH 063/555] chore: Update in-range updates (#799) This tries to make greenkeeper happy about these modules and confirm if they really do break. --- package.json | 6 +++--- yarn.lock | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 614d8e436..eac39de65 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "glob": "^7.0.0", "globals-docs": "^2.3.0", "highlight.js": "^9.1.0", - "js-yaml": "^3.3.1", + "js-yaml": "^3.8.4", "lodash": "^4.11.1", "mdast-util-inject": "^1.1.0", "micromatch": "^3.0.0", @@ -72,9 +72,9 @@ "eslint-config-prettier": "^2.1.1", "eslint-plugin-flowtype": "^2.32.1", "flow-bin": "^0.46.0", - "fs-extra": "^3.0.0", + "fs-extra": "^3.0.1", "husky": "^0.13.3", - "jest": "^20.0.1", + "jest": "^20.0.4", "json-schema": "0.2.3", "lint-staged": "^3.4.0", "mock-fs": "^4.2.0", diff --git a/yarn.lock b/yarn.lock index 57d0dea69..ad38ca3be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -978,7 +978,7 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@^6.11.0, babylon@^6.11.4, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: +babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0, babylon@^6.17.2: version "6.17.2" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.2.tgz#201d25ef5f892c41bae49488b08db0dd476e9f5c" @@ -2224,7 +2224,7 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-extra@^3.0.0: +fs-extra@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" dependencies: @@ -3287,7 +3287,7 @@ jest-validate@^20.0.3: leven "^2.1.0" pretty-format "^20.0.3" -jest@^20.0.1: +jest@^20.0.4: version "20.0.4" resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" dependencies: @@ -3310,7 +3310,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0: +js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0, js-yaml@^3.8.4: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: From 65f5a3722d096d704f8a1c277351aacf59468b01 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 8 Jun 2017 20:05:23 -0400 Subject: [PATCH 064/555] fix(package): update babel-generator to version 6.25.0 (#804) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eac39de65..14ed5d07f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "ansi-html": "^0.0.7", "babel-core": "^6.17.0", - "babel-generator": "6.24.1", + "babel-generator": "6.25.0", "babel-plugin-system-import-transformer": "3.1.0", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2015": "^6.16.0", From 1569644eb476b0c5675e886b41a2cd5473b26bfe Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 18 Jun 2017 02:12:57 -0400 Subject: [PATCH 065/555] chore(package): update lint-staged to version 4.0.0 (#816) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14ed5d07f..1f91adad3 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "husky": "^0.13.3", "jest": "^20.0.4", "json-schema": "0.2.3", - "lint-staged": "^3.4.0", + "lint-staged": "^4.0.0", "mock-fs": "^4.2.0", "p-event": "^1.0.0", "prettier": "^1.0.0", From e4725503b4cb5ff4cc58195cbd8780c330a78c97 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 18 Jun 2017 02:13:22 -0400 Subject: [PATCH 066/555] fix(package): update remark-html to version 6.0.1 (#815) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f91adad3..d04947cfe 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "pify": "^3.0.0", "read-pkg-up": "^2.0.0", "remark": "^7.0.0", - "remark-html": "6.0.0", + "remark-html": "6.0.1", "remark-toc": "^4.0.0", "remote-origin-url": "0.4.0", "shelljs": "^0.7.5", From 61968c790fce33c48f05790c38b0e1b7da58352d Mon Sep 17 00:00:00 2001 From: David Halls Date: Fri, 23 Jun 2017 20:41:21 +0100 Subject: [PATCH 067/555] fix: Show () for callbacks * Show callback signatures * Add output test for callback * Reformat is_function * Fix comparator * Use camelCase #818 --- __tests__/fixture/simple-callback.input.js | 18 ++++++++++++++++++ src/default_theme/index.js | 13 +++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 __tests__/fixture/simple-callback.input.js diff --git a/__tests__/fixture/simple-callback.input.js b/__tests__/fixture/simple-callback.input.js new file mode 100644 index 000000000..f96275827 --- /dev/null +++ b/__tests__/fixture/simple-callback.input.js @@ -0,0 +1,18 @@ +/** + * This takes a number and a callback and calls the callback with the number + * plus 3. + * + * @param {Number} n - The number. + * @param {simpleCallback} cb - The callback. + */ +function takesSimpleCallback(n, cb) { + cb(null, n + 3); +} + +/** + * This callback takes an error and a number. + * + * @callback simpleCallback + * @param {?Error} err - The error. + * @param {Number} n - The number. + */ diff --git a/src/default_theme/index.js b/src/default_theme/index.js index 48ef6682a..1cae8fdf7 100644 --- a/src/default_theme/index.js +++ b/src/default_theme/index.js @@ -9,6 +9,15 @@ var fs = require('fs'), LinkerStack = require('../').util.LinkerStack, hljs = require('highlight.js'); +function isFunction(section) { + return ( + section.kind === 'function' || + (section.kind === 'typedef' && + section.type.type === 'NameExpression' && + section.type.name === 'Function') + ); +} + module.exports = function( comments: Array, config: DocumentationConfig @@ -34,7 +43,7 @@ module.exports = function( var prefix = ''; if (section.kind === 'class') { prefix = 'new '; - } else if (section.kind !== 'function') { + } else if (!isFunction(section)) { return section.name; } return prefix + section.name + formatters.parameters(section, true); @@ -44,7 +53,7 @@ module.exports = function( var prefix = ''; if (section.kind === 'class') { prefix = 'new '; - } else if (section.kind !== 'function') { + } else if (!isFunction(section)) { return section.name; } if (section.returns.length) { From 15bd7af5042e67016c63dda5a05bea64e1404aed Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 23 Jun 2017 15:41:30 -0400 Subject: [PATCH 068/555] chore(package): update husky to version 0.14.0 (#823) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d04947cfe..e6a2b858e 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "eslint-plugin-flowtype": "^2.32.1", "flow-bin": "^0.46.0", "fs-extra": "^3.0.1", - "husky": "^0.13.3", + "husky": "^0.14.0", "jest": "^20.0.4", "json-schema": "0.2.3", "lint-staged": "^4.0.0", From 473f317c7890c16299943d64670fea57d46a6357 Mon Sep 17 00:00:00 2001 From: David Halls Date: Fri, 23 Jun 2017 20:42:48 +0100 Subject: [PATCH 069/555] fix: Fix filtering in the default theme --- src/default_theme/assets/site.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/default_theme/assets/site.js b/src/default_theme/assets/site.js index 55ada036f..776d38d64 100644 --- a/src/default_theme/assets/site.js +++ b/src/default_theme/assets/site.js @@ -30,7 +30,8 @@ document.getElementById('filter-input').addEventListener('keyup', function(e) { if (!value.match(/^\s*$/)) { match = function(element) { - return element.firstChild.innerHTML.toLowerCase().indexOf(value) !== -1; + var html = element.firstChild.innerHTML; + return html && html.toLowerCase().indexOf(value) !== -1; }; } @@ -83,14 +84,16 @@ function toggleSibling() { } function showHashTarget(targetId) { - var hashTarget = document.getElementById(targetId); - // new target is hidden - if ( - hashTarget && - hashTarget.offsetHeight === 0 && - hashTarget.parentNode.parentNode.classList.contains('display-none') - ) { - hashTarget.parentNode.parentNode.classList.remove('display-none'); + if (targetId) { + var hashTarget = document.getElementById(targetId); + // new target is hidden + if ( + hashTarget && + hashTarget.offsetHeight === 0 && + hashTarget.parentNode.parentNode.classList.contains('display-none') + ) { + hashTarget.parentNode.parentNode.classList.remove('display-none'); + } } } From 32ef5a5fec64bf1293e0a293ca2cf1b89144f0a5 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Sun, 25 Jun 2017 09:04:09 -0700 Subject: [PATCH 070/555] docs: Don't end 'getting started' abruptly, instead link to next steps. Fixes #826 --- docs/GETTING_STARTED.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index dea047d3a..5f9d9515d 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -136,3 +136,7 @@ function addOne(input: number): number { return input + 1; } ``` + +# Learn more + +[Continue reading](https://github.com/documentationjs/documentation#documentation) about Usage and the other aspects of `documentation`. From 505f62d161c435eebf4f7fbed12ff246268cfc82 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 26 Jun 2017 17:01:20 -0400 Subject: [PATCH 071/555] docs: Add issue template (#831) Fixes #809 --- ISSUE_TEMPLATE.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ISSUE_TEMPLATE.md diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 000000000..178189941 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,5 @@ +**If you're reporting a bug, please include _input code_, _output documentation_, +a description of what you expected to happen, and what happened instead.** + +* What version of documentation.js are you using?: +* How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): From 15239d1943c736d71fe6bd64967d65ac2713fd5a Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 5 Jul 2017 17:01:26 +0300 Subject: [PATCH 072/555] chore: Updated eslint. fixed no-useless-escape rule. (#834) --- package.json | 6 +++--- src/git/url_prefix.js | 2 +- src/module_filters.js | 9 +++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index e6a2b858e..3760ed42a 100644 --- a/package.json +++ b/package.json @@ -68,9 +68,9 @@ "coveralls": "^2.13.1", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", - "eslint": "^3.19.0", - "eslint-config-prettier": "^2.1.1", - "eslint-plugin-flowtype": "^2.32.1", + "eslint": "^4.1.1", + "eslint-config-prettier": "^2.3.0", + "eslint-plugin-flowtype": "^2.34.1", "flow-bin": "^0.46.0", "fs-extra": "^3.0.1", "husky": "^0.14.0", diff --git a/src/git/url_prefix.js b/src/git/url_prefix.js index 07562a5aa..10315914f 100644 --- a/src/git/url_prefix.js +++ b/src/git/url_prefix.js @@ -37,7 +37,7 @@ function getGithubURLPrefix(root: string) { var sha; try { var head = fs.readFileSync(path.join(root, '.git', 'HEAD'), 'utf8'); - var branch = head.match(/ref\: (.*)/); + var branch = head.match(/ref: (.*)/); if (branch) { var branchName = branch[1]; var branchFileName = path.join(root, '.git', branchName); diff --git a/src/module_filters.js b/src/module_filters.js index a288fa30f..55b6cec34 100644 --- a/src/module_filters.js +++ b/src/module_filters.js @@ -4,10 +4,11 @@ var path = require('path'); var micromatch = require('micromatch'); // Skip external modules. Based on http://git.io/pzPO. -var internalModuleRegexp = process.platform === 'win32' - ? /* istanbul ignore next */ - /^(\.|\w:)/ - : /^[\/.]/; +var internalModuleRegexp = + process.platform === 'win32' + ? /* istanbul ignore next */ + /^(\.|\w:)/ + : /^[/.]/; /** * Module filters From ea69608e92e41279e29745c405c80e686644d999 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 7 Jul 2017 22:37:26 +0300 Subject: [PATCH 073/555] fix: Report nesting errors instead of throwing them as errors Check on parent element: foo.bar sub-parametr should be documeted with parent. Fixed #832 issue --- __tests__/lib/lint.js | 8 ++++++++ declarations/comment.js | 1 - src/lint.js | 10 +++++----- src/nest.js | 29 ++++++++++++++++++----------- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/__tests__/lib/lint.js b/__tests__/lib/lint.js index 0f035b480..6e06fef30 100644 --- a/__tests__/lib/lint.js +++ b/__tests__/lib/lint.js @@ -28,6 +28,14 @@ test('lintComments', function() { { message: 'Missing or invalid tag name' } ]); + expect( + evaluate(function() { + /** + * @param {Object} foo.bar + */ + }).errors + ).toEqual([{ commentLineNumber: 1, message: 'Parent of foo.bar not found' }]); + expect( evaluate(function() { /** diff --git a/declarations/comment.js b/declarations/comment.js index a3dfa8735..af0a51bf5 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -71,7 +71,6 @@ type Comment = { tags: Array, augments: Array, - errors: Array, examples: Array, params: Array, properties: Array, diff --git a/src/lint.js b/src/lint.js index 448c201ff..2d2a45148 100644 --- a/src/lint.js +++ b/src/lint.js @@ -4,6 +4,7 @@ var VFile = require('vfile'); import { walk } from './walk'; import vfileSort from 'vfile-sort'; import reporter from 'vfile-reporter'; +import nest from './nest'; var CANONICAL = { String: 'string', @@ -27,11 +28,8 @@ function lintComments(comment: Comment) { function nameInvariant(name) { if (name && typeof CANONICAL[name] === 'string') { comment.errors.push({ - message: 'type ' + - name + - ' found, ' + - CANONICAL[name] + - ' is standard', + message: + 'type ' + name + ' found, ' + CANONICAL[name] + ' is standard', commentLineNumber: tag.lineNumber }); } @@ -60,6 +58,8 @@ function lintComments(comment: Comment) { checkCanonical(tag.type); } }); + nest(comment); + return comment; } diff --git a/src/nest.js b/src/nest.js index bf760449d..6a9987fc2 100644 --- a/src/nest.js +++ b/src/nest.js @@ -33,7 +33,8 @@ var tagDepth = tag => tag.name.split(PATH_SPLIT).length; * @returns {Object} nested comment */ var nestTag = ( - tags: Array + tags: Array, + errors: Array // Use lodash here both for brevity and also because, unlike JavaScript's // sort, it's stable. ) => @@ -59,16 +60,22 @@ var nestTag = ( if (!child) { if (tag.name.match(/^(\$\d+)/)) { - throw new Error( - `Parent of ${tag.name} not found. To document a destructuring\n` + + errors.push({ + message: + `Parent of ${tag.name} not found. To document a destructuring\n` + `type, add a @param tag in its position to specify the name of the\n` + - `destructured parameter` - ); + `destructured parameter`, + commentLineNumber: tag.lineNumber + }); + } else { + errors.push({ + message: `Parent of ${tag.name} not found`, + commentLineNumber: tag.lineNumber + }); } - throw new Error(`Parent of ${tag.name} not found`); + } else { + insertTag(child, parts.slice(1)); } - - insertTag(child, parts.slice(1)); } } @@ -91,9 +98,9 @@ var nestTag = ( * @return {Object} nested comment */ var nest = (comment: Comment) => - _.assign(comment, { - params: nestTag(comment.params), - properties: nestTag(comment.properties) + Object.assign(comment, { + params: nestTag(comment.params, comment.errors), + properties: nestTag(comment.properties, comment.errors) }); module.exports = nest; From 2329db4e5409fd58c01d01e7066aeaa1573c4f9e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 7 Jul 2017 19:24:37 -0400 Subject: [PATCH 074/555] fix(package): update chalk to version 2.0.0 (#833) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3760ed42a..81cb76c67 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "babel-types": "^6.16.0", "babelify": "^7.3.0", "babylon": "^6.17.2", - "chalk": "^1.1.1", + "chalk": "^2.0.0", "chokidar": "^1.2.0", "concat-stream": "^1.5.0", "disparity": "^2.0.0", From 715c71426a25722f01d7b0224e1622acf88df606 Mon Sep 17 00:00:00 2001 From: Harry Wood Date: Sat, 15 Jul 2017 18:44:24 +0100 Subject: [PATCH 075/555] fix broken link (#842) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de4663c1e..ba29318f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Declaring formal releases remains the prerogative of the project maintainer. This is an experiment and feedback is welcome! This document may also be subject to pull-requests or changes by contributors where you believe you have something valuable to add or change. -[this approach is totally cribbed from the excellent LevelUP project](https://github.com/rvagg/node-levelup/blob/master/CONTRIBUTING.md) +[this approach is totally cribbed from the excellent LevelUP project](https://github.com/Level/community/blob/master/CONTRIBUTING.md) ---- From 4544886ff51a5f2a55135cd65bdd6f43974ace81 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 15 Jul 2017 10:44:38 -0700 Subject: [PATCH 076/555] chore(package): update fs-extra to version 4.0.0 (#841) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 81cb76c67..c5b39da08 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "eslint-config-prettier": "^2.3.0", "eslint-plugin-flowtype": "^2.34.1", "flow-bin": "^0.46.0", - "fs-extra": "^3.0.1", + "fs-extra": "^4.0.0", "husky": "^0.14.0", "jest": "^20.0.4", "json-schema": "0.2.3", From a3e1fb8935efc09cfae546d2ffd8d96b92ce07f1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 17 Jul 2017 19:56:11 +0000 Subject: [PATCH 077/555] fix(package): update vfile-reporter to version 4.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5b39da08..90c251ccc 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "unist-builder": "^1.0.0", "unist-util-visit": "^1.0.1", "vfile": "^2.0.0", - "vfile-reporter": "^3.0.0", + "vfile-reporter": "^4.0.0", "vfile-sort": "^2.0.0", "vinyl": "^2.0.0", "vinyl-fs": "^2.3.1", From 5b5dcd16628daf7f3271f8dbaaf2ccd6939527ae Mon Sep 17 00:00:00 2001 From: Prateek Saxena Date: Thu, 20 Jul 2017 19:11:46 +0530 Subject: [PATCH 078/555] docs(theming): fix default theme link --- docs/THEMING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/THEMING.md b/docs/THEMING.md index 932b48e88..52313f6f5 100644 --- a/docs/THEMING.md +++ b/docs/THEMING.md @@ -20,7 +20,7 @@ The theme function should call the callback with either an error, if one occurs, or an array of [vinyl](https://github.com/gulpjs/vinyl) `File` objects. The theme is free to implement HTML generation however it chooses. See -[the default theme](https://github.com/documentationjs/documentation-theme-default/) +[the default theme](https://github.com/documentationjs/documentation/tree/master/src/default_theme) for some ideas. ### Theming Markdown From 1ae81366a1e98ed1f996f28a83850edaa263b7e7 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 20 Jul 2017 19:57:19 +0000 Subject: [PATCH 079/555] fix(package): update remark to version 8.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 90c251ccc..9fe220dc9 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "parse-filepath": "^1.0.1", "pify": "^3.0.0", "read-pkg-up": "^2.0.0", - "remark": "^7.0.0", + "remark": "^8.0.0", "remark-html": "6.0.1", "remark-toc": "^4.0.0", "remote-origin-url": "0.4.0", From 80a06febf17c6f7e91c2fc5b9732c118a9c01db9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jul 2017 13:31:00 -0400 Subject: [PATCH 080/555] chore(release): 4.0.0 --- CHANGELOG.md | 20 ++++++++++++++++++++ package.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f17c9455d..ee3f77036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [4.0.0](https://github.com/documentationjs/documentation/compare/v4.0.0-rc.1...v4.0.0) (2017-07-27) + + +### Bug Fixes + +* **html output:** Fix links between navigation and items in HTML documentation ([5fb77bc](https://github.com/documentationjs/documentation/commit/5fb77bc)) +* **package:** update babel-generator to version 6.25.0 ([#804](https://github.com/documentationjs/documentation/issues/804)) ([65f5a37](https://github.com/documentationjs/documentation/commit/65f5a37)) +* **package:** update chalk to version 2.0.0 ([#833](https://github.com/documentationjs/documentation/issues/833)) ([2329db4](https://github.com/documentationjs/documentation/commit/2329db4)) +* **package:** update github-slugger to version 1.1.3 ([#793](https://github.com/documentationjs/documentation/issues/793)) ([74392cc](https://github.com/documentationjs/documentation/commit/74392cc)) +* Show () for callbacks ([61968c7](https://github.com/documentationjs/documentation/commit/61968c7)) +* **package:** update micromatch to version 3.0.0 ([#792](https://github.com/documentationjs/documentation/issues/792)) ([3f2bf90](https://github.com/documentationjs/documentation/commit/3f2bf90)) +* **package:** update remark to version 8.0.0 ([1ae8136](https://github.com/documentationjs/documentation/commit/1ae8136)) +* Fix filtering in the default theme ([473f317](https://github.com/documentationjs/documentation/commit/473f317)) +* Report nesting errors instead of throwing them as errors ([ea69608](https://github.com/documentationjs/documentation/commit/ea69608)), closes [#832](https://github.com/documentationjs/documentation/issues/832) +* **package:** update remark-html to version 6.0.1 ([#815](https://github.com/documentationjs/documentation/issues/815)) ([e472550](https://github.com/documentationjs/documentation/commit/e472550)) +* **package:** update vfile-reporter to version 4.0.0 ([a3e1fb8](https://github.com/documentationjs/documentation/commit/a3e1fb8)) + + + # [4.0.0-rc.1](https://github.com/documentationjs/documentation/compare/v4.0.0-rc.0...v4.0.0-rc.1) (2017-05-01) diff --git a/package.json b/package.json index 9fe220dc9..ad8580741 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "4.0.0-rc.1", + "version": "4.0.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From b42c0d79fc519fbd14f39ea1fc2935e4ba65f0b6 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jul 2017 13:31:36 -0400 Subject: [PATCH 081/555] chore: Update lockfile --- yarn.lock | 493 +++++++++++++++++++++++++++++------------------------- 1 file changed, 269 insertions(+), 224 deletions(-) diff --git a/yarn.lock b/yarn.lock index ad38ca3be..9a919312f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -52,6 +52,15 @@ ajv@^4.7.0, ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" +ajv@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.2.2.tgz#47c68d69e86f5d953103b0074a9430dc63da5e39" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + json-schema-traverse "^0.3.0" + json-stable-stringify "^1.0.1" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -64,10 +73,14 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: +ansi-escapes@^1.0.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + ansi-html@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" @@ -76,6 +89,10 @@ ansi-regex@^2.0.0, ansi-regex@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + ansi-styles@^2.0.1, ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -86,6 +103,12 @@ ansi-styles@^3.0.0: dependencies: color-convert "^1.0.0" +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -247,7 +270,7 @@ babel-cli@^6.24.1: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -288,7 +311,20 @@ babel-eslint@^7.2.3: babel-types "^6.23.0" babylon "^6.17.0" -babel-generator@6.24.1, babel-generator@^6.18.0, babel-generator@^6.24.1: +babel-generator@6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.25.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +babel-generator@^6.18.0, babel-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" dependencies: @@ -971,6 +1007,15 @@ babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23 lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babelify@^7.3.0: version "7.3.0" resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" @@ -1177,6 +1222,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + character-entities-html4@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.0.tgz#1ab08551d3ce1fa1df08d00fb9ca1defb147a06c" @@ -1230,12 +1283,18 @@ class-utils@^0.3.4: lazy-cache "^2.0.2" static-extend "^0.1.1" -cli-cursor@^1.0.1, cli-cursor@^1.0.2: +cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + cli-spinners@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" @@ -1311,7 +1370,7 @@ collection-visit@^0.2.1: map-visit "^0.1.5" object-visit "^0.3.4" -color-convert@^1.0.0: +color-convert@^1.0.0, color-convert@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" dependencies: @@ -1354,7 +1413,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.10, concat-stream@^1.5.0, concat-stream@^1.5.2: +concat-stream@^1.4.10, concat-stream@^1.5.0, concat-stream@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -1568,7 +1627,7 @@ cross-spawn@^4.0.0: lru-cache "^4.0.1" which "^1.2.9" -cross-spawn@^5.0.1: +cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -1609,12 +1668,6 @@ cz-conventional-changelog@2.0.0: right-pad "^1.0.1" word-wrap "^1.0.3" -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" @@ -1638,7 +1691,7 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3: +debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -1820,58 +1873,6 @@ error@^7.0.0: string-template "~0.2.1" xtend "~4.0.0" -es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.23" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.23.tgz#7578b51be974207a5487821b56538c224e4e7b38" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-symbol "^3.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -1887,68 +1888,67 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-config-prettier@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.1.1.tgz#ab3923fb704eebecab6960906b7d0d6e801cde58" +eslint-config-prettier@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.3.0.tgz#b75b1eabea0c8b97b34403647ee25db349b9d8a0" dependencies: get-stdin "^5.0.1" -eslint-plugin-flowtype@^2.32.1: - version "2.34.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" +eslint-plugin-flowtype@^2.34.1: + version "2.35.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af" dependencies: lodash "^4.15.0" -eslint@^3.19.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.3.0.tgz#fcd7c96376bbf34c85ee67ed0012a299642b108f" dependencies: - babel-code-frame "^6.16.0" + ajv "^5.2.0" + babel-code-frame "^6.22.0" chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^2.6.8" doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" + eslint-scope "^3.7.1" + espree "^3.4.3" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^9.17.0" + ignore "^3.3.3" imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" + inquirer "^3.0.6" is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" + js-yaml "^3.8.4" + json-stable-stringify "^1.0.1" levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" + path-is-inside "^1.0.2" + pluralize "^4.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" strip-json-comments "~2.0.1" - table "^3.7.8" + table "^4.0.1" text-table "~0.2.0" - user-home "^2.0.0" -espree@^3.4.0: +espree@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: @@ -1992,13 +1992,6 @@ esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - exec-sh@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" @@ -2017,9 +2010,9 @@ execa@^0.5.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.6.0: - version "0.6.3" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -2067,6 +2060,14 @@ extend@^3.0.0, extend@~3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +external-editor@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" + dependencies: + iconv-lite "^0.4.17" + jschardet "^1.4.2" + tmp "^0.0.31" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -2090,6 +2091,10 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -2112,13 +2117,19 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -figures@^1.3.5, figures@^1.5.0, figures@^1.7.0: +figures@^1.5.0, figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -2156,10 +2167,6 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -2224,9 +2231,9 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-extra@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" +fs-extra@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e" dependencies: graceful-fs "^4.1.2" jsonfile "^3.0.0" @@ -2268,6 +2275,10 @@ function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2448,7 +2459,7 @@ glob@^6.0.1: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -2463,7 +2474,7 @@ globals-docs@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.3.0.tgz#dca4088af196f7800f4eba783eaeff335cb6759c" -globals@^9.0.0, globals@^9.14.0: +globals@^9.0.0, globals@^9.17.0: version "9.17.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" @@ -2540,6 +2551,10 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2640,20 +2655,23 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -husky@^0.13.3: - version "0.13.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407" +husky@^0.14.0: + version "0.14.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" dependencies: - chalk "^1.1.3" - find-parent-dir "^0.3.0" - is-ci "^1.0.9" + is-ci "^1.0.10" normalize-path "^1.0.0" + strip-indent "^2.0.0" iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" -ignore@^3.2.0: +iconv-lite@^0.4.17: + version "0.4.18" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" + +ignore@^3.3.3: version "3.3.3" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" @@ -2686,22 +2704,23 @@ ini@^1.3.2, ini@^1.3.3, ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" +inquirer@^3.0.6: + version "3.2.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.1.tgz#06ceb0f540f45ca548c17d6840959878265fa175" dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" + ansi-escapes "^2.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" cli-width "^2.0.0" - figures "^1.3.5" + external-editor "^2.0.4" + figures "^2.0.0" lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" through "^2.3.6" interpret@^1.0.0: @@ -2718,10 +2737,6 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -irregular-plurals@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.2.0.tgz#38f299834ba8c00c30be9c554e137269752ff3ac" - is-absolute@^0.2.3: version "0.2.6" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" @@ -2770,7 +2785,7 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" -is-ci@^1.0.10, is-ci@^1.0.9: +is-ci@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" dependencies: @@ -2858,7 +2873,7 @@ is-hexadecimal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.0.tgz#5c459771d2af9a2e3952781fd54fcb1bcfe4113c" -is-my-json-valid@^2.10.0, is-my-json-valid@^2.12.4: +is-my-json-valid@^2.12.4: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: @@ -3310,7 +3325,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0, js-yaml@^3.8.4: +js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: @@ -3321,6 +3336,10 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jschardet@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.0.tgz#a61f310306a5a71188e1b1acd08add3cfbb08b1e" + jsdom@^9.12.0: version "9.12.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" @@ -3353,6 +3372,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" @@ -3451,13 +3474,13 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^3.4.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.6.0.tgz#cda8f0bef16e7928cc14b735186ae12cd662599c" +lint-staged@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.2.tgz#8e83e11e9e1656c09b6117f6db0d55fd4960a1c0" dependencies: app-root-path "^2.0.0" cosmiconfig "^1.1.0" - execa "^0.6.0" + execa "^0.7.0" listr "^0.12.0" lodash.chunk "^4.2.0" minimatch "^3.0.0" @@ -3571,7 +3594,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3845,9 +3868,9 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" nan@^2.3.0: version "2.6.2" @@ -4023,6 +4046,12 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -4212,7 +4241,7 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -4274,15 +4303,9 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -plur@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" - dependencies: - irregular-plurals "^1.0.0" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +pluralize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" posix-character-classes@^0.1.0: version "0.1.1" @@ -4315,9 +4338,9 @@ process-nextick-args@^1.0.6, process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" property-information@^3.1.0: version "3.1.0" @@ -4457,14 +4480,6 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -4529,21 +4544,20 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" -remark-html@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.0.tgz#ade7d94b60e452158f28615218450682601dbfc1" +remark-html@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.1.tgz#5094d2c71f7941fdb2ae865bac76627757ce09c1" dependencies: hast-util-sanitize "^1.0.0" hast-util-to-html "^3.0.0" mdast-util-to-hast "^2.1.1" xtend "^4.0.1" -remark-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-3.0.1.tgz#1b9f841a44d8f4fbf2246850265459a4eb354c80" +remark-parse@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-4.0.0.tgz#99f1f049afac80382366e2e0d0bd55429dd45d8b" 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" @@ -4567,9 +4581,9 @@ remark-slug@^4.0.0: mdast-util-to-string "^1.0.0" unist-util-visit "^1.0.0" -remark-stringify@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-3.0.1.tgz#79242bebe0a752081b5809516fa0c06edec069cf" +remark-stringify@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-4.0.0.tgz#4431884c0418f112da44991b4e356cfe37facd87" dependencies: ccount "^1.0.0" is-alphanumeric "^1.0.0" @@ -4593,12 +4607,12 @@ remark-toc@^4.0.0: mdast-util-toc "^2.0.0" remark-slug "^4.0.0" -remark@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/remark/-/remark-7.0.1.tgz#a5de4dacfabf0f60a49826ef24c479807f904bfb" +remark@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/remark/-/remark-8.0.0.tgz#287b6df2fe1190e263c1d15e486d3fa835594d6d" dependencies: - remark-parse "^3.0.0" - remark-stringify "^3.0.0" + remark-parse "^4.0.0" + remark-stringify "^4.0.0" unified "^6.0.0" remote-origin-url@0.4.0: @@ -4697,7 +4711,7 @@ require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" -require-uncached@^1.0.2: +require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" dependencies: @@ -4729,6 +4743,13 @@ restore-cursor@^1.0.1: exit-hook "^1.0.0" onetime "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" @@ -4745,15 +4766,21 @@ rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: dependencies: glob "^7.0.5" -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" dependencies: - once "^1.3.0" + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" rxjs@^5.0.0-beta.11: version "5.4.0" @@ -4834,7 +4861,7 @@ shellwords@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -5044,6 +5071,13 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" +string-width@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + string_decoder@0.10, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -5074,6 +5108,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + strip-bom-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" @@ -5101,6 +5141,10 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -5121,6 +5165,12 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" +supports-color@^4.0.0, supports-color@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836" + dependencies: + has-flag "^2.0.0" + symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" @@ -5129,9 +5179,9 @@ symbol-tree@^3.2.1: version "3.2.2" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" +table@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435" dependencies: ajv "^4.7.0" ajv-keywords "^1.0.0" @@ -5458,12 +5508,6 @@ user-home@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -5499,23 +5543,24 @@ vfile-location@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.1.tgz#0bf8816f732b0f8bd902a56fda4c62c8e935dc52" -vfile-reporter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-3.0.0.tgz#fe50714e373e0d2940510038a99bd609bdc8209f" +vfile-reporter@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-4.0.0.tgz#ea6f0ae1342f4841573985e05f941736f27de9da" dependencies: - chalk "^1.1.0" - log-symbols "^1.0.2" - plur "^2.0.0" repeat-string "^1.5.0" string-width "^1.0.0" - strip-ansi "^3.0.1" - trim "0.0.1" + supports-color "^4.1.0" unist-util-stringify-position "^1.0.0" + vfile-statistics "^1.1.0" vfile-sort@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.0.0.tgz#7279458d111a9ba3b18effd9f8a0169bb7c5112b" +vfile-statistics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.0.tgz#02104c60fdeed1d11b1f73ad65330b7634b3d895" + vfile@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.1.0.tgz#d3ce8b825e7b8d53b896164341273381936f02bd" From 5b373ff2fe89f4170266870deb71e4afc517e331 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jul 2017 13:47:18 -0400 Subject: [PATCH 082/555] revert(polyglot): Remove polyglot mode BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much happier doing so by separating the extraction & input phases to the degree that documentation.js can read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP support in it. Fixes #850. Fixes #731. Fixes #702. Fixes #132. --- __tests__/__snapshots__/bin.js.snap | 205 +------- __tests__/__snapshots__/test.js.snap | 8 +- __tests__/bin.js | 18 - __tests__/fixture/external.input.js | 2 - __tests__/fixture/polyglot/blend.cpp | 675 --------------------------- __tests__/lib/parsers/polyglot.js | 81 ---- declarations/comment.js | 1 - docs/NODE_API.md | 10 +- docs/POLYGLOT.md | 41 +- docs/USAGE.md | 2 - package.json | 1 - src/commands/shared_options.js | 40 +- src/index.js | 21 +- src/is_jsdoc_comment.js | 5 +- src/parsers/polyglot.js | 28 -- 15 files changed, 37 insertions(+), 1101 deletions(-) delete mode 100644 __tests__/fixture/polyglot/blend.cpp delete mode 100644 __tests__/lib/parsers/polyglot.js delete mode 100644 src/parsers/polyglot.js diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 094c73747..f9c3a77bd 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 4.0.0-rc.1 | Documentation + documentation 4.0.0 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    4.0.0-rc.1
    +
    4.0.0
    -#include -#include - -#include "zlib.h" - -#if defined(HAVE_PNG) -#include -#endif - -#if defined(HAVE_JPEG) -#define XMD_H -#include -#undef XMD_H -#endif - -#if defined(HAVE_WEBP) -#include -#endif - -#include "mapnik_palette.hpp" -#include "blend.hpp" -#include "tint.hpp" - -#include -#include -#include -#include - -using namespace v8; -using namespace node; - -namespace node_mapnik { - -/** - * This method moves a hex to a color - * @name hexToUInt32Color - * @param {string} hex - * @returns {number} color - */ -static bool hexToUInt32Color(char *hex, unsigned int & value) { - if (!hex) return false; - int len_original = strlen(hex); - // Return is the length of the string is less then six - // otherwise the line after this could go to some other - // pointer in memory, resulting in strange behaviours. - if (len_original < 6) return false; - if (hex[0] == '#') hex++; - int len = strlen(hex); - if (len != 6 && len != 8) return false; - - unsigned int color = 0; - std::stringstream ss; - ss << std::hex << hex; - ss >> color; - - if (len == 8) { - // Circular shift to get from RGBA to ARGB. - value = (color << 24) | ((color & 0xFF00) << 8) | ((color & 0xFF0000) >> 8) | ((color & 0xFF000000) >> 24); - return true; - } else { - value = 0xFF000000 | ((color & 0xFF) << 16) | (color & 0xFF00) | ((color & 0xFF0000) >> 16); - return true; - } -} - -NAN_METHOD(rgb2hsl) { - NanScope(); - if (args.Length() != 3) { - NanThrowTypeError("Please pass r,g,b integer values as three arguments"); - NanReturnUndefined(); - } - if (!args[0]->IsNumber() || !args[1]->IsNumber() || !args[2]->IsNumber()) { - NanThrowTypeError("Please pass r,g,b integer values as three arguments"); - NanReturnUndefined(); - } - unsigned r,g,b; - r = args[0]->IntegerValue(); - g = args[1]->IntegerValue(); - b = args[2]->IntegerValue(); - Local hsl = NanNew(3); - double h,s,l; - rgb_to_hsl(r,g,b,h,s,l); - hsl->Set(0,NanNew(h)); - hsl->Set(1,NanNew(s)); - hsl->Set(2,NanNew(l)); - NanReturnValue(hsl); -} - -NAN_METHOD(hsl2rgb) { - NanScope(); - if (args.Length() != 3) { - NanThrowTypeError("Please pass hsl fractional values as three arguments"); - NanReturnUndefined(); - } - if (!args[0]->IsNumber() || !args[1]->IsNumber() || !args[2]->IsNumber()) { - NanThrowTypeError("Please pass hsl fractional values as three arguments"); - NanReturnUndefined(); - } - double h,s,l; - h = args[0]->NumberValue(); - s = args[1]->NumberValue(); - l = args[2]->NumberValue(); - Local rgb = NanNew(3); - unsigned r,g,b; - hsl_to_rgb(h,s,l,r,g,b); - rgb->Set(0,NanNew(r)); - rgb->Set(1,NanNew(g)); - rgb->Set(2,NanNew(b)); - NanReturnValue(rgb); -} - -static void parseTintOps(Local const& tint, Tinter & tinter, std::string & msg) { - NanScope(); - Local hue = tint->Get(NanNew("h")); - if (!hue.IsEmpty() && hue->IsArray()) { - Local val_array = Local::Cast(hue); - if (val_array->Length() != 2) { - msg = "h array must be a pair of values"; - } - tinter.h0 = val_array->Get(0)->NumberValue(); - tinter.h1 = val_array->Get(1)->NumberValue(); - } - Local sat = tint->Get(NanNew("s")); - if (!sat.IsEmpty() && sat->IsArray()) { - Local val_array = Local::Cast(sat); - if (val_array->Length() != 2) { - msg = "s array must be a pair of values"; - } - tinter.s0 = val_array->Get(0)->NumberValue(); - tinter.s1 = val_array->Get(1)->NumberValue(); - } - Local light = tint->Get(NanNew("l")); - if (!light.IsEmpty() && light->IsArray()) { - Local val_array = Local::Cast(light); - if (val_array->Length() != 2) { - msg = "l array must be a pair of values"; - } - tinter.l0 = val_array->Get(0)->NumberValue(); - tinter.l1 = val_array->Get(1)->NumberValue(); - } - Local alpha = tint->Get(NanNew("a")); - if (!alpha.IsEmpty() && alpha->IsArray()) { - Local val_array = Local::Cast(alpha); - if (val_array->Length() != 2) { - msg = "a array must be a pair of values"; - } - tinter.a0 = val_array->Get(0)->NumberValue(); - tinter.a1 = val_array->Get(1)->NumberValue(); - } -} - -static inline void Blend_CompositePixel(unsigned int& target, unsigned int const& source) { - if (source <= 0x00FFFFFF) { - // Top pixel is fully transparent. - // - } else if (source >= 0xFF000000 || target <= 0x00FFFFFF) { - // Top pixel is fully opaque or bottom pixel is fully transparent. - target = source; - } else { - // Both pixels have transparency. - // From http://trac.mapnik.org/browser/trunk/include/mapnik/graphics.hpp#L337 - long a1 = (source >> 24) & 0xff; - long r1 = source & 0xff; - long g1 = (source >> 8) & 0xff; - long b1 = (source >> 16) & 0xff; - - long a0 = (target >> 24) & 0xff; - long r0 = (target & 0xff) * a0; - long g0 = ((target >> 8) & 0xff) * a0; - long b0 = ((target >> 16) & 0xff) * a0; - - a0 = ((a1 + a0) << 8) - a0 * a1; - r0 = ((((r1 << 8) - r0) * a1 + (r0 << 8)) / a0); - g0 = ((((g1 << 8) - g0) * a1 + (g0 << 8)) / a0); - b0 = ((((b1 << 8) - b0) * a1 + (b0 << 8)) / a0); - a0 = a0 >> 8; - target = (a0 << 24) | (b0 << 16) | (g0 << 8) | (r0); - } -} - -static inline void TintPixel(unsigned & r, - unsigned & g, - unsigned & b, - Tinter const& tint) { - double h; - double s; - double l; - rgb_to_hsl(r,g,b,h,s,l); - double h2 = tint.h0 + (h * (tint.h1 - tint.h0)); - double s2 = tint.s0 + (s * (tint.s1 - tint.s0)); - double l2 = tint.l0 + (l * (tint.l1 - tint.l0)); - if (h2 > 1) h2 = 1; - if (h2 < 0) h2 = 0; - if (s2 > 1) s2 = 1; - if (s2 < 0) s2 = 0; - if (l2 > 1) l2 = 1; - if (l2 < 0) l2 = 0; - hsl_to_rgb(h2,s2,l2,r,g,b); -} - - -static void Blend_Composite(unsigned int *target, BlendBaton *baton, BImage *image) { - const unsigned int *source = image->im_ptr->data(); - - int sourceX = std::max(0, -image->x); - int sourceY = std::max(0, -image->y); - int sourcePos = sourceY * image->width + sourceX; - - int width = image->width - sourceX - std::max(0, image->x + image->width - baton->width); - int height = image->height - sourceY - std::max(0, image->y + image->height - baton->height); - - int targetX = std::max(0, image->x); - int targetY = std::max(0, image->y); - int targetPos = targetY * baton->width + targetX; - bool tinting = !image->tint.is_identity(); - bool set_alpha = !image->tint.is_alpha_identity(); - if (tinting || set_alpha) { - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - unsigned int const& source_pixel = source[sourcePos + x]; - unsigned a = (source_pixel >> 24) & 0xff; - if (set_alpha) { - double a2 = image->tint.a0 + (a/255.0 * (image->tint.a1 - image->tint.a0)); - if (a2 < 0) a2 = 0; - a = static_cast(std::floor((a2 * 255.0)+.5)); - if (a > 255) a = 255; - } - unsigned r = source_pixel & 0xff; - unsigned g = (source_pixel >> 8 ) & 0xff; - unsigned b = (source_pixel >> 16) & 0xff; - if (a > 1 && tinting) { - TintPixel(r,g,b,image->tint); - } - unsigned int new_pixel = (a << 24) | (b << 16) | (g << 8) | (r); - Blend_CompositePixel(target[targetPos + x], new_pixel); - } - sourcePos += image->width; - targetPos += baton->width; - } - } else { - for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - Blend_CompositePixel(target[targetPos + x], source[sourcePos + x]); - } - sourcePos += image->width; - targetPos += baton->width; - } - } -} - -static void Blend_Encode(mapnik::image_rgba8 const& image, BlendBaton* baton, bool alpha) { - try { - if (baton->format == BLEND_FORMAT_JPEG) { -#if defined(HAVE_JPEG) - if (baton->quality == 0) baton->quality = 85; - mapnik::save_as_jpeg(baton->stream, baton->quality, image); -#else - baton->message = "Mapnik not built with jpeg support"; -#endif - } else if (baton->format == BLEND_FORMAT_WEBP) { -#if defined(HAVE_WEBP) - if (baton->quality == 0) baton->quality = 80; - WebPConfig config; - // Default values set here will be lossless=0 and quality=75 (as least as of webp v0.3.1) - if (!WebPConfigInit(&config)) { - /* LCOV_EXCL_START */ - baton->message = "WebPConfigInit failed: version mismatch"; - /* LCOV_EXCL_END */ - } else { - // see for more details: https://github.com/mapnik/mapnik/wiki/Image-IO#webp-output-options - config.quality = baton->quality; - if (baton->compression > 0) { - config.method = baton->compression; - } - mapnik::save_as_webp(baton->stream,image,config,alpha); - } -#else - baton->message = "Mapnik not built with webp support"; -#endif - } else { - // Save as PNG. -#if defined(HAVE_PNG) - mapnik::png_options opts; - opts.compression = baton->compression; - if (baton->encoder == BLEND_ENCODER_MINIZ) opts.use_miniz = true; - if (baton->palette && baton->palette->valid()) { - mapnik::save_as_png8_pal(baton->stream, image, *baton->palette, opts); - } else if (baton->quality > 0) { - opts.colors = baton->quality; - // Paletted PNG. - if (alpha && baton->mode == BLEND_MODE_HEXTREE) { - mapnik::save_as_png8_hex(baton->stream, image, opts); - } else { - mapnik::save_as_png8_oct(baton->stream, image, opts); - } - } else { - mapnik::save_as_png(baton->stream, image, opts); - } -#else - baton->message = "Mapnik not built with png support"; -#endif - } - } catch (const std::exception& ex) { - baton->message = ex.what(); - } -} - -void Work_Blend(uv_work_t* req) { - BlendBaton* baton = static_cast(req->data); - - int total = baton->images.size(); - bool alpha = true; - int size = 0; - - // Iterate from the last to first image because we potentially don't have - // to decode all images if there's an opaque one. - Images::reverse_iterator rit = baton->images.rbegin(); - Images::reverse_iterator rend = baton->images.rend(); - for (int index = total - 1; rit != rend; rit++, index--) { - // If an image that is higher than the current is opaque, stop alltogether. - if (!alpha) break; - - BImage *image = &**rit; - std::unique_ptr image_reader; - try { - image_reader = std::unique_ptr(mapnik::get_image_reader(image->data, image->dataLength)); - } catch (std::exception const& ex) { - baton->message = ex.what(); - return; - } - - if (!image_reader || !image_reader.get()) { - // Not quite sure anymore how the pointer would not be returned - // from the reader and can't find a way to make this fail. - // So removing from coverage - /* LCOV_EXCL_START */ - baton->message = "Unknown image format"; - return; - /* LCOV_EXCL_END */ - } - - unsigned layer_width = image_reader->width(); - unsigned layer_height = image_reader->height(); - // Error out on invalid images. - if (layer_width == 0 || layer_height == 0) { - // No idea how to create a zero height or width image - // so removing from coverage, because I am fairly certain - // it is not possible in almost every image format. - /* LCOV_EXCL_START */ - baton->message = "zero width/height image encountered"; - return; - /* LCOV_EXCL_END */ - } - - int visibleWidth = (int)layer_width + image->x; - int visibleHeight = (int)layer_height + image->y; - // The first image that is in the viewport sets the width/height, if not user supplied. - if (baton->width <= 0) baton->width = std::max(0, visibleWidth); - if (baton->height <= 0) baton->height = std::max(0, visibleHeight); - - // Skip images that are outside of the viewport. - if (visibleWidth <= 0 || visibleHeight <= 0 || image->x >= baton->width || image->y >= baton->height) { - // Remove this layer from the list of layers we consider blending. - continue; - } - - bool layer_has_alpha = image_reader->has_alpha(); - - // Short-circuit when we're not reencoding. - if (size == 0 && !layer_has_alpha && !baton->reencode && - image->x == 0 && image->y == 0 && - (int)layer_width == baton->width && (int)layer_height == baton->height) - { - baton->stream.write((char *)image->data, image->dataLength); - return; - } - - // allocate image for decoded pixels - std::unique_ptr im_ptr(new mapnik::image_rgba8(layer_width,layer_height)); - // actually decode pixels now - try { - image_reader->read(0,0,*im_ptr); - } catch (std::exception const&) { - baton->message = "Could not decode image"; - return; - } - - bool coversWidth = image->x <= 0 && visibleWidth >= baton->width; - bool coversHeight = image->y <= 0 && visibleHeight >= baton->height; - if (!layer_has_alpha && coversWidth && coversHeight && image->tint.is_alpha_identity()) { - // Skip decoding more layers. - alpha = false; - } - - // Convenience aliases. - image->width = layer_width; - image->height = layer_height; - image->im_ptr = std::move(im_ptr); - size++; - - } - - // Now blend images. - int pixels = baton->width * baton->height; - if (pixels <= 0) { - std::ostringstream msg; - msg << "Image dimensions " << baton->width << "x" << baton->height << " are invalid"; - baton->message = msg.str(); - return; - } - - mapnik::image_rgba8 target(baton->width, baton->height); - // When we don't actually have transparent pixels, we don't need to set the matte. - if (alpha) { - target.set(baton->matte); - } - for (auto image_ptr : baton->images) - { - if (image_ptr && image_ptr->im_ptr.get()) - { - Blend_Composite(target.data(), baton, &*image_ptr); - } - } - Blend_Encode(target, baton, alpha); -} - -void Work_AfterBlend(uv_work_t* req) { - NanScope(); - BlendBaton* baton = static_cast(req->data); - - if (!baton->message.length()) { - std::string result = baton->stream.str(); - Local argv[] = { - NanNull(), - NanNewBufferHandle((char *)result.data(), result.length()), - }; - NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 2, argv); - } else { - Local argv[] = { - NanError(baton->message.c_str()) - }; - NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 1, argv); - } - delete baton; -} - -NAN_METHOD(Blend) { - NanScope(); - std::unique_ptr baton(new BlendBaton()); - - Local options; - if (args.Length() == 0 || !args[0]->IsArray()) { - NanThrowTypeError("First argument must be an array of Buffers."); - NanReturnUndefined(); - } else if (args.Length() == 1) { - NanThrowTypeError("Second argument must be a function"); - NanReturnUndefined(); - } else if (args.Length() == 2) { - // No options provided. - if (!args[1]->IsFunction()) { - NanThrowTypeError("Second argument must be a function."); - NanReturnUndefined(); - } - NanAssignPersistent(baton->callback,args[1].As()); - } else if (args.Length() >= 3) { - if (!args[1]->IsObject()) { - NanThrowTypeError("Second argument must be a an options object."); - NanReturnUndefined(); - } - options = Local::Cast(args[1]); - - if (!args[2]->IsFunction()) { - NanThrowTypeError("Third argument must be a function."); - NanReturnUndefined(); - } - NanAssignPersistent(baton->callback,args[2].As()); - } - - // Validate options - if (!options.IsEmpty()) { - baton->quality = options->Get(NanNew("quality"))->Int32Value(); - - Local format_val = options->Get(NanNew("format")); - if (!format_val.IsEmpty() && format_val->IsString()) { - if (strcmp(*String::Utf8Value(format_val), "jpeg") == 0 || - strcmp(*String::Utf8Value(format_val), "jpg") == 0) { - baton->format = BLEND_FORMAT_JPEG; - if (baton->quality == 0) baton->quality = 85; // 85 is same default as mapnik core jpeg - else if (baton->quality < 0 || baton->quality > 100) { - NanThrowTypeError("JPEG quality is range 0-100."); - NanReturnUndefined(); - } - } else if (strcmp(*String::Utf8Value(format_val), "png") == 0) { - if (baton->quality == 1 || baton->quality > 256) { - NanThrowTypeError("PNG images must be quantized between 2 and 256 colors."); - NanReturnUndefined(); - } - } else if (strcmp(*String::Utf8Value(format_val), "webp") == 0) { - baton->format = BLEND_FORMAT_WEBP; - if (baton->quality == 0) baton->quality = 80; - else if (baton->quality < 0 || baton->quality > 100) { - NanThrowTypeError("WebP quality is range 0-100."); - NanReturnUndefined(); - } - } else { - NanThrowTypeError("Invalid output format."); - NanReturnUndefined(); - } - } - - baton->reencode = options->Get(NanNew("reencode"))->BooleanValue(); - baton->width = options->Get(NanNew("width"))->Int32Value(); - baton->height = options->Get(NanNew("height"))->Int32Value(); - - Local matte_val = options->Get(NanNew("matte")); - if (!matte_val.IsEmpty() && matte_val->IsString()) { - if (!hexToUInt32Color(*String::Utf8Value(matte_val->ToString()), baton->matte)) - { - NanThrowTypeError("Invalid batte provided."); - NanReturnUndefined(); - } - - // Make sure we're reencoding in the case of single alpha PNGs - if (baton->matte && !baton->reencode) { - baton->reencode = true; - } - } - - Local palette_val = options->Get(NanNew("palette")); - if (!palette_val.IsEmpty() && palette_val->IsObject()) { - baton->palette = node::ObjectWrap::Unwrap(palette_val->ToObject())->palette(); - } - - Local mode_val = options->Get(NanNew("mode")); - if (!mode_val.IsEmpty() && mode_val->IsString()) { - if (strcmp(*String::Utf8Value(mode_val), "octree") == 0 || - strcmp(*String::Utf8Value(mode_val), "o") == 0) { - baton->mode = BLEND_MODE_OCTREE; - } - else if (strcmp(*String::Utf8Value(mode_val), "hextree") == 0 || - strcmp(*String::Utf8Value(mode_val), "h") == 0) { - baton->mode = BLEND_MODE_HEXTREE; - } - } - - Local encoder_val = options->Get(NanNew("encoder")); - if (!encoder_val.IsEmpty() && encoder_val->IsString()) { - if (strcmp(*String::Utf8Value(encoder_val), "miniz") == 0) { - baton->encoder = BLEND_ENCODER_MINIZ; - } - // default is libpng - } - - if (options->Has(NanNew("compression"))) { - Local compression_val = options->Get(NanNew("compression")); - if (!compression_val.IsEmpty() && compression_val->IsNumber()) - { - baton->compression = compression_val->Int32Value(); - } - else - { - NanThrowTypeError("Compression option must be a number"); - NanReturnUndefined(); - } - } - - int min_compression = Z_NO_COMPRESSION; - int max_compression = Z_BEST_COMPRESSION; - if (baton->format == BLEND_FORMAT_PNG) { - if (baton->compression < 0) baton->compression = Z_DEFAULT_COMPRESSION; - if (baton->encoder == BLEND_ENCODER_MINIZ) max_compression = 10; // MZ_UBER_COMPRESSION - } else if (baton->format == BLEND_FORMAT_WEBP) { - min_compression = 0, max_compression = 6; - if (baton->compression < 0) baton->compression = -1; - } - - if (baton->compression > max_compression) { - std::ostringstream msg; - msg << "Compression level must be between " - << min_compression << " and " << max_compression; - NanThrowTypeError(msg.str().c_str()); - NanReturnUndefined(); - } - } - - Local js_images = Local::Cast(args[0]); - uint32_t length = js_images->Length(); - if (length < 1 && !baton->reencode) { - NanThrowTypeError("First argument must contain at least one Buffer."); - NanReturnUndefined(); - } else if (length == 1 && !baton->reencode) { - Local buffer = js_images->Get(0); - if (Buffer::HasInstance(buffer)) { - // Directly pass through buffer if it's the only one. - Local argv[] = { - NanNull(), - buffer - }; - NanMakeCallback(NanGetCurrentContext()->Global(), NanNew(baton->callback), 2, argv); - NanReturnUndefined(); - } else { - // Check whether the argument is a complex image with offsets etc. - // In that case, we don't throw but continue going through the blend - // process below. - bool valid = false; - if (buffer->IsObject()) { - Local props = buffer->ToObject(); - valid = props->Has(NanNew("buffer")) && - Buffer::HasInstance(props->Get(NanNew("buffer"))); - } - if (!valid) { - NanThrowTypeError("All elements must be Buffers or objects with a 'buffer' property."); - NanReturnUndefined(); - } - } - } - - if (!(length >= 1 || (baton->width > 0 && baton->height > 0))) { - NanThrowTypeError("Without buffers, you have to specify width and height."); - NanReturnUndefined(); - } - - if (baton->width < 0 || baton->height < 0) { - NanThrowTypeError("Image dimensions must be greater than 0."); - NanReturnUndefined(); - } - - for (uint32_t i = 0; i < length; i++) { - ImagePtr image = std::make_shared(); - Local buffer = js_images->Get(i); - if (Buffer::HasInstance(buffer)) { - NanAssignPersistent(image->buffer,buffer.As()); - } else if (buffer->IsObject()) { - Local props = buffer->ToObject(); - if (props->Has(NanNew("buffer"))) { - buffer = props->Get(NanNew("buffer")); - if (Buffer::HasInstance(buffer)) { - NanAssignPersistent(image->buffer,buffer.As()); - } - } - image->x = props->Get(NanNew("x"))->Int32Value(); - image->y = props->Get(NanNew("y"))->Int32Value(); - - Local tint_val = props->Get(NanNew("tint")); - if (!tint_val.IsEmpty() && tint_val->IsObject()) { - Local tint = tint_val->ToObject(); - if (!tint.IsEmpty()) { - baton->reencode = true; - std::string msg; - parseTintOps(tint,image->tint,msg); - if (!msg.empty()) { - NanThrowTypeError(msg.c_str()); - NanReturnUndefined(); - } - } - } - } - - if (image->buffer.IsEmpty()) { - NanThrowTypeError("All elements must be Buffers or objects with a 'buffer' property."); - NanReturnUndefined(); - } - - image->data = node::Buffer::Data(buffer); - image->dataLength = node::Buffer::Length(buffer); - baton->images.push_back(image); - } - - uv_queue_work(uv_default_loop(), &(baton.release())->request, Work_Blend, (uv_after_work_cb)Work_AfterBlend); - - NanReturnUndefined(); -} - -} diff --git a/__tests__/lib/parsers/polyglot.js b/__tests__/lib/parsers/polyglot.js deleted file mode 100644 index 10b268c58..000000000 --- a/__tests__/lib/parsers/polyglot.js +++ /dev/null @@ -1,81 +0,0 @@ -var fs = require('fs'), - path = require('path'), - remark = require('remark'), - polyglot = require('../../../src/parsers/polyglot'); - -test('polyglot', function() { - var file = path.resolve( - path.join(__dirname, '../../fixture/polyglot/blend.cpp') - ); - var result = polyglot({ - file, - source: fs.readFileSync(file, 'utf8') - }); - delete result[0].context.file; - delete result[0].context.sortKey; - expect(result).toEqual([ - { - errors: [], - augments: [], - examples: [], - properties: [], - throws: [], - todos: [], - sees: [], - context: { - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } - }, - description: remark().parse('This method moves a hex to a color'), - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, - name: 'hexToUInt32Color', - params: [ - { - lineNumber: 3, - title: 'param', - name: 'hex', - type: { - name: 'string', - type: 'NameExpression' - } - } - ], - returns: [ - { - title: 'returns', - description: remark().parse('color'), - type: { - name: 'number', - type: 'NameExpression' - } - } - ], - tags: [ - { - description: null, - lineNumber: 2, - name: 'hexToUInt32Color', - title: 'name' - }, - { - description: null, - lineNumber: 3, - name: 'hex', - title: 'param', - type: { - name: 'string', - type: 'NameExpression' - } - }, - { - description: 'color', - lineNumber: 4, - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - } - ] - } - ]); -}); diff --git a/declarations/comment.js b/declarations/comment.js index af0a51bf5..17d2c3e63 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -1,7 +1,6 @@ /* @flow */ /* eslint no-use-before-define: 0 */ type DocumentationConfig = { - polyglot?: boolean, inferPrivate?: string, noPackage?: boolean, toc?: Array, diff --git a/docs/NODE_API.md b/docs/NODE_API.md index 8be51f979..6a1cbe0ad 100644 --- a/docs/NODE_API.md +++ b/docs/NODE_API.md @@ -22,11 +22,8 @@ of lint information intended for human-readable output. - `args.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern that defines what external modules will be whitelisted and included in the generated documentation. - - `args.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse comments with a regex rather than - a proper parser. This enables support of non-JavaScript languages but - reduces documentation's ability to infer structure of code. (optional, default `false`) - `args.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to avoid dependency parsing - even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`) + even in JavaScript code. (optional, default `false`) - `args.inferPrivate` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** a valid regular expression string to infer whether a code element should be private, given its naming structure. For instance, you can specify `inferPrivate: '^_'` to automatically treat @@ -61,11 +58,8 @@ comments, given a root file as a path. - `args.external` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** a string regex / glob match pattern that defines what external modules will be whitelisted and included in the generated documentation. - - `args.polyglot` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** parse comments with a regex rather than - a proper parser. This enables support of non-JavaScript languages but - reduces documentation's ability to infer structure of code. (optional, default `false`) - `args.shallow` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to avoid dependency parsing - even in JavaScript code. With the polyglot option set, this has no effect. (optional, default `false`) + even in JavaScript code. (optional, default `false`) - `args.order` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<([string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))>** optional array that defines sorting order of documentation (optional, default `[]`) - `args.access` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** an array of access levels diff --git a/docs/POLYGLOT.md b/docs/POLYGLOT.md index c2c9373ce..f0005ae0b 100644 --- a/docs/POLYGLOT.md +++ b/docs/POLYGLOT.md @@ -1,39 +1,2 @@ -# About documentation.js, polyglot mode, and file extensions - -Base assumptions: - -* documentation.js subsists on a combination of _source comments_ and - _smart inferences from source code_. -* The default mode of documentation.js is parsing JavaScript, but it has another - mode, called `--polyglot` mode, that doesn't include any inference at all - and lets you document other kinds of source code. -* The default settings for everything should work for most projects, but - this is a guide for if you have a particular setup. - -## File extensions - -Let's talk about file extensions. We have two different flags for controlling -file extensions: `requireExtension` and `parseExtension`. - -* requireExtension adds additional filetypes to the node.js `require()` method. - By default, you can call, for instance, `require('foo')`, and the require algorithm - will look for `foo.js`, `foo` the module, and `foo.json`. Adding another - extension in requireExtension lets it look for `foo.otherextension`. -* parseExtension adds additional filetypes to the list of filetypes documentation.js - thinks it can parse, and it also adds those additional filetypes to the default - files it looks for when you specify a directory or glob as input. - -## Polyglot - -Polyglot mode switches documentation.js from running on babylon and [babel](https://babeljs.io/) -as a JavaScript parser, to using [get-comments](https://github.com/tunnckocore/get-comments). -This lets it grab comments formatted in the `/** Comment */` style from source -code that _isn't_ JavaScript, like C++ or CSS code. - -Since documentation.js doesn't _parse_ C++ and lots of other languages (parsing JavaScript is complicated enough!), -it can't make any of its smart inferences about their source code: it just -takes documentation comments and shows them as-is. - -You _can_ use polyglot mode to turn off inference across the board, but I don't recommend -it. See the 'too much inference' topic in [TROUBLESHOOTING.md](TROUBLESHOOTING.md) -for detail about that. +🚨 Polyglot mode is now deprecated. It will be replaced by a pluggable +input system in future versions. 🚨 diff --git a/docs/USAGE.md b/docs/USAGE.md index 6094961d0..677b15b39 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -30,8 +30,6 @@ Options: documentation. [default: null] --extension, -e only input source files matching this extension will be parsed, this option can be used multiple times. - --polyglot polyglot mode turns off dependency resolution and enables - multi-language support. use this to document c++[boolean] --private, -p generate documentation tagged as private [boolean] [default: false] --access, -a Include only comments with a given access level, out of diff --git a/package.json b/package.json index ad8580741..8c0a9beff 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "concat-stream": "^1.5.0", "disparity": "^2.0.0", "doctrine-temporary-fork": "2.0.0-alpha-allowarrayindex", - "get-comments": "^1.0.1", "get-port": "^3.1.0", "git-url-parse": "^6.0.1", "github-slugger": "1.1.3", diff --git a/src/commands/shared_options.js b/src/commands/shared_options.js index 2ffeb362c..73b1445b8 100644 --- a/src/commands/shared_options.js +++ b/src/commands/shared_options.js @@ -6,8 +6,9 @@ module.exports.sharedInputOptions = { strict: true, shallow: { - describe: 'shallow mode turns off dependency resolution, ' + - 'only processing the specified files (or the main script specified in package.json)', + describe: + 'shallow mode turns off dependency resolution, ' + + 'only processing the specified files (or the main script specified in package.json)', default: false, type: 'boolean' }, @@ -17,19 +18,22 @@ module.exports.sharedInputOptions = { type: 'string' }, 'no-package': { - describe: 'dont find and use package.json for project- configuration option defaults', + describe: + 'dont find and use package.json for project- configuration option defaults', alias: 'np', type: 'boolean', default: false }, external: { - describe: 'a string / glob match pattern that defines which external ' + - 'modules will be whitelisted and included in the generated documentation.', + describe: + 'a string / glob match pattern that defines which external ' + + 'modules will be whitelisted and included in the generated documentation.', default: null }, 'require-extension': { - describe: "additional extensions to include in require() and import's search algorithm." + - 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', + describe: + "additional extensions to include in require() and import's search algorithm." + + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array coerce: (value: string | Array) => [].concat(value), alias: 're' @@ -40,11 +44,6 @@ module.exports.sharedInputOptions = { coerce: (value: string | Array) => [].concat(value), alias: 'pe' }, - polyglot: { - type: 'boolean', - describe: 'polyglot mode turns off dependency resolution and ' + - 'enables multi-language support. use this to document c++' - }, private: { describe: 'generate documentation tagged as private', type: 'boolean', @@ -52,9 +51,10 @@ module.exports.sharedInputOptions = { alias: 'p' }, access: { - describe: 'Include only comments with a given access level, out of private, ' + - 'protected, public, undefined. By default, public, protected, and undefined access ' + - 'levels are included', + describe: + 'Include only comments with a given access level, out of private, ' + + 'protected, public, undefined. By default, public, protected, and undefined access ' + + 'levels are included', choices: ['public', 'private', 'protected', 'undefined'], array: true, alias: 'a' @@ -66,13 +66,15 @@ module.exports.sharedInputOptions = { }, 'infer-private': { type: 'string', - describe: 'Infer private access based on the name. This is a regular expression that ' + - 'is used to match the name' + describe: + 'Infer private access based on the name. This is a regular expression that ' + + 'is used to match the name' }, 'document-exported': { type: 'boolean', - describe: 'Generate documentation for all exported bindings and members ' + - 'even if there is no JSDoc for them', + describe: + 'Generate documentation for all exported bindings and members ' + + 'even if there is no JSDoc for them', default: false }, 'sort-order': { diff --git a/src/index.js b/src/index.js index e06f04986..d8e0b147b 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,6 @@ var fs = require('fs'), dependency = require('./input/dependency'), shallow = require('./input/shallow'), parseJavaScript = require('./parsers/javascript'), - polyglot = require('./parsers/polyglot'), github = require('./github'), hierarchy = require('./hierarchy'), inferName = require('./infer/name'), @@ -69,7 +68,7 @@ function expandInputs(indexes, config) { // Ensure that indexes is an array of strings indexes = [].concat(indexes); - if (config.polyglot || config.shallow || config.documentExported) { + if (config.shallow || config.documentExported) { return shallow(indexes, config); } @@ -84,8 +83,6 @@ function buildInternal(inputsAndConfig) { config.access = ['public', 'undefined', 'protected']; } - var parseFn = config.polyglot ? polyglot : parseJavaScript; - var buildPipeline = pipeline([ inferName, inferAccess(config.inferPrivate), @@ -106,7 +103,7 @@ function buildInternal(inputsAndConfig) { sourceFile.source = fs.readFileSync(sourceFile.file, 'utf8'); } - return parseFn(sourceFile, config).map(buildPipeline); + return parseJavaScript(sourceFile, config).map(buildPipeline); }).filter(Boolean); return filterAccess( @@ -119,8 +116,6 @@ function lintInternal(inputsAndConfig) { let inputs = inputsAndConfig.inputs; let config = inputsAndConfig.config; - let parseFn = config.polyglot ? polyglot : parseJavaScript; - let lintPipeline = pipeline([ lintComments, inferName, @@ -140,7 +135,7 @@ function lintInternal(inputsAndConfig) { sourceFile.source = fs.readFileSync(sourceFile.file, 'utf8'); } - return parseFn(sourceFile, config).map(lintPipeline); + return parseJavaScript(sourceFile, config).map(lintPipeline); }).filter(Boolean); return formatLint(hierarchy(extractedComments)); @@ -156,11 +151,8 @@ function lintInternal(inputsAndConfig) { * @param {Array} args.external a string regex / glob match pattern * that defines what external modules will be whitelisted and included in the * generated documentation. - * @param {boolean} [args.polyglot=false] parse comments with a regex rather than - * a proper parser. This enables support of non-JavaScript languages but - * reduces documentation's ability to infer structure of code. * @param {boolean} [args.shallow=false] whether to avoid dependency parsing - * even in JavaScript code. With the polyglot option set, this has no effect. + * even in JavaScript code. * @param {string} [args.inferPrivate] a valid regular expression string * to infer whether a code element should be private, given its naming structure. * For instance, you can specify `inferPrivate: '^_'` to automatically treat @@ -190,11 +182,8 @@ let lint = (indexes, args) => configure(indexes, args).then(lintInternal); * @param {Array} args.external a string regex / glob match pattern * that defines what external modules will be whitelisted and included in the * generated documentation. - * @param {boolean} [args.polyglot=false] parse comments with a regex rather than - * a proper parser. This enables support of non-JavaScript languages but - * reduces documentation's ability to infer structure of code. * @param {boolean} [args.shallow=false] whether to avoid dependency parsing - * even in JavaScript code. With the polyglot option set, this has no effect. + * even in JavaScript code. * @param {Array} [args.order=[]] optional array that * defines sorting order of documentation * @param {Array} [args.access=[]] an array of access levels diff --git a/src/is_jsdoc_comment.js b/src/is_jsdoc_comment.js index d24fb7a2e..9fd9605f1 100644 --- a/src/is_jsdoc_comment.js +++ b/src/is_jsdoc_comment.js @@ -20,9 +20,6 @@ module.exports = function isJSDocComment( ) { var asterisks = comment.value.match(/^(\*+)/); return ( - (comment.type === 'CommentBlock' || // estree - comment.type === 'Block') && // get-comments / traditional - asterisks && - asterisks[1].length === 1 + comment.type === 'CommentBlock' && asterisks && asterisks[1].length === 1 ); }; diff --git a/src/parsers/polyglot.js b/src/parsers/polyglot.js deleted file mode 100644 index a323972bc..000000000 --- a/src/parsers/polyglot.js +++ /dev/null @@ -1,28 +0,0 @@ -/* @flow */ - -var getComments = require('get-comments'), - _ = require('lodash'), - isJSDocComment = require('../is_jsdoc_comment'), - parse = require('../parse'); - -/** - * Documentation stream parser: this receives a module-dep item, - * reads the file, parses the JavaScript, parses the JSDoc, and - * emits parsed comments. - * @param sourceFile a chunk of data provided by module-deps - * @return {Array} adds to memo - */ -function parsePolyglot(sourceFile: SourceFile) { - return getComments(sourceFile.source, true) - .filter(isJSDocComment) - .map(comment => { - var context = { - loc: _.clone(comment.loc), - file: sourceFile.file, - sortKey: sourceFile.file + ' ' + comment.loc.start.line - }; - return parse(comment.value, comment.loc, context); - }); -} - -module.exports = parsePolyglot; From de4809247434842fc736bb7ff90d351e1d935e4f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 27 Jul 2017 14:02:32 -0400 Subject: [PATCH 083/555] chore(release): 5.0.0 --- CHANGELOG.md | 18 ++++++++++++++++++ package.json | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee3f77036..672e3a6fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [5.0.0](https://github.com/documentationjs/documentation/compare/v4.0.0...v5.0.0) (2017-07-27) + + +### Reverts + +* **polyglot:** Remove polyglot mode ([5b373ff](https://github.com/documentationjs/documentation/commit/5b373ff)), closes [#850](https://github.com/documentationjs/documentation/issues/850) [#731](https://github.com/documentationjs/documentation/issues/731) [#702](https://github.com/documentationjs/documentation/issues/702) [#132](https://github.com/documentationjs/documentation/issues/132) + + +### BREAKING CHANGES + +* **polyglot:** I'd like to still support C++ and other languages in the future! But I'm much +happier doing so by separating the extraction & input phases to the degree that documentation.js can +read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP +support in it. + + + # [4.0.0](https://github.com/documentationjs/documentation/compare/v4.0.0-rc.1...v4.0.0) (2017-07-27) diff --git a/package.json b/package.json index 8c0a9beff..a90b83a76 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "4.0.0", + "version": "5.0.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From edeb80c58239aa5c43ae46f6ea2996e4179160cd Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 00:35:44 -0400 Subject: [PATCH 084/555] chore: Update yarn.lock --- yarn.lock | 963 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 549 insertions(+), 414 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9a919312f..e73b01363 100644 --- a/yarn.lock +++ b/yarn.lock @@ -38,8 +38,12 @@ acorn@^4.0.3, acorn@^4.0.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" acorn@^5.0.1: - version "5.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + version "5.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" + +add-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" ajv-keywords@^1.0.0: version "1.5.1" @@ -97,13 +101,7 @@ ansi-styles@^2.0.1, ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.0.0.tgz#5404e93a544c4fec7f048262977bebfe3155e0c1" - dependencies: - color-convert "^1.0.0" - -ansi-styles@^3.1.0: +ansi-styles@^3.0.0, ansi-styles@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: @@ -160,8 +158,8 @@ arr-diff@^4.0.0: resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" arr-flatten@^1.0.1, arr-flatten@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" arr-union@^3.1.0: version "3.1.0" @@ -180,10 +178,8 @@ array-ify@^1.0.0: resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" array-iterate@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.0.tgz#4f13148ffffa5f2756b50460e5eac8eed31a14e6" - dependencies: - has "^1.0.1" + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-iterate/-/array-iterate-1.1.1.tgz#865bf7f8af39d6b0982c60902914ac76bc0108f6" array-union@^1.0.1: version "1.0.2" @@ -223,13 +219,13 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async@^1.4.0: +async@^1.4.0, async@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.4.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7" + version "2.5.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" dependencies: lodash "^4.14.0" @@ -279,19 +275,19 @@ babel-code-frame@^6.22.0: js-tokens "^3.0.0" babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.25.0.tgz#7dd42b0463c742e9d5296deb3ec67a9322dad729" dependencies: babel-code-frame "^6.22.0" - babel-generator "^6.24.1" + babel-generator "^6.25.0" babel-helpers "^6.24.1" babel-messages "^6.23.0" babel-register "^6.24.1" babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babylon "^6.11.0" + babel-template "^6.25.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" convert-source-map "^1.1.0" debug "^2.1.1" json5 "^0.5.0" @@ -311,7 +307,7 @@ babel-eslint@^7.2.3: babel-types "^6.23.0" babylon "^6.17.0" -babel-generator@6.25.0: +babel-generator@6.25.0, babel-generator@^6.18.0, babel-generator@^6.25.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" dependencies: @@ -324,19 +320,6 @@ babel-generator@6.25.0: source-map "^0.5.0" trim-right "^1.0.1" -babel-generator@^6.18.0, babel-generator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" - babel-helper-bindify-decorators@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz#14c19e5f142d7b47f19a52431e52b1ccbc40a330" @@ -820,8 +803,8 @@ babel-plugin-transform-object-rest-spread@^6.22.0: babel-runtime "^6.22.0" babel-plugin-transform-react-display-name@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.23.0.tgz#4398910c358441dc4cef18787264d0412ed36b37" + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz#67e2bf1f1e9c93ab08db96792e05392bf2cc28d1" dependencies: babel-runtime "^6.22.0" @@ -968,46 +951,37 @@ babel-register@^6.24.1: source-map-support "^0.4.2" babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.3.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0, babel-template@^6.3.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" dependencies: babel-runtime "^6.22.0" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - babylon "^6.11.0" + babel-traverse "^6.25.0" + babel-types "^6.25.0" + babylon "^6.17.2" lodash "^4.2.0" -babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" dependencies: babel-code-frame "^6.22.0" babel-messages "^6.23.0" babel-runtime "^6.22.0" - babel-types "^6.24.1" - babylon "^6.15.0" + babel-types "^6.25.0" + babylon "^6.17.2" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" - dependencies: - babel-runtime "^6.22.0" - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - -babel-types@^6.25.0: +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25.0: version "6.25.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" dependencies: @@ -1023,17 +997,17 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0, babylon@^6.17.2: - version "6.17.2" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.2.tgz#201d25ef5f892c41bae49488b08db0dd476e9f5c" +babylon@^6.17.0, babylon@^6.17.2, babylon@^6.17.4: + version "6.17.4" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" bail@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.1.tgz#912579de8b391aadf3c5fdf4cd2a0fc225df3bc2" + version "1.0.2" + resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.2.tgz#f7d6c1731630a9f9f0d4d35ed1f962e2074a1764" -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" base@^0.11.1: version "0.11.1" @@ -1056,8 +1030,8 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" binary-extensions@^1.0.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" + version "1.9.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.9.0.tgz#66506c16ce6f4d6928a5b3cd6a33ca41e941e37b" block-stream@*: version "0.0.9" @@ -1081,10 +1055,10 @@ boom@2.x.x: hoek "2.x.x" brace-expansion@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: - balanced-match "^0.4.1" + balanced-match "^1.0.0" concat-map "0.0.1" braces@^1.8.2: @@ -1137,6 +1111,10 @@ builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +byline@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + bytes@1: version "1.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" @@ -1202,8 +1180,8 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" ccount@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.1.tgz#665687945168c218ec77ff61a4155ae00227a96c" + version "1.0.2" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.2.tgz#53b6a2f815bb77b9c2871f7b9a72c3a25f1d8e89" center-align@^0.1.1: version "0.1.3" @@ -1231,20 +1209,20 @@ chalk@^2.0.0: supports-color "^4.0.0" character-entities-html4@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.0.tgz#1ab08551d3ce1fa1df08d00fb9ca1defb147a06c" + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.1.tgz#359a2a4a0f7e29d3dc2ac99bdbe21ee39438ea50" character-entities-legacy@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.0.tgz#b18aad98f6b7bcc646c1e4c81f9f1956376a561a" + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.1.tgz#f40779df1a101872bb510a3d295e1fccf147202f" character-entities@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.0.tgz#a683e2cf75dbe8b171963531364e58e18a1b155f" + version "1.2.1" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.1.tgz#f76871be5ef66ddb7f8f8e3478ecc374c27d6dca" character-reference-invalid@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.0.tgz#dec9ad1dfb9f8d06b4fcdaa2adc3c4fd97af1e68" + version "1.1.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.1.tgz#942835f750e4ec61a308e60c2ef8cc1011202efc" chdir@0.0.0: version "0.0.0" @@ -1270,8 +1248,8 @@ ci-info@^1.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" circular-json@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" class-utils@^0.3.4: version "0.3.5" @@ -1338,10 +1316,14 @@ clone-stats@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" -clone@^1.0.0: +clone@^1.0.0, clone@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" +clone@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" + cloneable-readable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117" @@ -1350,6 +1332,13 @@ cloneable-readable@^1.0.0: process-nextick-args "^1.0.6" through2 "^2.0.1" +cmd-shim@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + dependencies: + graceful-fs "^4.1.2" + mkdirp "~0.5.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1359,8 +1348,8 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" collapse-white-space@^1.0.0, collapse-white-space@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.2.tgz#9c463fb9c6d190d2dcae21a356a01bcae9eeef6d" + version "1.0.3" + resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.3.tgz#4b906f670e5a963a87b76b0e1689643341b6023c" collection-visit@^0.2.1: version "0.2.3" @@ -1370,15 +1359,22 @@ collection-visit@^0.2.1: map-visit "^0.1.5" object-visit "^0.3.4" -color-convert@^1.0.0, color-convert@^1.9.0: +color-convert@^1.9.0: version "1.9.0" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" dependencies: color-name "^1.1.1" color-name@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +columnify@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + dependencies: + strip-ansi "^3.0.0" + wcwidth "^1.0.0" combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" @@ -1387,16 +1383,18 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: delayed-stream "~1.0.0" comma-separated-tokens@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.3.tgz#6eb01f4730bde7a7fce5d5e2d943bdd637272801" + version "1.0.4" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.4.tgz#72083e58d4a462f01866f6617f4d98a3cd3b8a46" dependencies: trim "0.0.1" +command-join@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/command-join/-/command-join-2.0.0.tgz#52e8b984f4872d952ff1bdc8b98397d27c7144cf" + commander@^2.8.1, commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" compare-func@^1.3.1: version "1.3.2" @@ -1442,19 +1440,30 @@ continuable-cache@^0.3.1: resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" conventional-changelog-angular@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.3.4.tgz#7d7cdfbd358948312904d02229a61fd6075cf455" + version "1.4.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.4.0.tgz#118b9f7d41a3d99500bfb6bea1f3525e055e8b9b" dependencies: compare-func "^1.3.1" github-url-from-git "^1.4.0" q "^1.4.1" + read-pkg-up "^2.0.0" conventional-changelog-atom@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.1.0.tgz#67a47c66a42b2f8909ef1587c9989ae1de730b92" + version "0.1.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.1.1.tgz#d40a9b297961b53c745e5d1718fd1a3379f6a92f" dependencies: q "^1.4.1" +conventional-changelog-cli@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.2.tgz#33abf2b5720a9b094df38e81741ccb502e1a4125" + dependencies: + add-stream "^1.0.0" + conventional-changelog "^1.1.4" + lodash "^4.1.0" + meow "^3.7.0" + tempfile "^1.1.1" + conventional-changelog-codemirror@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.1.0.tgz#7577a591dbf9b538e7a150a7ee62f65a2872b334" @@ -1531,7 +1540,7 @@ conventional-changelog-writer@^1.1.0: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.0: +conventional-changelog@^1.1.0, conventional-changelog@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.4.tgz#108bc750c2a317e200e2f9b413caaa1f8c7efa3b" dependencies: @@ -1547,8 +1556,8 @@ conventional-changelog@^1.1.0: conventional-changelog-jshint "^0.1.0" conventional-commit-types@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.1.0.tgz#45d860386c9a2e6537ee91d8a1b61bd0411b3d04" + version "2.2.0" + resolved "https://registry.yarnpkg.com/conventional-commit-types/-/conventional-commit-types-2.2.0.tgz#5db95739d6c212acbe7b6f656a11b940baa68946" conventional-commits-filter@^1.0.0: version "1.0.0" @@ -1557,7 +1566,7 @@ conventional-commits-filter@^1.0.0: is-subset "^0.1.1" modify-values "^1.0.0" -conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1: +conventional-commits-parser@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-1.3.0.tgz#e327b53194e1a7ad5dc63479ee9099a52b024865" dependencies: @@ -1569,15 +1578,27 @@ conventional-commits-parser@^1.0.0, conventional-commits-parser@^1.0.1: through2 "^2.0.0" trim-off-newlines "^1.0.0" +conventional-commits-parser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.0.0.tgz#71d01910cb0a99aeb20c144e50f81f4df3178447" + dependencies: + JSONStream "^1.0.4" + is-text-path "^1.0.0" + lodash "^4.2.1" + meow "^3.3.0" + split2 "^2.0.0" + through2 "^2.0.0" + trim-off-newlines "^1.0.0" + conventional-recommended-bump@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.0.0.tgz#6d303a27837ae938b7c68c8ddeed34559b4b0789" + version "1.0.1" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.0.1.tgz#56b8ae553a8a1152fa069e767599e1f6948bd36c" dependencies: concat-stream "^1.4.10" conventional-commits-filter "^1.0.0" - conventional-commits-parser "^1.0.1" + conventional-commits-parser "^2.0.0" git-raw-commits "^1.2.0" - git-semver-tags "^1.2.0" + git-semver-tags "^1.2.1" meow "^3.3.0" object-assign "^4.0.1" @@ -1620,13 +1641,6 @@ coveralls@^2.13.1: minimist "1.2.0" request "2.79.0" -cross-spawn@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1691,22 +1705,20 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8: +debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8, debug@~2.6.7: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: ms "2.0.0" -debug@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" - dependencies: - ms "0.7.1" - decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1721,6 +1733,12 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +defaults@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + dependencies: + clone "^1.0.2" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -1769,6 +1787,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + detective@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" @@ -1781,8 +1803,8 @@ diff@^1.3.2: resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" diff@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + version "3.3.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.0.tgz#056695150d7aa93237ca7e378ac3b1682b7963b9" disparity@^2.0.0: version "2.0.0" @@ -1815,16 +1837,16 @@ dot-prop@^3.0.0: dependencies: is-obj "^1.0.0" -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - duplexer2@^0.1.2, duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" dependencies: readable-stream "^2.0.2" +duplexer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + duplexify@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" @@ -1854,7 +1876,7 @@ end-of-stream@1.0.0: dependencies: once "~1.3.0" -"errno@>=0.1.1 <0.2.0-0": +errno@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" dependencies: @@ -1959,9 +1981,9 @@ esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" esquery@^1.0.0: version "1.0.0" @@ -1970,24 +1992,20 @@ esquery@^1.0.0: estraverse "^4.0.0" esrecurse@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" dependencies: - estraverse "~4.1.0" + estraverse "^4.1.0" object-assign "^4.0.1" estraverse@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" -estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -estraverse@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" - esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1998,12 +2016,12 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" -execa@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" +execa@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" dependencies: - cross-spawn "^4.0.0" - get-stream "^2.2.0" + cross-spawn "^5.0.1" + get-stream "^3.0.0" is-stream "^1.1.0" npm-run-path "^2.0.0" p-finally "^1.0.0" @@ -2231,6 +2249,14 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" +fs-extra@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^3.0.0" + universalify "^0.1.0" + fs-extra@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e" @@ -2248,11 +2274,11 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" fsevents@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.1.tgz#f19fd28f43eeaf761680e519a203c4d0b3d31aff" + version "1.1.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" dependencies: nan "^2.3.0" - node-pre-gyp "^0.6.29" + node-pre-gyp "^0.6.36" fstream-ignore@^1.0.5: version "1.0.5" @@ -2271,10 +2297,6 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" -function-bind@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" - functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -2306,13 +2328,9 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-comments@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/get-comments/-/get-comments-1.0.1.tgz#196759101bbbc4facf13060caaedd4870dee55be" - get-pkg-repo@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.3.0.tgz#43c6b4c048b75dd604fc5388edecde557f6335df" + version "1.4.0" + resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" dependencies: hosted-git-info "^2.1.4" meow "^3.3.0" @@ -2332,13 +2350,6 @@ get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" - get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -2370,9 +2381,9 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.0.tgz#b31fd02c8ab578bd6c9b5cacca5e1c64c1177ac1" +git-semver-tags@^1.2.0, git-semver-tags@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.1.tgz#6ccd2a52e735b736748dc762444fcd9588e27490" dependencies: meow "^3.3.0" semver "^5.0.1" @@ -2475,8 +2486,8 @@ globals-docs@^2.3.0: resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.3.0.tgz#dca4088af196f7800f4eba783eaeff335cb6759c" globals@^9.0.0, globals@^9.17.0: - version "9.17.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" globby@^5.0.0: version "5.0.0" @@ -2489,14 +2500,20 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globby@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -2571,30 +2588,22 @@ has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" -has@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" - dependencies: - function-bind "^1.0.2" - hast-util-is-element@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.0.tgz#3f7216978b2ae14d98749878782675f33be3ce00" hast-util-sanitize@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.1.0.tgz#9b4bc3731043fe92e1253a9a4ca7bcc4148d06f2" + version "1.1.1" + resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-1.1.1.tgz#c439852d9db7ff554ecd6be96435a6a8274ade32" dependencies: - has "^1.0.1" xtend "^4.0.1" hast-util-to-html@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-3.0.0.tgz#19a257cd7af464777c1cccf4d2d53d33147466c1" + version "3.1.0" + resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-3.1.0.tgz#882c99849e40130e991c042e456d453d95c36cff" dependencies: ccount "^1.0.0" comma-separated-tokens "^1.0.1" - has "^1.0.1" hast-util-is-element "^1.0.0" hast-util-whitespace "^1.0.0" html-void-elements "^1.0.0" @@ -2634,8 +2643,8 @@ home-or-tmp@^2.0.0: os-tmpdir "^1.0.1" hosted-git-info@^2.1.4: - version "2.4.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" html-encoding-sniffer@^1.0.1: version "1.0.1" @@ -2644,8 +2653,8 @@ html-encoding-sniffer@^1.0.1: whatwg-encoding "^1.0.1" html-void-elements@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.1.tgz#f929bea267a19e3535950502ca12c159f1b559af" + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.2.tgz#9d22e0ca32acc95b3f45b8d5b4f6fbdc05affd55" http-signature@~1.1.0: version "1.1.1" @@ -2686,8 +2695,8 @@ indent-string@^2.1.0: repeating "^2.0.0" indent-string@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" inflight@^1.0.4: version "1.0.6" @@ -2696,7 +2705,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2751,16 +2760,16 @@ is-accessor-descriptor@^0.1.6: kind-of "^3.0.2" is-alphabetical@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.0.tgz#e2544c13058255f2144cb757066cd3342a1c8c46" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.1.tgz#c77079cc91d4efac775be1034bf2d243f95e6f08" is-alphanumeric@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4" is-alphanumerical@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.0.tgz#e06492e719c1bf15dec239e4f1af5f67b4d6e7bf" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.1.tgz#dfb4aa4d1085e33bdb61c2dee9c80e9c6c19f53b" dependencies: is-alphabetical "^1.0.0" is-decimal "^1.0.0" @@ -2798,26 +2807,24 @@ is-data-descriptor@^0.1.4: kind-of "^3.0.2" is-decimal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.0.tgz#940579b6ea63c628080a69e62bda88c8470b4fe0" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.1.tgz#f5fb6a94996ad9e8e3761fbfbd091f1fca8c4e82" is-descriptor@^0.1.0: - version "0.1.5" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.5.tgz#e3fb8b4ab65f3a37373388e18b401d78c58cbea7" + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" - kind-of "^3.0.2" - lazy-cache "^2.0.2" + kind-of "^5.0.0" is-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.0.tgz#d6ec686f238f6b02f23757abe12cf6b2ea2790f9" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.1.tgz#2c6023599bde2de9d5d2c8b9a9d94082036b6ef2" dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" - kind-of "^3.0.2" - lazy-cache "^2.0.2" + kind-of "^5.0.0" is-dotfile@^1.0.0: version "1.0.3" @@ -2870,8 +2877,8 @@ is-glob@^3.1.0: is-extglob "^2.1.0" is-hexadecimal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.0.tgz#5c459771d2af9a2e3952781fd54fcb1bcfe4113c" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" is-my-json-valid@^2.12.4: version "2.16.0" @@ -2882,7 +2889,7 @@ is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" -is-number@^2.0.2, is-number@^2.1.0: +is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" dependencies: @@ -2920,15 +2927,15 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-obj@^1.1.0: +is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" is-plain-object@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.3.tgz#c15bf3e4b66b62d72efaf2925848663ecbc619b6" + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" dependencies: - isobject "^3.0.0" + isobject "^3.0.1" is-posix-bracket@^0.1.0: version "0.1.1" @@ -2997,16 +3004,16 @@ is-valid-glob@^0.3.0: resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" is-whitespace-character@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.0.tgz#bbf4a83764ead0d451bec2a55218e91961adc275" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.1.tgz#9ae0176f3282b65457a1992cdb084f8a5f833e3b" is-windows@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" is-word-character@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.0.tgz#a3a9e5ddad70c5c2ee36f4a9cfc9a53f44535247" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.1.tgz#5a03fa1ea91ace8a6eb0c7cd770eb86d65c8befb" isarray@0.0.1: version "0.0.1" @@ -3026,23 +3033,23 @@ isobject@^2.0.0, isobject@^2.1.0: dependencies: isarray "1.0.0" -isobject@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.0.tgz#39565217f3661789e8a0a0c080d5f7e6bc46e1a0" +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" istanbul-api@^1.1.1: - version "1.1.9" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.9.tgz#2827920d380d4286d857d57a2968a841db8a7ec8" + version "1.1.11" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.11.tgz#fcc0b461e2b3bda71e305155138238768257d9de" dependencies: async "^2.1.4" fileset "^2.0.2" istanbul-lib-coverage "^1.1.1" istanbul-lib-hook "^1.0.7" - istanbul-lib-instrument "^1.7.2" + istanbul-lib-instrument "^1.7.4" istanbul-lib-report "^1.1.1" istanbul-lib-source-maps "^1.2.1" istanbul-reports "^1.1.1" @@ -3060,15 +3067,15 @@ istanbul-lib-hook@^1.0.7: dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" +istanbul-lib-instrument@^1.4.2, istanbul-lib-instrument@^1.7.2, istanbul-lib-instrument@^1.7.4: + version "1.7.4" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.4.tgz#e9fd920e4767f3d19edc765e2d6b3f5ccbd0eea8" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" - babylon "^6.13.0" + babylon "^6.17.4" istanbul-lib-coverage "^1.1.1" semver "^5.3.0" @@ -3180,8 +3187,8 @@ jest-environment-node@^20.0.3: jest-util "^20.0.3" jest-haste-map@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.4.tgz#653eb55c889ce3c021f7b94693f20a4159badf03" + version "20.0.5" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.5.tgz#abad74efb1a005974a7b6517e11010709cab9112" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" @@ -3308,15 +3315,9 @@ jest@^20.0.4: dependencies: jest-cli "^20.0.4" -jodid25519@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" - dependencies: - jsbn "~0.1.0" - js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" js-yaml@3.6.1: version "3.6.1" @@ -3326,11 +3327,11 @@ js-yaml@3.6.1: esprima "^2.6.0" js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4: - version "3.8.4" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" + version "3.9.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" dependencies: argparse "^1.0.7" - esprima "^3.1.1" + esprima "^4.0.0" jsbn@~0.1.0: version "0.1.1" @@ -3395,8 +3396,8 @@ json5@^0.5.0: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" jsonfile@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.0.tgz#92e7c7444e5ffd5fa32e6a9ae8b85034df8347d0" + version "3.0.1" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" optionalDependencies: graceful-fs "^4.1.6" @@ -3437,6 +3438,10 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" +kind-of@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.0.0.tgz#9038420f740b2e836ce48b34617bcb855947f2a9" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -3463,6 +3468,46 @@ lcov-parse@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" +lerna@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-2.0.0.tgz#49a72fe70e06aebfd7ea23efb2ab41abe60ebeea" + dependencies: + async "^1.5.0" + chalk "^1.1.1" + cmd-shim "^2.0.2" + columnify "^1.5.4" + command-join "^2.0.0" + conventional-changelog-cli "^1.3.1" + conventional-recommended-bump "^1.0.0" + dedent "^0.7.0" + execa "^0.6.3" + find-up "^2.1.0" + fs-extra "^3.0.1" + get-port "^3.1.0" + glob "^7.1.2" + globby "^6.1.0" + graceful-fs "^4.1.11" + inquirer "^3.0.6" + is-ci "^1.0.10" + load-json-file "^2.0.0" + lodash "^4.17.4" + minimatch "^3.0.4" + npmlog "^4.1.0" + p-finally "^1.0.0" + path-exists "^3.0.0" + read-cmd-shim "^1.0.1" + read-pkg "^2.0.0" + rimraf "^2.6.1" + safe-buffer "^5.0.1" + semver "^5.1.0" + signal-exit "^3.0.2" + strong-log-transformer "^1.0.6" + temp-write "^3.3.0" + write-file-atomic "^2.1.0" + write-json-file "^2.1.0" + write-pkg "^3.0.1" + yargs "^8.0.1" + leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3594,7 +3639,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.1.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3637,11 +3682,17 @@ loud-rejection@^1.0.0: signal-exit "^3.0.0" lru-cache@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e" + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +make-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" dependencies: - pseudomap "^1.0.1" - yallist "^2.0.0" + pify "^2.3.0" makeerror@1.0.x: version "1.0.11" @@ -3665,25 +3716,24 @@ map-visit@^0.1.5: object-visit "^0.3.4" markdown-escapes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.0.tgz#c8ca19f1d94d682459e0a93c86db27a7ef716b23" + version "1.0.1" + resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.1.tgz#1994df2d3af4811de59a6714934c2b2292734518" markdown-table@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.0.tgz#1f5ae61659ced8808d882554c32e8b3f38dd1143" + version "1.1.1" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.1.tgz#4b3dd3a133d1518b8ef0dbc709bf2a1b4824bc8c" mdast-util-compact@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.0.tgz#4c94dedfe35932d5457f29b650b330fdc73e994a" + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz#cdb5f84e2b6a2d3114df33bd05d9cb32e3c4083a" dependencies: unist-util-modify-children "^1.0.0" unist-util-visit "^1.1.0" mdast-util-definitions@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.0.tgz#00f67b4289ed36bafc0977b558414ac0c5023b24" + version "1.2.2" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.2.tgz#673f4377c3e23d3de7af7a4fe2214c0e221c5ac7" dependencies: - has "^1.0.1" unist-util-visit "^1.0.0" mdast-util-inject@^1.1.0: @@ -3693,12 +3743,11 @@ mdast-util-inject@^1.1.0: mdast-util-to-string "^1.0.0" mdast-util-to-hast@^2.1.1: - version "2.4.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.4.0.tgz#63ce8e43c61d8e5728954a3515e0c936a3b26cea" + version "2.4.2" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.4.2.tgz#f116e8bf3da772ba5a397a92dab090f5ba91caa0" dependencies: collapse-white-space "^1.0.0" detab "^2.0.0" - has "^1.0.1" mdast-util-definitions "^1.2.0" normalize-uri "^1.0.0" trim "0.0.1" @@ -3710,8 +3759,8 @@ mdast-util-to-hast@^2.1.1: xtend "^4.0.1" mdast-util-to-string@^1.0.0, mdast-util-to-string@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.0.2.tgz#dc996a24d2b521178d3fac3993680c03a683e1dd" + version "1.0.4" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.0.4.tgz#5c455c878c9355f0c1e7f3e8b719cf583691acfb" mdast-util-toc@^2.0.0: version "2.0.1" @@ -3727,7 +3776,7 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -meow@^3.3.0: +meow@^3.3.0, meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -3771,8 +3820,8 @@ micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: regex-cache "^0.4.2" micromatch@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.0.3.tgz#af3339640157ddad39b81a09956d8877cc4b421a" + version "3.0.4" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.0.4.tgz#1543f1d04813447ac852001c5f5a933401786d1d" dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -3788,15 +3837,15 @@ micromatch@^3.0.0: snapdragon "^0.8.1" to-regex "^3.0.1" -mime-db@~1.27.0: - version "1.27.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.27.0.tgz#820f572296bbd20ec25ed55e5b5de869e5436eb1" +mime-db@~1.29.0: + version "1.29.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.29.0.tgz#48d26d235589651704ac5916ca06001914266878" mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.15" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.15.tgz#a4ebf5064094569237b8cf70046776d09fc92aed" + version "2.1.16" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.16.tgz#2b858a52e5ecd516db897ac2be87487830698e23" dependencies: - mime-db "~1.27.0" + mime-db "~1.29.0" mime@^1.3.4: version "1.3.6" @@ -3820,6 +3869,10 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minimist@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" + mixin-deep@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.2.0.tgz#d02b8c6f8b6d4b8f5982d3fd009c4919851c3fe2" @@ -3827,15 +3880,15 @@ mixin-deep@^1.1.3: for-in "^1.0.2" is-extendable "^0.1.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" mock-fs@^4.2.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.3.0.tgz#c2fab8d784283287e9b6ae7538f2dc56c1a05ed7" + version "4.4.1" + resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.4.1.tgz#f285fa025b42a4031faf75b66f632b21e7056683" modify-values@^1.0.0: version "1.0.0" @@ -3860,9 +3913,9 @@ module-deps-sortable@4.0.6: through2 "^2.0.0" xtend "^4.0.0" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" +moment@^2.6.0: + version "2.18.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" ms@2.0.0: version "2.0.0" @@ -3910,7 +3963,7 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" -node-pre-gyp@^0.6.29: +node-pre-gyp@^0.6.36: version "0.6.36" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" dependencies: @@ -3932,8 +3985,8 @@ nopt@^4.0.1: osenv "^0.1.4" normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5: - version "2.3.8" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -3974,9 +4027,9 @@ npm-which@^3.0.1: npm-path "^2.0.2" which "^1.2.10" -npmlog@^4.0.2: - version "4.1.0" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.0.tgz#dc59bee85f64f00ed424efb2af0783df25d1c0b5" +npmlog@^4.0.2, npmlog@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -3992,8 +4045,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf" + version "1.4.1" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.1.tgz#7ae9b07b0ea804db7e25f05cb5fe4097d4e4949f" oauth-sign@~0.8.1: version "0.8.2" @@ -4097,10 +4150,10 @@ os-locale@^1.4.0: lcid "^1.0.0" os-locale@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" dependencies: - execa "^0.5.0" + execa "^0.7.0" lcid "^1.0.0" mem "^1.1.0" @@ -4124,8 +4177,8 @@ output-file-sync@^1.1.0: object-assign "^4.1.0" p-event@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.2.0.tgz#837cfbeb652e497922f22162fb1f4c8487e27173" + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.3.0.tgz#8e6b4f4f65c72bc5b6fe28b75eda874f96a4a085" dependencies: p-timeout "^1.1.1" @@ -4148,8 +4201,10 @@ p-map@^1.1.1: resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" p-timeout@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.1.1.tgz#d28e9fdf96e328886fbff078f886ad158c53bf6d" + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-1.2.0.tgz#9820f99434c5817868b4f34809ee5291660d5b6c" + dependencies: + p-finally "^1.0.0" pad-right@^0.2.2: version "0.2.2" @@ -4164,13 +4219,12 @@ parents@^1.0.0: path-platform "~0.11.15" parse-entities@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.0.tgz#4bc58f35fdc8e65dded35a12f2e40223ca24a3f7" + version "1.1.1" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.1.1.tgz#8112d88471319f27abae4d64964b122fe4e1b890" dependencies: character-entities "^1.0.0" character-entities-legacy "^1.0.0" character-reference-invalid "^1.0.0" - has "^1.0.1" is-alphanumerical "^1.0.0" is-decimal "^1.0.0" is-hexadecimal "^1.0.0" @@ -4209,8 +4263,8 @@ parse-json@^2.2.0: error-ex "^1.2.0" parse-url@^1.3.0: - version "1.3.7" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.7.tgz#636cb6e32b88255c704e30ab4349676703267af8" + version "1.3.11" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.11.tgz#57c15428ab8a892b1f43869645c711d0e144b554" dependencies: is-ssh "^1.3.0" protocols "^1.4.0" @@ -4285,7 +4339,7 @@ performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" -pify@^2.0.0, pify@^2.3.0: +pify@^2.0.0, pify@^2.2.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -4320,8 +4374,8 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" prettier@^1.0.0: - version "1.4.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.2.tgz#bcdd95ed1eca434ac7f98ca26ea4d25a2af6a2ac" + version "1.5.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.3.tgz#59dadc683345ec6b88f88b94ed4ae7e1da394bfe" pretty-format@^20.0.3: version "20.0.3" @@ -4343,8 +4397,8 @@ progress@^2.0.0: resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" property-information@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.1.0.tgz#1581bf8a445dfbfef759775a86700e8dda18b4a1" + version "3.2.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-3.2.0.tgz#fd1483c8fbac61808f5fe359e7693a1f48a58331" protocols@^1.1.0, protocols@^1.4.0: version "1.4.5" @@ -4354,7 +4408,7 @@ prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" -pseudomap@^1.0.1: +pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -4366,20 +4420,24 @@ q@^1.4.1: version "1.5.0" resolved "https://registry.yarnpkg.com/q/-/q-1.5.0.tgz#dd01bac9d06d30e6f219aecb8253ee9ebdc308f1" -qs@^6.4.0, qs@~6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +qs@^6.4.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.0.tgz#8d04954d364def3efc55b5a0793e1e2c8b1e6e49" qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" +qs@~6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" + randomatic@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.6.tgz#110dcabff397e9dcff7c0789ccc0a49adf1ec5bb" + version "1.1.7" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" dependencies: - is-number "^2.0.2" - kind-of "^3.0.2" + is-number "^3.0.0" + kind-of "^4.0.0" raw-body@~1.1.0: version "1.1.7" @@ -4397,6 +4455,12 @@ rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-cmd-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + dependencies: + graceful-fs "^4.1.2" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -4437,15 +4501,15 @@ read-pkg@^2.0.0: string_decoder "~0.10.x" readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: - version "2.2.10" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.10.tgz#effe72bb7c884c0dd335e2379d526196d9d011ee" + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" dependencies: core-util-is "~1.0.0" - inherits "~2.0.1" + inherits "~2.0.3" isarray "~1.0.0" process-nextick-args "~1.0.6" - safe-buffer "^5.0.1" - string_decoder "~1.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" util-deprecate "~1.0.1" readable-stream@~2.0.0: @@ -4574,8 +4638,8 @@ remark-parse@^4.0.0: xtend "^4.0.1" remark-slug@^4.0.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-4.2.2.tgz#3cfaa02e2e24d98405b296072f2ebbdfad279eb6" + version "4.2.3" + resolved "https://registry.yarnpkg.com/remark-slug/-/remark-slug-4.2.3.tgz#8d987d0e5e63d4a49ea37b90fe999a3dcfc81b72" dependencies: github-slugger "^1.0.0" mdast-util-to-string "^1.0.0" @@ -4601,8 +4665,8 @@ remark-stringify@^4.0.0: xtend "^4.0.1" remark-toc@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/remark-toc/-/remark-toc-4.0.0.tgz#1e99867a1bee1caebb8fa1d9f5f7605fdf7d8c56" + version "4.0.1" + resolved "https://registry.yarnpkg.com/remark-toc/-/remark-toc-4.0.1.tgz#ff36ff6de54ea07dd59e3f5334a4a3aac1e93185" dependencies: mdast-util-toc "^2.0.0" remark-slug "^4.0.0" @@ -4622,8 +4686,8 @@ remote-origin-url@0.4.0: parse-git-config "^0.2.0" remove-trailing-separator@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4" + version "1.0.2" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" repeat-element@^1.1.2: version "1.1.2" @@ -4731,8 +4795,8 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" resolve@^1.1.3, resolve@^1.1.6, resolve@^1.3.2: - version "1.3.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" dependencies: path-parse "^1.0.5" @@ -4783,14 +4847,14 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" rxjs@^5.0.0-beta.11: - version "5.4.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.0.tgz#a7db14ab157f9d7aac6a56e655e7a3860d39bf26" + version "5.4.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.2.tgz#2a3236fcbf03df57bae06fd6972fd99e5c08fcf7" dependencies: symbol-observable "^1.0.1" -safe-buffer@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223" +safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" safe-json-parse@~1.0.1: version "1.0.1" @@ -4809,12 +4873,12 @@ sane@~1.6.0: watch "~0.10.0" sax@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" "semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -4850,8 +4914,8 @@ shebang-regex@^1.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" shelljs@^0.7.5: - version "0.7.7" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" + version "0.7.8" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" dependencies: glob "^7.0.0" interpret "^1.0.0" @@ -4873,17 +4937,21 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +slide@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + snapdragon-node@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.0.1.tgz#3b485cef2a6d55dfaeb52641a8388c6ea81cbea2" + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" dependencies: define-property "^1.0.0" isobject "^3.0.0" - snapdragon-util "^3.0.0" + snapdragon-util "^3.0.1" -snapdragon-util@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.0.tgz#0ac6288d8409e45d04fd1034e0bb745701cae9c0" +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" dependencies: kind-of "^3.2.0" @@ -4906,6 +4974,18 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sort-keys@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + source-map-resolve@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.0.tgz#fcad0b64b70afb27699e425950cb5ebcd410bc20" @@ -4942,8 +5022,8 @@ source-map@~0.2.0: amdefine ">=0.0.4" space-separated-tokens@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.0.tgz#9e8c60407aa527742cd9eaee2541dec639f1269b" + version "1.1.1" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.1.tgz#9695b9df9e65aec1811d4c3f9ce52520bc2f7e4d" dependencies: trim "0.0.1" @@ -4984,8 +5064,8 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" sshpk@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.0.tgz#ff2a3e4fd04497555fed97b39a0fd82fafb3a33c" + version "1.13.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -4994,7 +5074,6 @@ sshpk@^1.7.0: optionalDependencies: bcrypt-pbkdf "^1.0.0" ecc-jsbn "~0.1.1" - jodid25519 "^1.0.0" jsbn "~0.1.0" tweetnacl "~0.14.0" @@ -5003,8 +5082,8 @@ staged-git-files@0.0.4: resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" standard-version@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.1.0.tgz#a049e87c302e7fce23f2f8a18e3ed7f1509436ec" + version "4.2.0" + resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.2.0.tgz#3017e8c5ced2a92db7501790255c3ba85157375d" dependencies: chalk "^1.1.3" conventional-changelog "^1.1.0" @@ -5064,14 +5143,7 @@ string-width@^1.0.0, string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^3.0.0" - -string-width@^2.1.0: +string-width@^2.0.0, string-width@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -5082,19 +5154,18 @@ string_decoder@0.10, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -string_decoder@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.1.tgz#62e200f039955a6810d8df0a33ffc0f013662d98" +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" dependencies: - safe-buffer "^5.0.1" + safe-buffer "~5.1.0" stringify-entities@^1.0.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.0.tgz#2244a516c4f1e8e01b73dad01023016776abd917" + version "1.3.1" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.1.tgz#b150ec2d72ac4c1b5f324b51fb6b28c9cdff058c" dependencies: character-entities-html4 "^1.0.0" character-entities-legacy "^1.0.0" - has "^1.0.1" is-alphanumerical "^1.0.0" is-hexadecimal "^1.0.0" @@ -5149,6 +5220,16 @@ strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +strong-log-transformer@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-1.0.6.tgz#f7fb93758a69a571140181277eea0c2eb1301fa3" + dependencies: + byline "^5.0.0" + duplexer "^0.1.1" + minimist "^0.1.0" + moment "^2.6.0" + through "^2.3.4" + subarg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" @@ -5211,6 +5292,28 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" +temp-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + +temp-write@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-3.3.0.tgz#c1a96de2b36061342eae81f44ff001aec8f615a9" + dependencies: + graceful-fs "^4.1.2" + is-stream "^1.1.0" + make-dir "^1.0.0" + pify "^2.2.0" + temp-dir "^1.0.0" + uuid "^3.0.1" + +tempfile@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2" + dependencies: + os-tmpdir "^1.0.0" + uuid "^2.0.1" + test-exclude@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" @@ -5230,10 +5333,8 @@ text-table@~0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" throat@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-3.1.0.tgz#ef22d8855963b3fdc626d043508f24c4cdf7d3c3" - dependencies: - double-ended-queue "^2.1.0-0" + version "3.2.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" through2-filter@^2.0.0: version "2.0.0" @@ -5256,16 +5357,16 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@~2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@2, "through@>=2.2.7 <3", through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" tiny-lr@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.0.4.tgz#d13becf37f8b7e963320f5743298e3e934c7329a" + version "1.0.5" + resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.0.5.tgz#21f40bf84ebd1f853056680375eef1670c334112" dependencies: body "^5.1.0" - debug "~2.2.0" + debug "~2.6.7" faye-websocket "~0.10.0" livereload-js "^2.2.2" object-assign "^4.1.0" @@ -5355,8 +5456,8 @@ trim@0.0.1: resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" trough@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" + version "1.0.1" + resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.1.tgz#a9fd8b0394b0ae8fff82e0633a0a36ccad5b5f86" tryit@^1.0.1: version "1.0.3" @@ -5387,8 +5488,8 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@^2.6: - version "2.8.28" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.28.tgz#e335032df9bb20dcb918f164589d5af47f38834a" + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" dependencies: source-map "~0.5.1" yargs "~3.10.0" @@ -5415,12 +5516,11 @@ unherit@^1.0.4: xtend "^4.0.1" unified@^6.0.0: - version "6.1.4" - resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.4.tgz#12d7a4ec35986c4a2fa0815cdfdec4be0245fca2" + version "6.1.5" + resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.5.tgz#716937872621a63135e62ced2f3ac6a063c6fb87" dependencies: bail "^1.0.0" extend "^3.0.0" - has "^1.0.1" is-plain-obj "^1.1.0" trough "^1.0.0" vfile "^2.0.0" @@ -5450,16 +5550,16 @@ unist-builder@^1.0.0, unist-builder@^1.0.1: object-assign "^4.1.0" unist-util-generated@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.0.tgz#8c95657ff12b32eaffe0731fbb37da6995fae01b" + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.1.tgz#99f16c78959ac854dee7c615c291924c8bf4de7f" unist-util-is@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.0.tgz#d746a2702a8921b4cc356fbbd558ea05fc5052ec" + version "2.1.1" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-2.1.1.tgz#0c312629e3f960c66e931e812d3d80e77010947b" unist-util-modify-children@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.0.tgz#559203ae85d7a76283277be1abfbaf595a177ead" + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-modify-children/-/unist-util-modify-children-1.1.1.tgz#66d7e6a449e6f67220b976ab3cb8b5ebac39e51d" dependencies: array-iterate "^1.0.0" @@ -5468,8 +5568,8 @@ unist-util-position@^3.0.0: resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.0.0.tgz#e6e1e03eeeb81c5e1afe553e8d4adfbd7c0d8f82" unist-util-remove-position@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.0.tgz#2444fedc344bc5f540dab6353e013b6d78101dc2" + version "1.1.1" + resolved "https://registry.yarnpkg.com/unist-util-remove-position/-/unist-util-remove-position-1.1.1.tgz#5a85c1555fc1ba0c101b86707d15e50fa4c871bb" dependencies: unist-util-visit "^1.1.0" @@ -5478,12 +5578,12 @@ unist-util-stringify-position@^1.0.0: resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-1.1.1.tgz#3ccbdc53679eed6ecf3777dd7f5e3229c1b6aa3c" unist-util-visit@^1.0.0, unist-util-visit@^1.0.1, unist-util-visit@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.1.tgz#e917a3b137658b335cb4420c7da2e74d928e4e94" + version "1.1.3" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.1.3.tgz#ec268e731b9d277a79a5b5aa0643990e405d600b" universalify@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" + version "0.1.1" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" unset-value@^0.1.1: version "0.1.2" @@ -5512,9 +5612,13 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -uuid@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" +uuid@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + +uuid@^3.0.0, uuid@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" v8flags@^2.0.10: version "2.1.1" @@ -5540,8 +5644,8 @@ verror@1.3.6: extsprintf "1.0.2" vfile-location@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.1.tgz#0bf8816f732b0f8bd902a56fda4c62c8e935dc52" + version "2.0.2" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-2.0.2.tgz#d3675c59c877498e492b4756ff65e4af1a752255" vfile-reporter@^4.0.0: version "4.0.0" @@ -5554,16 +5658,16 @@ vfile-reporter@^4.0.0: vfile-statistics "^1.1.0" vfile-sort@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.0.0.tgz#7279458d111a9ba3b18effd9f8a0169bb7c5112b" + version "2.1.0" + resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.1.0.tgz#49501c9e8bbe5adff2e9b3a7671ee1b1e20c5210" vfile-statistics@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.0.tgz#02104c60fdeed1d11b1f73ad65330b7634b3d895" vfile@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.1.0.tgz#d3ce8b825e7b8d53b896164341273381936f02bd" + version "2.2.0" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-2.2.0.tgz#ce47a4fb335922b233e535db0f7d8121d8fced4e" dependencies: is-buffer "^1.1.4" replace-ext "1.0.0" @@ -5600,14 +5704,13 @@ vinyl@^1.0.0: replace-ext "0.0.1" vinyl@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.0.2.tgz#0a3713d8d4e9221c58f10ca16c0116c9e25eda7c" + version "2.1.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c" dependencies: - clone "^1.0.0" + clone "^2.1.1" clone-buffer "^1.0.0" clone-stats "^1.0.0" cloneable-readable "^1.0.0" - is-stream "^1.1.0" remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" @@ -5621,6 +5724,12 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" +wcwidth@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + dependencies: + defaults "^1.0.3" + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -5693,11 +5802,11 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" worker-farm@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" + version "1.4.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.4.1.tgz#a438bc993a7a7d133bcb6547c95eca7cff4897d8" dependencies: - errno ">=0.1.1 <0.2.0-0" - xtend ">=4.0.0 <4.1.0-0" + errno "^0.1.4" + xtend "^4.0.1" wrap-ansi@^2.0.0: version "2.1.0" @@ -5710,6 +5819,32 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + slide "^1.1.5" + +write-json-file@^2.1.0, write-json-file@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.2.0.tgz#51862506bbb3b619eefab7859f1fd6c6d0530876" + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + pify "^2.0.0" + sort-keys "^1.1.1" + write-file-atomic "^2.0.0" + +write-pkg@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.1.0.tgz#030a9994cc9993d25b4e75a9f1a1923607291ce9" + dependencies: + sort-keys "^2.0.0" + write-json-file "^2.2.0" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -5736,7 +5871,7 @@ y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" -yallist@^2.0.0: +yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" @@ -5795,8 +5930,8 @@ yargs@^7.0.2: yargs-parser "^5.0.0" yargs@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa" + version "8.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" dependencies: camelcase "^4.1.0" cliui "^3.2.0" From 2eb09131a008a72434859eed058624c1994260a5 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 00:39:09 -0400 Subject: [PATCH 085/555] chore(release): 5.0.1 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 672e3a6fe..ebbb447c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.0.1](https://github.com/documentationjs/documentation/compare/v5.0.0...v5.0.1) (2017-07-28) + + + # [5.0.0](https://github.com/documentationjs/documentation/compare/v4.0.0...v5.0.0) (2017-07-27) diff --git a/package.json b/package.json index a90b83a76..c51a59ffd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.0.0", + "version": "5.0.1", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From dddac190094eb8908064f5516a5d2b8a05cc3751 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 11:09:03 -0400 Subject: [PATCH 086/555] fix(scripts): Remove changelog package.json task --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index c51a59ffd..e71e2e924 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "precommit": "lint-staged --verbose", "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", - "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint src", "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" From 81fa4b0327069f9993666f83479d7c58ee25c54b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 11:11:54 -0400 Subject: [PATCH 087/555] build: Run build on prepublish Fixes #853 --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e71e2e924..dfa170773 100644 --- a/package.json +++ b/package.json @@ -97,9 +97,10 @@ "url": "git@github.com:documentationjs/documentation.git" }, "scripts": { - "build": "rm -rf lib && babel -D src -d lib", + "build": "rm -rf lib && babel -D src -d lib && npm run doc", "release": "standard-version", "precommit": "lint-staged --verbose", + "prepublish": "npm run build", "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", "self-lint": "node ./bin/documentation.js lint src", From d1320f694e9a8bb491fd7498c3b96c5422ebbb09 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 11:25:47 -0400 Subject: [PATCH 088/555] chore: Update test snapshot for new version --- __tests__/__snapshots__/bin.js.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index f9c3a77bd..ad5ac8c6b 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 4.0.0 | Documentation + documentation 5.0.1 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    4.0.0
    +
    5.0.1
    Date: Fri, 28 Jul 2017 11:48:17 -0400 Subject: [PATCH 089/555] test: Run input tests Fixes #817 --- __tests__/__snapshots__/test.js.snap | 1325 ++++++++++++++++++++++++++ __tests__/test.js | 10 +- 2 files changed, 1330 insertions(+), 5 deletions(-) diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 4c60f818c..d3bf51bd7 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -743,6 +743,1331 @@ Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refer " `; +exports[`html nested.input.js 1`] = ` +" + + + + documentation 5.0.1 | Documentation + + + + + + +
    +
    +
    +
    +

    documentation

    +
    5.0.1
    + +
    + +
    + +
    +
    +
    + + +
    + + +
    + +

    + Klass +

    + + +
    + + +

    Creates a new Klass

    + + +
    new Klass(foo: any)
    + + +

    + Extends + + Stream.Writable + +

    + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + foo (any) + +
    + +
    + +
    + + + + + + + + + + + +
    Static Members
    +
    + +
    +
    +
    + + isClass(other, also) +
    +
    +
    +
    + + + +

    Decide whether an object is a Klass instance +This is a [klasssic]Klass +This is a [link to something that does not exist]DoesNot

    + + +
    isClass(other: Object, also: any): boolean
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + other (Object) + +
    + +
    + +
    +
    + also (any) + +
    + +
    + +
    + + + + + + +
    Returns
    + boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + isWeird(other) +
    +
    +
    +
    + + + +

    A function that triggers the case where the autolinker doesn't find +the referenced class type

    + + +
    isWeird(other: Weird): boolean
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + other (Weird) + +
    + +
    + +
    + + + + + + +
    Returns
    + boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + isBuffer(buf, size) +
    +
    +
    +
    + + + +

    This method takes a Buffer object that will be linked to nodejs.org

    + + +
    isBuffer(buf: (Buffer | string), size: number): boolean
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + buf ((Buffer | string)) + +
    + +
    + +
    +
    + size (number + = 0) + size + +
    + +
    + +
    + + + + + + +
    Returns
    + boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + isArrayOfBuffers(buffers) +
    +
    +
    +
    + + + +

    This method takes an array of buffers and counts them

    + + +
    isArrayOfBuffers(buffers: Array<Buffer>): number
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + buffers (Array<Buffer>) + some buffers + +
    + +
    + +
    + + + + + + +
    Returns
    + number: + how many + + + + + + + + +
    Example
    + + +
    var k = new Klass();
    +k.isArrayOfBuffers();
    + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + MAGIC_NUMBER +
    +
    +
    +
    + + + +

    A magic number that identifies this Klass.

    + + +
    MAGIC_NUMBER
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + + + +
    Instance Members
    +
    + +
    +
    +
    + + getFoo() +
    +
    +
    +
    + + + +

    Get this Klass's foo

    + + +
    getFoo(): Number
    + + + + + + + + + + + + + + + + +
    Returns
    + Number: + foo + + + + + + + + +
    Example
    + +

    this shows you how to getFoo

    +

    +
    var x = foo.getFoo();
    + + + + + + + + +
    + +
    +
    + +
    +
    +
    + + withOptions(options, otherOptions) +
    +
    +
    +
    + + + +

    A function with an options parameter

    + + +
    withOptions(options: Object, otherOptions: number?)
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + options (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    options.foo string +
    options.bar number +
    + +
    + +
    +
    + otherOptions (number?) + +
    + +
    + +
    + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + + + +
    Events
    +
    + +
    +
    +
    + + event +
    +
    +
    +
    + + + +

    Klass event

    + + +
    event
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + +
    + + + + +
    + + +
    + +

    + CustomError +

    + + +
    + + +

    a typedef with nested properties

    + + +
    CustomError(other: any, also: any)
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + other (any) + +
    + +
    + +
    +
    + also (any) + +
    + +
    + +
    + + + +
    Properties
    +
    + +
    + error (object) + : An error + + +
      + +
    • error.code string + +

      The error's code

      +
    • + +
    • error.description string + +

      The error's description

      +
    • + +
    + +
    + +
    + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + bar +

    + + +
    + + +

    Get an instance of Klass. Will make +a klass instance multiword, +like a klass

    + + +
    bar(): Klass
    + + + + + + + + + + + + + + + + +
    Returns
    + Klass: + that class + + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + bar +

    + + +
    + + +

    Rest property function

    + + +
    bar(toys: ...Number): undefined
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + toys (...Number) + +
    + +
    + +
    + + + + + + +
    Returns
    + undefined: + nothing + + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + bar +

    + + +
    + + +

    Get an instance of Klass. Will make +a klass instance multiword, +like a klass. This needs a number input.

    + + +
    bar(): undefined
    + + + + + + + + + + + + + + + + +
    Returns
    + undefined: + nothing + + + + + + + + + + + + + + +
    + + + + +
    + + +
    + +

    + Foo +

    + + +
    + + +

    This is Foo

    + + +
    new Foo()
    + + + + + + + + + + + + + + + + + + + + + + + +
    Instance Members
    +
    + +
    +
    +
    + + bar +
    +
    +
    +
    + + + +

    This is bar

    + + +
    bar
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + + + +
    + + + + +
    + + +
    + +

    + customStreams +

    + + +
    + + +

    I am the container of stream types

    + + +
    customStreams
    + + + + + + + + + + + + + + + + + + + + + +
    Static Members
    +
    + +
    +
    +
    + + new passthrough() +
    +
    +
    +
    + + + +

    I am a passthrough stream that belongs to customStreams

    + + +
    new passthrough()
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    +
    + +
    + + + + + + +
    + + + +
    +
    +
    + + + + +" +`; + exports[`multi-file input 1`] = ` Array [ Object { diff --git a/__tests__/test.js b/__tests__/test.js index 2da48557e..03afdb9f8 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -89,7 +89,7 @@ test('bad input', function() { }); }); -test('html', function() { +describe('html', function() { glob .sync(path.join(__dirname, 'fixture/html', '*.input.js')) .forEach(function(file) { @@ -109,7 +109,7 @@ test('html', function() { }); }); -test('outputs', function() { +describe('outputs', function() { glob .sync(path.join(__dirname, 'fixture', '*.input.js')) .forEach(function(file) { @@ -157,9 +157,9 @@ test('outputs', function() { test('highlightAuto md output', async function() { var file = path.join( - __dirname, - 'fixture/auto_lang_hljs/multilanguage.input.js' - ), + __dirname, + 'fixture/auto_lang_hljs/multilanguage.input.js' + ), hljsConfig = { hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } }; From 9433ec605eef8ec12213730f0d0bc448f43aa719 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 28 Jul 2017 12:08:20 -0400 Subject: [PATCH 090/555] test: Remove unnecessary callbacks from tests --- __tests__/test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/__tests__/test.js b/__tests__/test.js index 03afdb9f8..cbcbbacca 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -71,7 +71,7 @@ test('bad input', function() { glob .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) .forEach(function(file) { - test(path.basename(file), function(t) { + test(path.basename(file), function() { return documentation .build([file], readOptionsFromFile(file)) .then(res => { @@ -93,7 +93,7 @@ describe('html', function() { glob .sync(path.join(__dirname, 'fixture/html', '*.input.js')) .forEach(function(file) { - test(path.basename(file), async function(t) { + test(path.basename(file), async function() { const result = await documentation.build( [file], readOptionsFromFile(file) @@ -113,12 +113,12 @@ describe('outputs', function() { glob .sync(path.join(__dirname, 'fixture', '*.input.js')) .forEach(function(file) { - test(path.basename(file), async function(tt) { + test(path.basename(file), async function() { const result = await documentation.build( [file], readOptionsFromFile(file) ); - test('markdown', async function(t) { + test('markdown', async function() { const md = await outputMarkdown(_.cloneDeep(result), { markdownToc: true }); @@ -126,7 +126,7 @@ describe('outputs', function() { }); if (file.match(/es6.input.js/)) { - test('no markdown TOC', async function(t) { + test('no markdown TOC', async function() { const txt = await outputMarkdown(_.cloneDeep(result), { markdownToc: false }); @@ -134,12 +134,12 @@ describe('outputs', function() { }); } - test('markdown AST', async function(t) { + test('markdown AST', async function() { const ast = await outputMarkdownAST(_.cloneDeep(result), {}); expect(ast).toMatchSnapshot(); }); - test('JSON', function(t) { + test('JSON', function() { normalize(result); result.forEach(function(comment) { validate( From 6509ae813e2a9d5cde6fb4d7373451ad8ee82b71 Mon Sep 17 00:00:00 2001 From: David Halls Date: Fri, 23 Jun 2017 08:49:39 +0100 Subject: [PATCH 091/555] feat(theme): Flexible sidebar for default theme --- .babelrc | 4 +- __tests__/__snapshots__/bin.js.snap | 12 +- __tests__/__snapshots__/test.js.snap | 12 +- src/default_theme/assets/anchor.js | 497 +++++++++++++++-------- src/default_theme/assets/bass.css | 1 + src/default_theme/assets/site.js | 89 +++- src/default_theme/assets/split.css | 15 + src/default_theme/assets/split.js | 586 +++++++++++++++++++++++++++ src/default_theme/assets/style.css | 4 + src/default_theme/index._ | 12 +- 10 files changed, 1036 insertions(+), 196 deletions(-) create mode 100644 src/default_theme/assets/split.css create mode 100644 src/default_theme/assets/split.js diff --git a/.babelrc b/.babelrc index c298bca39..d4ffb33d6 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,8 @@ { "presets": ["flow"], "plugins": [ - "transform-es2015-modules-commonjs" + ["transform-es2015-modules-commonjs", { + "allowTopLevelThis": true + }] ] } diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index ad5ac8c6b..4d9e92307 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -10,11 +10,11 @@ exports[`--config 1`] = ` + - -
    -
    -
    + +
    +

    documentation

    5.0.1
    @@ -219,7 +219,7 @@ exports[`--config 1`] = `
    -
    +
    @@ -1355,8 +1355,8 @@ like a klass. This needs a
    -
    + diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index d3bf51bd7..cd2aaa7fe 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -753,11 +753,11 @@ exports[`html nested.input.js 1`] = ` + - -
    -
    -
    + +
    +

    documentation

    5.0.1
    @@ -952,7 +952,7 @@ exports[`html nested.input.js 1`] = `
    -
    + diff --git a/src/default_theme/assets/anchor.js b/src/default_theme/assets/anchor.js index 2ec9a1d4b..0e55b515e 100644 --- a/src/default_theme/assets/anchor.js +++ b/src/default_theme/assets/anchor.js @@ -1,201 +1,350 @@ /*! - * AnchorJS - v1.2.1 - 2015-07-02 + * AnchorJS - v4.0.0 - 2017-06-02 * https://github.com/bryanbraun/anchorjs - * Copyright (c) 2015 Bryan Braun; Licensed MIT + * Copyright (c) 2017 Bryan Braun; Licensed MIT */ +/* eslint-env amd, node */ -function AnchorJS(options) { - this.options = options || {}; - - this._applyRemainingDefaultOptions = function(opts) { - this.options.icon = this.options.hasOwnProperty('icon') - ? opts.icon - : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. - this.options.visible = this.options.hasOwnProperty('visible') - ? opts.visible - : 'hover'; // Also accepts 'always' - this.options.placement = this.options.hasOwnProperty('placement') - ? opts.placement - : 'right'; // Also accepts 'left' - this.options.class = this.options.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name. - }; - - this._applyRemainingDefaultOptions(options); - - this.add = function(selector) { - var elements, - elsWithIds, - idList, - elementID, - i, - roughText, - tidyText, - index, - count, - newTidyText, - readableID, - anchor; - - this._applyRemainingDefaultOptions(this.options); - - // Provide a sensible default selector, if none is given. - if (!selector) { - selector = 'h1, h2, h3, h4, h5, h6'; - } else if (typeof selector !== 'string') { - throw new Error('The selector provided to AnchorJS was invalid.'); - } +// https://github.com/umdjs/umd/blob/master/templates/returnExports.js +(function(root, factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof module === 'object' && module.exports) { + // Node. Does not work with strict CommonJS, but + // only CommonJS-like environments that support module.exports, + // like Node. + module.exports = factory(); + } else { + // Browser globals (root is window) + root.AnchorJS = factory(); + root.anchors = new root.AnchorJS(); + } +})(this, function() { + 'use strict'; + function AnchorJS(options) { + this.options = options || {}; + this.elements = []; - elements = document.querySelectorAll(selector); - if (elements.length === 0) { - return false; + /** + * Assigns options to the internal options object, and provides defaults. + * @param {Object} opts - Options object + */ + function _applyRemainingDefaultOptions(opts) { + opts.icon = opts.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. + opts.visible = opts.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' & 'touch' + opts.placement = opts.hasOwnProperty('placement') + ? opts.placement + : 'right'; // Also accepts 'left' + opts.class = opts.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name. + // Using Math.floor here will ensure the value is Number-cast and an integer. + opts.truncate = opts.hasOwnProperty('truncate') + ? Math.floor(opts.truncate) + : 64; // Accepts any value that can be typecast to a number. } - this._addBaselineStyles(); + _applyRemainingDefaultOptions(this.options); - // We produce a list of existing IDs so we don't generate a duplicate. - elsWithIds = document.querySelectorAll('[id]'); - idList = [].map.call(elsWithIds, function assign(el) { - return el.id; - }); + /** + * Checks to see if this device supports touch. Uses criteria pulled from Modernizr: + * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40 + * @return {Boolean} - true if the current device supports touch. + */ + this.isTouchDevice = function() { + return !!( + 'ontouchstart' in window || + (window.DocumentTouch && document instanceof DocumentTouch) + ); + }; - for (i = 0; i < elements.length; i++) { - if (elements[i].hasAttribute('id')) { - elementID = elements[i].getAttribute('id'); - } else { - roughText = elements[i].textContent; - - // Refine it so it makes a good ID. Strip out non-safe characters, replace - // spaces with hyphens, truncate to 32 characters, and make toLowerCase. - // - // Example string: // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.' - tidyText = roughText - .replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment' - .replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment' - .replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment' - .substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' - .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' - .toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url' - - // Compare our generated ID to existing IDs (and increment it if needed) - // before we add it to the page. - newTidyText = tidyText; - count = 0; - do { - if (index !== undefined) { - newTidyText = tidyText + '-' + count; + /** + * Add anchor links to page elements. + * @param {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links + * to. Also accepts an array or nodeList containing the relavant elements. + * @return {this} - The AnchorJS object + */ + this.add = function(selector) { + var elements, + elsWithIds, + idList, + elementID, + i, + index, + count, + tidyText, + newTidyText, + readableID, + anchor, + visibleOptionToUse, + indexesToDrop = []; + + // We reapply options here because somebody may have overwritten the default options object when setting options. + // For example, this overwrites all options but visible: + // + // anchors.options = { visible: 'always'; } + _applyRemainingDefaultOptions(this.options); + + visibleOptionToUse = this.options.visible; + if (visibleOptionToUse === 'touch') { + visibleOptionToUse = this.isTouchDevice() ? 'always' : 'hover'; + } + + // Provide a sensible default selector, if none is given. + if (!selector) { + selector = 'h2, h3, h4, h5, h6'; + } + + elements = _getElements(selector); + + if (elements.length === 0) { + return this; + } + + _addBaselineStyles(); + + // We produce a list of existing IDs so we don't generate a duplicate. + elsWithIds = document.querySelectorAll('[id]'); + idList = [].map.call(elsWithIds, function assign(el) { + return el.id; + }); + + for (i = 0; i < elements.length; i++) { + if (this.hasAnchorJSLink(elements[i])) { + indexesToDrop.push(i); + continue; + } + + if (elements[i].hasAttribute('id')) { + elementID = elements[i].getAttribute('id'); + } else if (elements[i].hasAttribute('data-anchor-id')) { + elementID = elements[i].getAttribute('data-anchor-id'); + } else { + tidyText = this.urlify(elements[i].textContent); + + // Compare our generated ID to existing IDs (and increment it if needed) + // before we add it to the page. + newTidyText = tidyText; + count = 0; + do { + if (index !== undefined) { + newTidyText = tidyText + '-' + count; + } + + index = idList.indexOf(newTidyText); + count += 1; + } while (index !== -1); + index = undefined; + idList.push(newTidyText); + + elements[i].setAttribute('id', newTidyText); + elementID = newTidyText; + } + + readableID = elementID.replace(/-/g, ' '); + + // The following code builds the following DOM structure in a more effiecient (albeit opaque) way. + // ''; + anchor = document.createElement('a'); + anchor.className = 'anchorjs-link ' + this.options.class; + anchor.href = '#' + elementID; + anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID); + anchor.setAttribute('data-anchorjs-icon', this.options.icon); + + if (visibleOptionToUse === 'always') { + anchor.style.opacity = '1'; + } + + if (this.options.icon === '\ue9cb') { + anchor.style.font = '1em/1 anchorjs-icons'; + + // We set lineHeight = 1 here because the `anchorjs-icons` font family could otherwise affect the + // height of the heading. This isn't the case for icons with `placement: left`, so we restore + // line-height: inherit in that case, ensuring they remain positioned correctly. For more info, + // see https://github.com/bryanbraun/anchorjs/issues/39. + if (this.options.placement === 'left') { + anchor.style.lineHeight = 'inherit'; } - // .indexOf is supported in IE9+. - index = idList.indexOf(newTidyText); - count += 1; - } while (index !== -1); - index = undefined; - idList.push(newTidyText); - - // Assign it to our element. - // Currently the setAttribute element is only supported in IE9 and above. - elements[i].setAttribute('id', newTidyText); - - elementID = newTidyText; + } + + if (this.options.placement === 'left') { + anchor.style.position = 'absolute'; + anchor.style.marginLeft = '-1em'; + anchor.style.paddingRight = '0.5em'; + elements[i].insertBefore(anchor, elements[i].firstChild); + } else { + // if the option provided is `right` (or anything else). + anchor.style.paddingLeft = '0.375em'; + elements[i].appendChild(anchor); + } + } + + for (i = 0; i < indexesToDrop.length; i++) { + elements.splice(indexesToDrop[i] - i, 1); } + this.elements = this.elements.concat(elements); - readableID = elementID.replace(/-/g, ' '); + return this; + }; - // The following code builds the following DOM structure in a more effiecient (albeit opaque) way. - // ''; - anchor = document.createElement('a'); - anchor.className = 'anchorjs-link ' + this.options.class; - anchor.href = '#' + elementID; - anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID); - anchor.setAttribute('data-anchorjs-icon', this.options.icon); + /** + * Removes all anchorjs-links from elements targed by the selector. + * @param {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links, + * OR a nodeList / array containing the DOM elements. + * @return {this} - The AnchorJS object + */ + this.remove = function(selector) { + var index, + domAnchor, + elements = _getElements(selector); - if (this.options.visible === 'always') { - anchor.style.opacity = '1'; + for (var i = 0; i < elements.length; i++) { + domAnchor = elements[i].querySelector('.anchorjs-link'); + if (domAnchor) { + // Drop the element from our main list, if it's in there. + index = this.elements.indexOf(elements[i]); + if (index !== -1) { + this.elements.splice(index, 1); + } + // Remove the anchor from the DOM. + elements[i].removeChild(domAnchor); + } } + return this; + }; + + /** + * Removes all anchorjs links. Mostly used for tests. + */ + this.removeAll = function() { + this.remove(this.elements); + }; + + /** + * Urlify - Refine text so it makes a good ID. + * + * To do this, we remove apostrophes, replace nonsafe characters with hyphens, + * remove extra hyphens, truncate, trim hyphens, and make lowercase. + * + * @param {String} text - Any text. Usually pulled from the webpage element we are linking to. + * @return {String} - hyphen-delimited text for use in IDs and URLs. + */ + this.urlify = function(text) { + // Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\ + var nonsafeChars = /[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\]/g, + urlText; - if (this.options.icon === '\ue9cb') { - anchor.style.fontFamily = 'anchorjs-icons'; - anchor.style.fontStyle = 'normal'; - anchor.style.fontVariant = 'normal'; - anchor.style.fontWeight = 'normal'; - anchor.style.lineHeight = 1; + // The reason we include this _applyRemainingDefaultOptions is so urlify can be called independently, + // even after setting options. This can be useful for tests or other applications. + if (!this.options.truncate) { + _applyRemainingDefaultOptions(this.options); } - if (this.options.placement === 'left') { - anchor.style.position = 'absolute'; - anchor.style.marginLeft = '-1em'; - anchor.style.paddingRight = '0.5em'; - elements[i].insertBefore(anchor, elements[i].firstChild); + // Note: we trim hyphens after truncating because truncating can cause dangling hyphens. + // Example string: // " ⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean." + urlText = text + .trim() // "⚡⚡ Don't forget: URL fragments should be i18n-friendly, hyphenated, short, and clean." + .replace(/\'/gi, '') // "⚡⚡ Dont forget: URL fragments should be i18n-friendly, hyphenated, short, and clean." + .replace(nonsafeChars, '-') // "⚡⚡-Dont-forget--URL-fragments-should-be-i18n-friendly--hyphenated--short--and-clean-" + .replace(/-{2,}/g, '-') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-short-and-clean-" + .substring(0, this.options.truncate) // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated-" + .replace(/^-+|-+$/gm, '') // "⚡⚡-Dont-forget-URL-fragments-should-be-i18n-friendly-hyphenated" + .toLowerCase(); // "⚡⚡-dont-forget-url-fragments-should-be-i18n-friendly-hyphenated" + + return urlText; + }; + + /** + * Determines if this element already has an AnchorJS link on it. + * Uses this technique: http://stackoverflow.com/a/5898748/1154642 + * @param {HTMLElemnt} el - a DOM node + * @return {Boolean} true/false + */ + this.hasAnchorJSLink = function(el) { + var hasLeftAnchor = + el.firstChild && + (' ' + el.firstChild.className + ' ').indexOf(' anchorjs-link ') > -1, + hasRightAnchor = + el.lastChild && + (' ' + el.lastChild.className + ' ').indexOf(' anchorjs-link ') > -1; + + return hasLeftAnchor || hasRightAnchor || false; + }; + + /** + * Turns a selector, nodeList, or array of elements into an array of elements (so we can use array methods). + * It also throws errors on any other inputs. Used to handle inputs to .add and .remove. + * @param {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links, + * OR a nodeList / array containing the DOM elements. + * @return {Array} - An array containing the elements we want. + */ + function _getElements(input) { + var elements; + if (typeof input === 'string' || input instanceof String) { + // See https://davidwalsh.name/nodelist-array for the technique transforming nodeList -> Array. + elements = [].slice.call(document.querySelectorAll(input)); + // I checked the 'input instanceof NodeList' test in IE9 and modern browsers and it worked for me. + } else if (Array.isArray(input) || input instanceof NodeList) { + elements = [].slice.call(input); } else { - // if the option provided is `right` (or anything else). - anchor.style.paddingLeft = '0.375em'; - elements[i].appendChild(anchor); + throw new Error('The selector provided to AnchorJS was invalid.'); } + return elements; } - return this; - }; - - this.remove = function(selector) { - var domAnchor, elements = document.querySelectorAll(selector); - for (var i = 0; i < elements.length; i++) { - domAnchor = elements[i].querySelector('.anchorjs-link'); - if (domAnchor) { - elements[i].removeChild(domAnchor); + /** + * _addBaselineStyles + * Adds baseline styles to the page, used by all AnchorJS links irregardless of configuration. + */ + function _addBaselineStyles() { + // We don't want to add global baseline styles if they've been added before. + if (document.head.querySelector('style.anchorjs') !== null) { + return; } - } - return this; - }; - this._addBaselineStyles = function() { - // We don't want to add global baseline styles if they've been added before. - if (document.head.querySelector('style.anchorjs') !== null) { - return; - } + var style = document.createElement('style'), + linkRule = + ' .anchorjs-link {' + + ' opacity: 0;' + + ' text-decoration: none;' + + ' -webkit-font-smoothing: antialiased;' + + ' -moz-osx-font-smoothing: grayscale;' + + ' }', + hoverRule = + ' *:hover > .anchorjs-link,' + + ' .anchorjs-link:focus {' + + ' opacity: 1;' + + ' }', + anchorjsLinkFontFace = + ' @font-face {' + + ' font-family: "anchorjs-icons";' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above + ' src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype");' + + ' }', + pseudoElContent = + ' [data-anchorjs-icon]::after {' + + ' content: attr(data-anchorjs-icon);' + + ' }', + firstStyleEl; - var style = document.createElement('style'), - linkRule = - ' .anchorjs-link {' + - ' opacity: 0;' + - ' text-decoration: none;' + - ' -webkit-font-smoothing: antialiased;' + - ' -moz-osx-font-smoothing: grayscale;' + - ' }', - hoverRule = - ' *:hover > .anchorjs-link,' + - ' .anchorjs-link:focus {' + - ' opacity: 1;' + - ' }', - anchorjsLinkFontFace = - ' @font-face {' + - ' font-family: "anchorjs-icons";' + - ' font-style: normal;' + - ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above - ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + - ' }', - pseudoElContent = - ' [data-anchorjs-icon]::after {' + - ' content: attr(data-anchorjs-icon);' + - ' }', - firstStyleEl; - - style.className = 'anchorjs'; - style.appendChild(document.createTextNode('')); // Necessary for Webkit. - - // We place it in the head with the other style tags, if possible, so as to - // not look out of place. We insert before the others so these styles can be - // overridden if necessary. - firstStyleEl = document.head.querySelector('[rel="stylesheet"], style'); - if (firstStyleEl === undefined) { - document.head.appendChild(style); - } else { - document.head.insertBefore(style, firstStyleEl); - } + style.className = 'anchorjs'; + style.appendChild(document.createTextNode('')); // Necessary for Webkit. - style.sheet.insertRule(linkRule, style.sheet.cssRules.length); - style.sheet.insertRule(hoverRule, style.sheet.cssRules.length); - style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length); - style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length); - }; -} + // We place it in the head with the other style tags, if possible, so as to + // not look out of place. We insert before the others so these styles can be + // overridden if necessary. + firstStyleEl = document.head.querySelector('[rel="stylesheet"], style'); + if (firstStyleEl === undefined) { + document.head.appendChild(style); + } else { + document.head.insertBefore(style, firstStyleEl); + } + + style.sheet.insertRule(linkRule, style.sheet.cssRules.length); + style.sheet.insertRule(hoverRule, style.sheet.cssRules.length); + style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length); + style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length); + } + } -var anchors = new AnchorJS(); + return AnchorJS; +}); diff --git a/src/default_theme/assets/bass.css b/src/default_theme/assets/bass.css index 15e0dc9a4..2d860c56e 100644 --- a/src/default_theme/assets/bass.css +++ b/src/default_theme/assets/bass.css @@ -457,6 +457,7 @@ min-height:0; } .flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none } +.fs0{ flex-shrink: 0 } .order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 } .order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 } diff --git a/src/default_theme/assets/site.js b/src/default_theme/assets/site.js index 776d38d64..5731367b9 100644 --- a/src/default_theme/assets/site.js +++ b/src/default_theme/assets/site.js @@ -97,11 +97,23 @@ function showHashTarget(targetId) { } } -window.addEventListener('hashchange', function() { +function scrollIntoView(targetId) { + // Only scroll to element if we don't have a stored scroll position. + if (targetId && !history.state) { + var hashTarget = document.getElementById(targetId); + if (hashTarget) { + hashTarget.scrollIntoView(); + } + } +} + +function gotoCurrentTarget() { showHashTarget(location.hash.substring(1)); -}); + scrollIntoView(location.hash.substring(1)); +} -showHashTarget(location.hash.substring(1)); +window.addEventListener('hashchange', gotoCurrentTarget); +gotoCurrentTarget(); var toclinks = document.getElementsByClassName('pre-open'); for (var k = 0; k < toclinks.length; k++) { @@ -111,3 +123,74 @@ for (var k = 0; k < toclinks.length; k++) { function preOpen() { showHashTarget(this.hash.substring(1)); } + +var split_left = document.querySelector('#split-left'); +var split_right = document.querySelector('#split-right'); +var split_parent = split_left.parentNode; +var cw_with_sb = split_left.clientWidth; +split_left.style.overflow = 'hidden'; +var cw_without_sb = split_left.clientWidth; +split_left.style.overflow = ''; + +// Need to add: +// - Half of gutterSize (i.e. 10) because gutter will take that much from each. +// - Scrollbar width (cw_with_sb - cw_without_sb), if it takes up existing +// space (Firefox) rather than adding the scrollbar to the side (Chrome) +var percent_left = + (split_left.getBoundingClientRect().width + 10 + cw_without_sb - cw_with_sb) / + split_parent.getBoundingClientRect().width * + 100; + +Split(['#split-left', '#split-right'], { + elementStyle: function(dimension, size, gutterSize) { + return { + 'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)' + }; + }, + gutterStyle: function(dimension, gutterSize) { + return { + 'flex-basis': gutterSize + 'px' + }; + }, + gutterSize: 20, + sizes: [percent_left, 100 - percent_left] +}); + +// Chrome doesn't remember scroll position properly so do it ourselves. +// Also works on Firefox and Edge. + +function updateState() { + history.replaceState( + { + left_top: split_left.scrollTop, + right_top: split_right.scrollTop + }, + document.title + ); +} + +function loadState(ev) { + if (ev) { + // Edge doesn't replace change history.state on popstate. + history.replaceState(ev.state, document.title); + } + if (history.state) { + split_left.scrollTop = history.state.left_top; + split_right.scrollTop = history.state.right_top; + } +} + +window.addEventListener('load', function() { + // Restore after Firefox scrolls to hash. + setTimeout(function() { + loadState(); + // Update with initial scroll position. + updateState(); + // Update scroll positions only after we've loaded because Firefox + // emits an initial scroll event with 0. + split_left.addEventListener('scroll', updateState); + split_right.addEventListener('scroll', updateState); + }, 1); +}); + +window.addEventListener('popstate', loadState); diff --git a/src/default_theme/assets/split.css b/src/default_theme/assets/split.css new file mode 100644 index 000000000..2d7779ee9 --- /dev/null +++ b/src/default_theme/assets/split.css @@ -0,0 +1,15 @@ +.gutter { + background-color: #f5f5f5; + background-repeat: no-repeat; + background-position: 50%; +} + +.gutter.gutter-vertical { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII='); + cursor: ns-resize; +} + +.gutter.gutter-horizontal { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg=='); + cursor: ew-resize; +} diff --git a/src/default_theme/assets/split.js b/src/default_theme/assets/split.js new file mode 100644 index 000000000..2c5248181 --- /dev/null +++ b/src/default_theme/assets/split.js @@ -0,0 +1,586 @@ +/*! Split.js - v1.3.5 */ +// https://github.com/nathancahill/Split.js +// Copyright (c) 2017 Nathan Cahill; Licensed MIT + +(function(global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' + ? (module.exports = factory()) + : typeof define === 'function' && define.amd + ? define(factory) + : (global.Split = factory()); +})(this, function() { + 'use strict'; + // The programming goals of Split.js are to deliver readable, understandable and + // maintainable code, while at the same time manually optimizing for tiny minified file size, + // browser compatibility without additional requirements, graceful fallback (IE8 is supported) + // and very few assumptions about the user's page layout. + var global = window; + var document = global.document; + + // Save a couple long function names that are used frequently. + // This optimization saves around 400 bytes. + var addEventListener = 'addEventListener'; + var removeEventListener = 'removeEventListener'; + var getBoundingClientRect = 'getBoundingClientRect'; + var NOOP = function() { + return false; + }; + + // Figure out if we're in IE8 or not. IE8 will still render correctly, + // but will be static instead of draggable. + var isIE8 = global.attachEvent && !global[addEventListener]; + + // This library only needs two helper functions: + // + // The first determines which prefixes of CSS calc we need. + // We only need to do this once on startup, when this anonymous function is called. + // + // Tests -webkit, -moz and -o prefixes. Modified from StackOverflow: + // http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167 + var calc = + ['', '-webkit-', '-moz-', '-o-'] + .filter(function(prefix) { + var el = document.createElement('div'); + el.style.cssText = 'width:' + prefix + 'calc(9px)'; + + return !!el.style.length; + }) + .shift() + 'calc'; + + // The second helper function allows elements and string selectors to be used + // interchangeably. In either case an element is returned. This allows us to + // do `Split([elem1, elem2])` as well as `Split(['#id1', '#id2'])`. + var elementOrSelector = function(el) { + if (typeof el === 'string' || el instanceof String) { + return document.querySelector(el); + } + + return el; + }; + + // The main function to initialize a split. Split.js thinks about each pair + // of elements as an independant pair. Dragging the gutter between two elements + // only changes the dimensions of elements in that pair. This is key to understanding + // how the following functions operate, since each function is bound to a pair. + // + // A pair object is shaped like this: + // + // { + // a: DOM element, + // b: DOM element, + // aMin: Number, + // bMin: Number, + // dragging: Boolean, + // parent: DOM element, + // isFirst: Boolean, + // isLast: Boolean, + // direction: 'horizontal' | 'vertical' + // } + // + // The basic sequence: + // + // 1. Set defaults to something sane. `options` doesn't have to be passed at all. + // 2. Initialize a bunch of strings based on the direction we're splitting. + // A lot of the behavior in the rest of the library is paramatized down to + // rely on CSS strings and classes. + // 3. Define the dragging helper functions, and a few helpers to go with them. + // 4. Loop through the elements while pairing them off. Every pair gets an + // `pair` object, a gutter, and special isFirst/isLast properties. + // 5. Actually size the pair elements, insert gutters and attach event listeners. + var Split = function(ids, options) { + if (options === void 0) options = {}; + + var dimension; + var clientDimension; + var clientAxis; + var position; + var paddingA; + var paddingB; + var elements; + + // All DOM elements in the split should have a common parent. We can grab + // the first elements parent and hope users read the docs because the + // behavior will be whacky otherwise. + var parent = elementOrSelector(ids[0]).parentNode; + var parentFlexDirection = global.getComputedStyle(parent).flexDirection; + + // Set default options.sizes to equal percentages of the parent element. + var sizes = + options.sizes || + ids.map(function() { + return 100 / ids.length; + }); + + // Standardize minSize to an array if it isn't already. This allows minSize + // to be passed as a number. + var minSize = options.minSize !== undefined ? options.minSize : 100; + var minSizes = Array.isArray(minSize) + ? minSize + : ids.map(function() { + return minSize; + }); + var gutterSize = options.gutterSize !== undefined ? options.gutterSize : 10; + var snapOffset = options.snapOffset !== undefined ? options.snapOffset : 30; + var direction = options.direction || 'horizontal'; + var cursor = + options.cursor || + (direction === 'horizontal' ? 'ew-resize' : 'ns-resize'); + var gutter = + options.gutter || + function(i, gutterDirection) { + var gut = document.createElement('div'); + gut.className = 'gutter gutter-' + gutterDirection; + return gut; + }; + var elementStyle = + options.elementStyle || + function(dim, size, gutSize) { + var style = {}; + + if (typeof size !== 'string' && !(size instanceof String)) { + if (!isIE8) { + style[dim] = calc + '(' + size + '% - ' + gutSize + 'px)'; + } else { + style[dim] = size + '%'; + } + } else { + style[dim] = size; + } + + return style; + }; + var gutterStyle = + options.gutterStyle || + function(dim, gutSize) { + return (obj = {}), (obj[dim] = gutSize + 'px'), obj; + var obj; + }; + + // 2. Initialize a bunch of strings based on the direction we're splitting. + // A lot of the behavior in the rest of the library is paramatized down to + // rely on CSS strings and classes. + if (direction === 'horizontal') { + dimension = 'width'; + clientDimension = 'clientWidth'; + clientAxis = 'clientX'; + position = 'left'; + paddingA = 'paddingLeft'; + paddingB = 'paddingRight'; + } else if (direction === 'vertical') { + dimension = 'height'; + clientDimension = 'clientHeight'; + clientAxis = 'clientY'; + position = 'top'; + paddingA = 'paddingTop'; + paddingB = 'paddingBottom'; + } + + // 3. Define the dragging helper functions, and a few helpers to go with them. + // Each helper is bound to a pair object that contains it's metadata. This + // also makes it easy to store references to listeners that that will be + // added and removed. + // + // Even though there are no other functions contained in them, aliasing + // this to self saves 50 bytes or so since it's used so frequently. + // + // The pair object saves metadata like dragging state, position and + // event listener references. + + function setElementSize(el, size, gutSize) { + // Split.js allows setting sizes via numbers (ideally), or if you must, + // by string, like '300px'. This is less than ideal, because it breaks + // the fluid layout that `calc(% - px)` provides. You're on your own if you do that, + // make sure you calculate the gutter size by hand. + var style = elementStyle(dimension, size, gutSize); + + // eslint-disable-next-line no-param-reassign + Object.keys(style).forEach(function(prop) { + return (el.style[prop] = style[prop]); + }); + } + + function setGutterSize(gutterElement, gutSize) { + var style = gutterStyle(dimension, gutSize); + + // eslint-disable-next-line no-param-reassign + Object.keys(style).forEach(function(prop) { + return (gutterElement.style[prop] = style[prop]); + }); + } + + // Actually adjust the size of elements `a` and `b` to `offset` while dragging. + // calc is used to allow calc(percentage + gutterpx) on the whole split instance, + // which allows the viewport to be resized without additional logic. + // Element a's size is the same as offset. b's size is total size - a size. + // Both sizes are calculated from the initial parent percentage, + // then the gutter size is subtracted. + function adjust(offset) { + var a = elements[this.a]; + var b = elements[this.b]; + var percentage = a.size + b.size; + + a.size = offset / this.size * percentage; + b.size = percentage - offset / this.size * percentage; + + setElementSize(a.element, a.size, this.aGutterSize); + setElementSize(b.element, b.size, this.bGutterSize); + } + + // drag, where all the magic happens. The logic is really quite simple: + // + // 1. Ignore if the pair is not dragging. + // 2. Get the offset of the event. + // 3. Snap offset to min if within snappable range (within min + snapOffset). + // 4. Actually adjust each element in the pair to offset. + // + // --------------------------------------------------------------------- + // | | <- a.minSize || b.minSize -> | | + // | | | <- this.snapOffset || this.snapOffset -> | | | + // | | | || | | | + // | | | || | | | + // --------------------------------------------------------------------- + // | <- this.start this.size -> | + function drag(e) { + var offset; + + if (!this.dragging) { + return; + } + + // Get the offset of the event from the first side of the + // pair `this.start`. Supports touch events, but not multitouch, so only the first + // finger `touches[0]` is counted. + if ('touches' in e) { + offset = e.touches[0][clientAxis] - this.start; + } else { + offset = e[clientAxis] - this.start; + } + + // If within snapOffset of min or max, set offset to min or max. + // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both. + // Include the appropriate gutter sizes to prevent overflows. + if (offset <= elements[this.a].minSize + snapOffset + this.aGutterSize) { + offset = elements[this.a].minSize + this.aGutterSize; + } else if ( + offset >= + this.size - (elements[this.b].minSize + snapOffset + this.bGutterSize) + ) { + offset = this.size - (elements[this.b].minSize + this.bGutterSize); + } + + // Actually adjust the size. + adjust.call(this, offset); + + // Call the drag callback continously. Don't do anything too intensive + // in this callback. + if (options.onDrag) { + options.onDrag(); + } + } + + // Cache some important sizes when drag starts, so we don't have to do that + // continously: + // + // `size`: The total size of the pair. First + second + first gutter + second gutter. + // `start`: The leading side of the first element. + // + // ------------------------------------------------ + // | aGutterSize -> ||| | + // | ||| | + // | ||| | + // | ||| <- bGutterSize | + // ------------------------------------------------ + // | <- start size -> | + function calculateSizes() { + // Figure out the parent size minus padding. + var a = elements[this.a].element; + var b = elements[this.b].element; + + this.size = + a[getBoundingClientRect]()[dimension] + + b[getBoundingClientRect]()[dimension] + + this.aGutterSize + + this.bGutterSize; + this.start = a[getBoundingClientRect]()[position]; + } + + // stopDragging is very similar to startDragging in reverse. + function stopDragging() { + var self = this; + var a = elements[self.a].element; + var b = elements[self.b].element; + + if (self.dragging && options.onDragEnd) { + options.onDragEnd(); + } + + self.dragging = false; + + // Remove the stored event listeners. This is why we store them. + global[removeEventListener]('mouseup', self.stop); + global[removeEventListener]('touchend', self.stop); + global[removeEventListener]('touchcancel', self.stop); + + self.parent[removeEventListener]('mousemove', self.move); + self.parent[removeEventListener]('touchmove', self.move); + + // Delete them once they are removed. I think this makes a difference + // in memory usage with a lot of splits on one page. But I don't know for sure. + delete self.stop; + delete self.move; + + a[removeEventListener]('selectstart', NOOP); + a[removeEventListener]('dragstart', NOOP); + b[removeEventListener]('selectstart', NOOP); + b[removeEventListener]('dragstart', NOOP); + + a.style.userSelect = ''; + a.style.webkitUserSelect = ''; + a.style.MozUserSelect = ''; + a.style.pointerEvents = ''; + + b.style.userSelect = ''; + b.style.webkitUserSelect = ''; + b.style.MozUserSelect = ''; + b.style.pointerEvents = ''; + + self.gutter.style.cursor = ''; + self.parent.style.cursor = ''; + } + + // startDragging calls `calculateSizes` to store the inital size in the pair object. + // It also adds event listeners for mouse/touch events, + // and prevents selection while dragging so avoid the selecting text. + function startDragging(e) { + // Alias frequently used variables to save space. 200 bytes. + var self = this; + var a = elements[self.a].element; + var b = elements[self.b].element; + + // Call the onDragStart callback. + if (!self.dragging && options.onDragStart) { + options.onDragStart(); + } + + // Don't actually drag the element. We emulate that in the drag function. + e.preventDefault(); + + // Set the dragging property of the pair object. + self.dragging = true; + + // Create two event listeners bound to the same pair object and store + // them in the pair object. + self.move = drag.bind(self); + self.stop = stopDragging.bind(self); + + // All the binding. `window` gets the stop events in case we drag out of the elements. + global[addEventListener]('mouseup', self.stop); + global[addEventListener]('touchend', self.stop); + global[addEventListener]('touchcancel', self.stop); + + self.parent[addEventListener]('mousemove', self.move); + self.parent[addEventListener]('touchmove', self.move); + + // Disable selection. Disable! + a[addEventListener]('selectstart', NOOP); + a[addEventListener]('dragstart', NOOP); + b[addEventListener]('selectstart', NOOP); + b[addEventListener]('dragstart', NOOP); + + a.style.userSelect = 'none'; + a.style.webkitUserSelect = 'none'; + a.style.MozUserSelect = 'none'; + a.style.pointerEvents = 'none'; + + b.style.userSelect = 'none'; + b.style.webkitUserSelect = 'none'; + b.style.MozUserSelect = 'none'; + b.style.pointerEvents = 'none'; + + // Set the cursor, both on the gutter and the parent element. + // Doing only a, b and gutter causes flickering. + self.gutter.style.cursor = cursor; + self.parent.style.cursor = cursor; + + // Cache the initial sizes of the pair. + calculateSizes.call(self); + } + + // 5. Create pair and element objects. Each pair has an index reference to + // elements `a` and `b` of the pair (first and second elements). + // Loop through the elements while pairing them off. Every pair gets a + // `pair` object, a gutter, and isFirst/isLast properties. + // + // Basic logic: + // + // - Starting with the second element `i > 0`, create `pair` objects with + // `a = i - 1` and `b = i` + // - Set gutter sizes based on the _pair_ being first/last. The first and last + // pair have gutterSize / 2, since they only have one half gutter, and not two. + // - Create gutter elements and add event listeners. + // - Set the size of the elements, minus the gutter sizes. + // + // ----------------------------------------------------------------------- + // | i=0 | i=1 | i=2 | i=3 | + // | | isFirst | | isLast | + // | pair 0 pair 1 pair 2 | + // | | | | | + // ----------------------------------------------------------------------- + var pairs = []; + elements = ids.map(function(id, i) { + // Create the element object. + var element = { + element: elementOrSelector(id), + size: sizes[i], + minSize: minSizes[i] + }; + + var pair; + + if (i > 0) { + // Create the pair object with it's metadata. + pair = { + a: i - 1, + b: i, + dragging: false, + isFirst: i === 1, + isLast: i === ids.length - 1, + direction: direction, + parent: parent + }; + + // For first and last pairs, first and last gutter width is half. + pair.aGutterSize = gutterSize; + pair.bGutterSize = gutterSize; + + if (pair.isFirst) { + pair.aGutterSize = gutterSize / 2; + } + + if (pair.isLast) { + pair.bGutterSize = gutterSize / 2; + } + + // if the parent has a reverse flex-direction, switch the pair elements. + if ( + parentFlexDirection === 'row-reverse' || + parentFlexDirection === 'column-reverse' + ) { + var temp = pair.a; + pair.a = pair.b; + pair.b = temp; + } + } + + // Determine the size of the current element. IE8 is supported by + // staticly assigning sizes without draggable gutters. Assigns a string + // to `size`. + // + // IE9 and above + if (!isIE8) { + // Create gutter elements for each pair. + if (i > 0) { + var gutterElement = gutter(i, direction); + setGutterSize(gutterElement, gutterSize); + + gutterElement[addEventListener]( + 'mousedown', + startDragging.bind(pair) + ); + gutterElement[addEventListener]( + 'touchstart', + startDragging.bind(pair) + ); + + parent.insertBefore(gutterElement, element.element); + + pair.gutter = gutterElement; + } + } + + // Set the element size to our determined size. + // Half-size gutters for first and last elements. + if (i === 0 || i === ids.length - 1) { + setElementSize(element.element, element.size, gutterSize / 2); + } else { + setElementSize(element.element, element.size, gutterSize); + } + + var computedSize = element.element[getBoundingClientRect]()[dimension]; + + if (computedSize < element.minSize) { + element.minSize = computedSize; + } + + // After the first iteration, and we have a pair object, append it to the + // list of pairs. + if (i > 0) { + pairs.push(pair); + } + + return element; + }); + + function setSizes(newSizes) { + newSizes.forEach(function(newSize, i) { + if (i > 0) { + var pair = pairs[i - 1]; + var a = elements[pair.a]; + var b = elements[pair.b]; + + a.size = newSizes[i - 1]; + b.size = newSize; + + setElementSize(a.element, a.size, pair.aGutterSize); + setElementSize(b.element, b.size, pair.bGutterSize); + } + }); + } + + function destroy() { + pairs.forEach(function(pair) { + pair.parent.removeChild(pair.gutter); + elements[pair.a].element.style[dimension] = ''; + elements[pair.b].element.style[dimension] = ''; + }); + } + + if (isIE8) { + return { + setSizes: setSizes, + destroy: destroy + }; + } + + return { + setSizes: setSizes, + getSizes: function getSizes() { + return elements.map(function(element) { + return element.size; + }); + }, + collapse: function collapse(i) { + if (i === pairs.length) { + var pair = pairs[i - 1]; + + calculateSizes.call(pair); + + if (!isIE8) { + adjust.call(pair, pair.size - pair.bGutterSize); + } + } else { + var pair$1 = pairs[i]; + + calculateSizes.call(pair$1); + + if (!isIE8) { + adjust.call(pair$1, pair$1.aGutterSize); + } + } + }, + destroy: destroy + }; + }; + + return Split; +}); diff --git a/src/default_theme/assets/style.css b/src/default_theme/assets/style.css index d7e56e042..5265ea1fa 100644 --- a/src/default_theme/assets/style.css +++ b/src/default_theme/assets/style.css @@ -46,6 +46,10 @@ a:hover { max-height: 100%; } +.height-viewport-100 { + height: 100vh; +} + section:target h3 { font-weight:700; } diff --git a/src/default_theme/index._ b/src/default_theme/index._ index 69e28abb0..24f3a3caf 100644 --- a/src/default_theme/index._ +++ b/src/default_theme/index._ @@ -7,11 +7,11 @@ + - -
    -
    -
    + +
    +

    <%- config['project-name'] %>

    <%- config['project-version'] %>
    @@ -91,7 +91,7 @@
    -
    +
    <% docs.forEach(function(s) { %> <% if (s.kind !== 'note') { %> <%= renderSection({ @@ -105,8 +105,8 @@ <% }) %>
    -
    + From 54332ecda92e5e953f1762ba073dce5f1ba3e91a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 31 Jul 2017 13:40:51 -0400 Subject: [PATCH 092/555] chore(release): 5.1.0 --- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebbb447c2..75851c85a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [5.1.0](https://github.com/documentationjs/documentation/compare/v5.0.1...v5.1.0) (2017-07-31) + + +### Bug Fixes + +* **scripts:** Remove changelog package.json task ([dddac19](https://github.com/documentationjs/documentation/commit/dddac19)) + + +### Features + +* **theme:** Flexible sidebar for default theme ([6509ae8](https://github.com/documentationjs/documentation/commit/6509ae8)) + + + ## [5.0.1](https://github.com/documentationjs/documentation/compare/v5.0.0...v5.0.1) (2017-07-28) diff --git a/package.json b/package.json index dfa170773..dbaae3f6c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.0.1", + "version": "5.1.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 2f200ecc79a580d656c22009bfce7f1631206b9b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 31 Jul 2017 13:44:12 -0400 Subject: [PATCH 093/555] chore: Update test snapshots for release --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 4d9e92307..9cc2ffb00 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.0.1 | Documentation + documentation 5.1.0 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.0.1
    +
    5.1.0
    - documentation 5.0.1 | Documentation + documentation 5.1.0 | Documentation @@ -760,7 +760,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.0.1
    +
    5.1.0
    Date: Mon, 31 Jul 2017 14:15:05 -0400 Subject: [PATCH 094/555] fix(theme): Remove dead stepsibling navigation code --- src/default_theme/assets/site.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/default_theme/assets/site.js b/src/default_theme/assets/site.js index 5731367b9..0c4a32fca 100644 --- a/src/default_theme/assets/site.js +++ b/src/default_theme/assets/site.js @@ -46,25 +46,6 @@ document.getElementById('filter-input').addEventListener('keyup', function(e) { } }); -var toggles = document.getElementsByClassName('toggle-step-sibling'); -for (var i = 0; i < toggles.length; i++) { - toggles[i].addEventListener('click', toggleStepSibling); -} - -function toggleStepSibling() { - var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName( - 'toggle-target' - )[0]; - var klass = 'display-none'; - if (stepSibling.classList.contains(klass)) { - stepSibling.classList.remove(klass); - stepSibling.innerHTML = '▾'; - } else { - stepSibling.classList.add(klass); - stepSibling.innerHTML = '▸'; - } -} - var items = document.getElementsByClassName('toggle-sibling'); for (var j = 0; j < items.length; j++) { items[j].addEventListener('click', toggleSibling); From ecf16bdaa0385bfc2d466d4ce9fd079bfd4791f1 Mon Sep 17 00:00:00 2001 From: Anton Date: Fri, 4 Aug 2017 21:29:05 +0300 Subject: [PATCH 095/555] fix: cli options should override package.json options The first priority from CLI(from user) settings then package.json. Fixed #845 --- __tests__/lib/merge_config.js | 31 ++++++++++++++++++++++++++----- src/merge_config.js | 19 +++++++------------ 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/__tests__/lib/merge_config.js b/__tests__/lib/merge_config.js index 45a42836a..5cc4e49a8 100644 --- a/__tests__/lib/merge_config.js +++ b/__tests__/lib/merge_config.js @@ -10,7 +10,30 @@ test('bad config', async function() { } }); -test('nc(mergeConfig)', function(done) { +test('right merging package configuration', async function() { + // Omit configuration from output, for simplicity + var nc = _.curryRight(_.omit, 2)([ + 'config', + 'no-package', + 'parseExtension', + 'project-homepage', + 'project-version' + ]); + return mergeConfig({ + config: path.join(__dirname, '../config_fixture/config.json'), + 'no-package': true, + 'project-name': 'cool Documentation' + }) + .then(nc) + .then(res => { + expect(res).toEqual({ + 'project-name': 'cool Documentation', + foo: 'bar' + }); + }); +}); + +test('nc(mergeConfig)', async function() { // Omit configuration from output, for simplicity var nc = _.curryRight(_.omit, 2)([ 'config', @@ -21,7 +44,7 @@ test('nc(mergeConfig)', function(done) { 'project-version' ]); - Promise.all( + return Promise.all( [ [ { config: path.join(__dirname, '../config_fixture/config.json') }, @@ -74,7 +97,5 @@ test('nc(mergeConfig)', function(done) { expect(res).toEqual(pair[1]); }) ) - ).then(res => { - done(); - }); + ); }); diff --git a/src/merge_config.js b/src/merge_config.js index 7d4cd8726..65dcf733d 100644 --- a/src/merge_config.js +++ b/src/merge_config.js @@ -3,7 +3,6 @@ var yaml = require('js-yaml'), fs = require('fs'), pify = require('pify'), - _ = require('lodash'), readPkgUp = require('read-pkg-up'), path = require('path'), stripComments = require('strip-json-comments'); @@ -29,7 +28,7 @@ function processToc(config: DocumentationConfig, absFilePath: string) { * values of `name` and `version` config. * * @param {Object} config the user-provided config, usually via argv - * @returns {Object} configuration with inferred parameters + * @returns {Promise} configuration with inferred parameters * @throws {Error} if the file cannot be read. */ function mergePackage(config: Object): Promise { @@ -38,16 +37,12 @@ function mergePackage(config: Object): Promise { } return ( readPkgUp() - .then(pkg => - _.defaults( - {}, - _.mapKeys( - _.pick(pkg.pkg, ['name', 'homepage', 'version']), - (val, key) => `project-${key}` - ), - config - ) - ) + .then(pkg => { + ['name', 'homepage', 'version'].forEach(key => { + config[`project-${key}`] = config[`project-${key}`] || pkg.pkg[key]; + }); + return config; + }) // Allow this to fail: this inference is not required. .catch(() => config) ); From 0980113f40b3cb45186e9b8ef54c78a875c88290 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 4 Aug 2017 12:34:47 -0700 Subject: [PATCH 096/555] chore(release): 5.1.1 --- CHANGELOG.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75851c85a..7c2b16974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.1.1](https://github.com/documentationjs/documentation/compare/v5.1.0...v5.1.1) (2017-08-04) + + +### Bug Fixes + +* **theme:** Remove dead stepsibling navigation code ([dccb151](https://github.com/documentationjs/documentation/commit/dccb151)) +* cli options should override package.json options ([ecf16bd](https://github.com/documentationjs/documentation/commit/ecf16bd)), closes [#845](https://github.com/documentationjs/documentation/issues/845) + + + # [5.1.0](https://github.com/documentationjs/documentation/compare/v5.0.1...v5.1.0) (2017-07-31) diff --git a/package.json b/package.json index dbaae3f6c..584138d61 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.1.0", + "version": "5.1.1", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 2dfe7427ae3095270d1a495d31476b1890123776 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Mon, 7 Aug 2017 10:05:24 +0300 Subject: [PATCH 097/555] Fixed unit tests after put the tag v5.1.1 --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 9cc2ffb00..fbd8cf97f 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.1.0 | Documentation + documentation 5.1.1 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.1.0
    +
    5.1.1
    - documentation 5.1.0 | Documentation + documentation 5.1.1 | Documentation @@ -760,7 +760,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.1.0
    +
    5.1.1
    Date: Wed, 9 Aug 2017 00:27:10 +0300 Subject: [PATCH 098/555] fix: alphabetical sort and add flow notation to sort file (#861) * Removed sort by memberof, when the memberOf is the same of items then sort function doesn't works correctly. Added Unit Tests Fixed #838 * Flow.js : added flow notation for sort.js --- __tests__/lib/__snapshots__/sort.js.snap | 26 ++++++++++++++++++++ __tests__/lib/sort.js | 31 +++++++++++++++++++++++- src/sort.js | 16 +++++------- 3 files changed, 62 insertions(+), 11 deletions(-) diff --git a/__tests__/lib/__snapshots__/sort.js.snap b/__tests__/lib/__snapshots__/sort.js.snap index ff8f5c7cc..134b42c51 100644 --- a/__tests__/lib/__snapshots__/sort.js.snap +++ b/__tests__/lib/__snapshots__/sort.js.snap @@ -107,3 +107,29 @@ Array [ }, ] `; + +exports[`sort toc with files absolute path 2`] = ` +Array [ + Object { + "context": Object { + "sortKey": "a", + }, + "memberof": "classB", + "name": "apples", + }, + Object { + "context": Object { + "sortKey": "c", + }, + "memberof": "classB", + "name": "bananas", + }, + Object { + "context": Object { + "sortKey": "b", + }, + "memberof": "classB", + "name": "carrot", + }, +] +`; diff --git a/__tests__/lib/sort.js b/__tests__/lib/sort.js index df6ca8856..cdc7b2a11 100644 --- a/__tests__/lib/sort.js +++ b/__tests__/lib/sort.js @@ -1,4 +1,5 @@ -var sort = require('../../src/sort'), path = require('path'); +var sort = require('../../src/sort'), + path = require('path'); test('sort stream alphanumeric', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; @@ -204,3 +205,31 @@ test('sort toc with files absolute path', function() { }) ).toMatchSnapshot(); }); + +test('sort toc with files absolute path', function() { + var apples = { + context: { sortKey: 'a' }, + name: 'apples', + memberof: 'classB' + }; + var carrot = { + context: { sortKey: 'b' }, + name: 'carrot', + memberof: 'classB' + }; + var bananas = { + context: { sortKey: 'c' }, + name: 'bananas', + memberof: 'classB' + }; + + var snowflake = { + name: 'snowflake', + file: path.join(__dirname, '../fixture/snowflake.md') + }; + expect( + sort([carrot, apples, bananas], { + sortOrder: 'alpha' + }) + ).toMatchSnapshot(); +}); diff --git a/src/sort.js b/src/sort.js index 2bc54bd51..0a8b0176f 100644 --- a/src/sort.js +++ b/src/sort.js @@ -94,25 +94,21 @@ module.exports = function sortDocs(comments: Array, options: Object) { return fixed.concat(unfixed); }; -function compare(a: string, b: string) { - return a.localeCompare(b, undefined, { caseFirst: 'upper' }); -} - -function compareCommentsByName(a, b) { - var akey = a.memberof || a.name; - var bkey = b.memberof || b.name; +function compareCommentsByName(a: Comment, b: Comment): number { + const akey: ?string = a.name; + const bkey: ?string = b.name; if (akey && bkey) { - return compare(akey, bkey); + return akey.localeCompare(bkey, undefined, { caseFirst: 'upper' }); } return 0; } -function compareCommentsBySourceLocation(a, b) { +function compareCommentsBySourceLocation(a: Comment, b: Comment): number { return a.context.sortKey.localeCompare(b.context.sortKey); } -function sortComments(comments, sortOrder) { +function sortComments(comments: Array, sortOrder: string) { return comments.sort( sortOrder === 'alpha' ? compareCommentsByName From e73dd982a72cf110fd491df96059f7211aba5479 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 9 Aug 2017 00:28:19 +0300 Subject: [PATCH 099/555] chore: Updated Flow.js dependency on 0.52.0 (#862) --- package.json | 6 +++--- src/commands/readme.js | 19 +++++++++++-------- src/extractors/exported.js | 2 +- src/parse.js | 7 ++++--- src/parsers/javascript.js | 2 +- src/smart_glob.js | 7 ++++--- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 584138d61..b10ba4377 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "eslint": "^4.1.1", "eslint-config-prettier": "^2.3.0", "eslint-plugin-flowtype": "^2.34.1", - "flow-bin": "^0.46.0", + "flow-bin": "^0.52.0", "fs-extra": "^4.0.0", "husky": "^0.14.0", "jest": "^20.0.4", @@ -102,7 +102,7 @@ "precommit": "lint-staged --verbose", "prepublish": "npm run build", "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", - "doc": "./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", + "doc": "node ./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", "self-lint": "node ./bin/documentation.js lint src", "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" @@ -139,4 +139,4 @@ "yargs" ] } -} +} \ No newline at end of file diff --git a/src/commands/readme.js b/src/commands/readme.js index 81176c29b..ada303bb6 100644 --- a/src/commands/readme.js +++ b/src/commands/readme.js @@ -17,7 +17,8 @@ module.exports.description = 'inject documentation into your README.md'; * @private */ module.exports.builder = { - usage: 'Usage: documentation readme [--readme-file=README.md] --section "API"' + + usage: + 'Usage: documentation readme [--readme-file=README.md] --section "API"' + ' [--compare-only] [other documentationjs options]', example: 'documentation readme index.js -s "API Docs" --github', 'readme-file': { @@ -26,12 +27,14 @@ module.exports.builder = { }, section: { alias: 's', - describe: 'The section heading after which to inject generated documentation', + describe: + 'The section heading after which to inject generated documentation', required: true }, 'diff-only': { alias: 'd', - describe: 'Instead of updating the given README with the generated documentation,' + + describe: + 'Instead of updating the given README with the generated documentation,' + ' just check if its contents match, exiting nonzero if not.', default: false }, @@ -42,8 +45,6 @@ module.exports.builder = { } }; -function noop() {} - /** * Insert API documentation into a Markdown readme * @private @@ -68,9 +69,11 @@ module.exports.handler = function readme(argv: Object) { argv.format = 'remark'; /* eslint no-console: 0 */ - var log = argv.q - ? noop - : console.log.bind(console, '[documentation-readme] '); + const log: Function = (...data: Array) => { + if (!argv.q) { + console.log.apply(console, data); + } + }; var readmeContent = fs.readFileSync(argv.readmeFile, 'utf8'); diff --git a/src/extractors/exported.js b/src/extractors/exported.js index e9be88a44..6d36eea6b 100644 --- a/src/extractors/exported.js +++ b/src/extractors/exported.js @@ -184,7 +184,7 @@ function getCachedData(dataCache, filePath) { var value = dataCache.get(path); if (!value) { var input = fs.readFileSync(path, 'utf-8'); - var ast = parseToAst(input, path); + var ast = parseToAst(input); value = { data: { file: path, diff --git a/src/parse.js b/src/parse.js index 49b60d4de..048da3c8b 100644 --- a/src/parse.js +++ b/src/parse.js @@ -414,9 +414,10 @@ function todo() {} * @param {string} key the eventual destination key * @returns {Function} a flattener that remembers that key */ -function synonym(key) { - return function(result, tag) { - return flatteners[key](result, tag, key); +function synonym(key: string) { + return function(result: Object, tag: Object) { + const fun = flatteners[key]; + fun.apply(null, [result, tag, key].slice(0, fun.length)); }; } diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js index 30690d1d3..7b2157bda 100644 --- a/src/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -37,7 +37,7 @@ function leftPad(str, width) { function parseJavaScript(data: Object, config: DocumentationConfig) { var visited = new Set(); - var ast = parseToAst(data.source, data.file); + var ast = parseToAst(data.source); var addComment = _addComment.bind(null, visited); return _.flatMap( diff --git a/src/smart_glob.js b/src/smart_glob.js index 8dc026b88..64122caf6 100644 --- a/src/smart_glob.js +++ b/src/smart_glob.js @@ -86,7 +86,8 @@ function resolveFileGlobPatterns(patterns, extensions) { * @returns Resolved absolute filenames. */ function listFilesToProcess(globPatterns: Array): Array { - var files = [], added = new Set(); + var files = [], + added = new Set(); var cwd = process.cwd(); @@ -107,7 +108,7 @@ function listFilesToProcess(globPatterns: Array): Array { globPatterns.forEach(function(pattern) { var file = path.resolve(cwd, pattern); if (shell.test('-f', file)) { - addFile(fs.realpathSync(file), !shell.test('-d', file)); + addFile(fs.realpathSync(file)); } else { var globOptions = { nodir: true, @@ -116,7 +117,7 @@ function listFilesToProcess(globPatterns: Array): Array { }; glob.sync(pattern, globOptions).forEach(function(globMatch) { - addFile(path.resolve(cwd, globMatch), false); + addFile(path.resolve(cwd, globMatch)); }); } }); From 23aa981c30939b7cbe4ba07534b1c209b8fb6783 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 9 Aug 2017 12:21:54 -0400 Subject: [PATCH 100/555] feat: convert Flow's ThisTypeAnnotation to a doctrine NameExpression (#870) --- __tests__/lib/flow_doctrine.js | 6 +++++- src/flow_doctrine.js | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/__tests__/lib/flow_doctrine.js b/__tests__/lib/flow_doctrine.js index 00365694c..871acbd31 100644 --- a/__tests__/lib/flow_doctrine.js +++ b/__tests__/lib/flow_doctrine.js @@ -295,11 +295,15 @@ test('flowDoctrine', function() { type: 'VoidLiteral' }); + expect(toDoctrineType('this')).toEqual({ + type: 'NameExpression', + name: 'this' + }); + // TODO: remove all these types expect(types).toEqual([ 'IntersectionTypeAnnotation', 'EmptyTypeAnnotation', - 'ThisTypeAnnotation', 'TypeofTypeAnnotation' ]); }); diff --git a/src/flow_doctrine.js b/src/flow_doctrine.js index 031c4124e..25f18f756 100644 --- a/src/flow_doctrine.js +++ b/src/flow_doctrine.js @@ -152,6 +152,11 @@ function flowDoctrine(type: Object): DoctrineType { type: 'StringLiteralType', value: type.value }; + case 'ThisTypeAnnotation': + return { + type: 'NameExpression', + name: 'this' + }; default: return { type: 'AllLiteral' From 0324865ad55beb95f97f9d53280e687fd7c7cab9 Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 9 Aug 2017 20:25:32 +0300 Subject: [PATCH 101/555] fix: make html and markdown second option optional (#871) Fixed #869 --- docs/NODE_API.md | 4 ++-- src/output/html.js | 4 ++-- src/output/markdown.js | 8 ++++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/NODE_API.md b/docs/NODE_API.md index 6a1cbe0ad..26a85d7a0 100644 --- a/docs/NODE_API.md +++ b/docs/NODE_API.md @@ -105,7 +105,7 @@ Formats documentation as HTML. **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment)>** parsed comments -- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output +- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) - `config.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of a module used for an HTML theme. (optional, default `'default_theme'`) **Examples** @@ -132,7 +132,7 @@ Formats documentation as **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) **Examples** diff --git a/src/output/html.js b/src/output/html.js index 16a5f6f81..d7a4e0614 100644 --- a/src/output/html.js +++ b/src/output/html.js @@ -23,8 +23,8 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments: Array, config: DocumentationConfig) { - return mergeConfig(config).then(config => { +function html(comments: Array, config: Object = {}) { + return mergeConfig(config).then((config: DocumentationConfig) => { var themePath = '../default_theme/'; if (config.theme) { themePath = path.resolve(process.cwd(), config.theme); diff --git a/src/output/markdown.js b/src/output/markdown.js index 29a3127e2..f496be07f 100644 --- a/src/output/markdown.js +++ b/src/output/markdown.js @@ -1,6 +1,7 @@ /* @flow */ -var remark = require('remark'), markdownAST = require('./markdown_ast'); +var remark = require('remark'), + markdownAST = require('./markdown_ast'); /** * Formats documentation as @@ -22,7 +23,10 @@ var remark = require('remark'), markdownAST = require('./markdown_ast'); * fs.writeFileSync('./output.md', output); * }); */ -function markdown(comments: Array, args: Object): Promise { +function markdown( + comments: Array, + args: Object = {} +): Promise { return markdownAST(comments, args).then(ast => remark().stringify(ast)); } From 77e348cfd0068b173c5381902a7167d49c2f030d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 9 Aug 2017 15:20:51 -0700 Subject: [PATCH 102/555] chore(release): 5.2.0 --- CHANGELOG.md | 16 ++++++++++++++++ package.json | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c2b16974..5f6750d24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [5.2.0](https://github.com/documentationjs/documentation/compare/v5.1.1...v5.2.0) (2017-08-09) + + +### Bug Fixes + +* alphabetical sort and add flow notation to sort file ([#861](https://github.com/documentationjs/documentation/issues/861)) ([aa3496a](https://github.com/documentationjs/documentation/commit/aa3496a)), closes [#838](https://github.com/documentationjs/documentation/issues/838) +* make html and markdown second option optional ([#871](https://github.com/documentationjs/documentation/issues/871)) ([0324865](https://github.com/documentationjs/documentation/commit/0324865)), closes [#869](https://github.com/documentationjs/documentation/issues/869) + + +### Features + +* convert Flow's ThisTypeAnnotation to a doctrine NameExpression ([#870](https://github.com/documentationjs/documentation/issues/870)) ([23aa981](https://github.com/documentationjs/documentation/commit/23aa981)) + + + ## [5.1.1](https://github.com/documentationjs/documentation/compare/v5.1.0...v5.1.1) (2017-08-04) diff --git a/package.json b/package.json index b10ba4377..47eb1384b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.1.1", + "version": "5.2.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" @@ -139,4 +139,4 @@ "yargs" ] } -} \ No newline at end of file +} From ffdfa21788cb8c51e0063a3b2c7b97cb9b94fc01 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 9 Aug 2017 15:22:59 -0700 Subject: [PATCH 103/555] chore: Update tests for new tag --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index fbd8cf97f..88a453630 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.1.1 | Documentation + documentation 5.2.0 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.1.1
    +
    5.2.0
    - documentation 5.1.1 | Documentation + documentation 5.2.0 | Documentation @@ -760,7 +760,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.1.1
    +
    5.2.0
    Date: Sat, 12 Aug 2017 13:44:46 -0700 Subject: [PATCH 104/555] chore(package): update tmp to version 0.0.33 (#877) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47eb1384b..604803272 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "p-event": "^1.0.0", "prettier": "^1.0.0", "standard-version": "^4.0.0", - "tmp": "^0.0.31" + "tmp": "^0.0.33" }, "keywords": [ "documentation", From e0b605f8177c24426ae029bcd3edbe542060bf0a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 11 Aug 2017 14:27:58 -0700 Subject: [PATCH 105/555] style: Avoid optional parameter syntax Supporting this syntax uncorks a whole bottle of worms and requires participation in more of the JavaScript ecosystem and is not worthwhile in my opinion at this time. Fixes #873 --- docs/NODE_API.md | 4 ++-- src/output/html.js | 5 ++++- src/output/markdown.js | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/NODE_API.md b/docs/NODE_API.md index 26a85d7a0..6a1cbe0ad 100644 --- a/docs/NODE_API.md +++ b/docs/NODE_API.md @@ -105,7 +105,7 @@ Formats documentation as HTML. **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Comment](https://developer.mozilla.org/en-US/docs/Web/API/Comment/Comment)>** parsed comments -- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) +- `config` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output - `config.theme` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Name of a module used for an HTML theme. (optional, default `'default_theme'`) **Examples** @@ -132,7 +132,7 @@ Formats documentation as **Parameters** - `comments` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** parsed comments -- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output (optional, default `{}`) +- `args` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options that can customize the output **Examples** diff --git a/src/output/html.js b/src/output/html.js index d7a4e0614..35485702d 100644 --- a/src/output/html.js +++ b/src/output/html.js @@ -23,7 +23,10 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments: Array, config: Object = {}) { +function html(comments: Array, config?: Object) { + if (!config) { + config = {}; + } return mergeConfig(config).then((config: DocumentationConfig) => { var themePath = '../default_theme/'; if (config.theme) { diff --git a/src/output/markdown.js b/src/output/markdown.js index f496be07f..aa0aad5df 100644 --- a/src/output/markdown.js +++ b/src/output/markdown.js @@ -23,10 +23,10 @@ var remark = require('remark'), * fs.writeFileSync('./output.md', output); * }); */ -function markdown( - comments: Array, - args: Object = {} -): Promise { +function markdown(comments: Array, args?: Object): Promise { + if (!args) { + args = {}; + } return markdownAST(comments, args).then(ast => remark().stringify(ast)); } From 6a8a3f6310cfbf711dffab721ec67eb2703a90ce Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 11 Aug 2017 14:33:06 -0700 Subject: [PATCH 106/555] ci: Reduce node version on CircleCI to 4 --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 3569827f5..9e1b2b93a 100644 --- a/circle.yml +++ b/circle.yml @@ -1,6 +1,6 @@ machine: node: - version: 7 + version: 4 test: override: - npm run test-ci From 25d0cfaadef3182a60efebf39d5ae3c9f5f866df Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 12 Aug 2017 14:19:25 -0700 Subject: [PATCH 107/555] build: Use stage-0 and es2015 for transpiling documentation.js --- .babelrc | 8 ++------ package.json | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.babelrc b/.babelrc index d4ffb33d6..9597d17b6 100644 --- a/.babelrc +++ b/.babelrc @@ -1,8 +1,4 @@ { - "presets": ["flow"], - "plugins": [ - ["transform-es2015-modules-commonjs", { - "allowTopLevelThis": true - }] - ] + "presets": ["es2015", "stage-0", "flow"], + "plugins": ["syntax-async-functions"] } diff --git a/package.json b/package.json index 604803272..1774efda4 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", "babel-jest": "^20.0.1", + "babel-plugin-syntax-async-functions": "^6.13.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", @@ -79,6 +80,7 @@ "mock-fs": "^4.2.0", "p-event": "^1.0.0", "prettier": "^1.0.0", + "regenerator-runtime": "^0.10.5", "standard-version": "^4.0.0", "tmp": "^0.0.33" }, From 8278fa442c28688e790668b6c04f11f3c89db08e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 12 Aug 2017 14:26:27 -0700 Subject: [PATCH 108/555] chore: Update yarn.lock --- yarn.lock | 268 +++++------------------------------------------------- 1 file changed, 23 insertions(+), 245 deletions(-) diff --git a/yarn.lock b/yarn.lock index e73b01363..23a3c3c62 100644 --- a/yarn.lock +++ b/yarn.lock @@ -41,10 +41,6 @@ acorn@^5.0.1: version "5.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" -add-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" - ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -219,7 +215,7 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async@^1.4.0, async@^1.5.0: +async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -478,7 +474,7 @@ babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" -babel-plugin-syntax-async-functions@^6.8.0: +babel-plugin-syntax-async-functions@^6.13.0, babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -1111,10 +1107,6 @@ builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" -byline@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" - bytes@1: version "1.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" @@ -1316,7 +1308,7 @@ clone-stats@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" -clone@^1.0.0, clone@^1.0.2: +clone@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" @@ -1332,13 +1324,6 @@ cloneable-readable@^1.0.0: process-nextick-args "^1.0.6" through2 "^2.0.1" -cmd-shim@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" - dependencies: - graceful-fs "^4.1.2" - mkdirp "~0.5.0" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1369,13 +1354,6 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -columnify@^1.5.4: - version "1.5.4" - resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" - dependencies: - strip-ansi "^3.0.0" - wcwidth "^1.0.0" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1388,10 +1366,6 @@ comma-separated-tokens@^1.0.1: dependencies: trim "0.0.1" -command-join@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/command-join/-/command-join-2.0.0.tgz#52e8b984f4872d952ff1bdc8b98397d27c7144cf" - commander@^2.8.1, commander@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" @@ -1454,16 +1428,6 @@ conventional-changelog-atom@^0.1.0: dependencies: q "^1.4.1" -conventional-changelog-cli@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.2.tgz#33abf2b5720a9b094df38e81741ccb502e1a4125" - dependencies: - add-stream "^1.0.0" - conventional-changelog "^1.1.4" - lodash "^4.1.0" - meow "^3.7.0" - tempfile "^1.1.1" - conventional-changelog-codemirror@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.1.0.tgz#7577a591dbf9b538e7a150a7ee62f65a2872b334" @@ -1540,7 +1504,7 @@ conventional-changelog-writer@^1.1.0: split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.0, conventional-changelog@^1.1.4: +conventional-changelog@^1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.4.tgz#108bc750c2a317e200e2f9b413caaa1f8c7efa3b" dependencies: @@ -1715,10 +1679,6 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1733,12 +1693,6 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - dependencies: - clone "^1.0.2" - define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -1787,10 +1741,6 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" -detect-indent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" - detective@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/detective/-/detective-4.5.0.tgz#6e5a8c6b26e6c7a254b1c6b6d7490d98ec91edd1" @@ -1843,10 +1793,6 @@ duplexer2@^0.1.2, duplexer2@~0.1.0: dependencies: readable-stream "^2.0.2" -duplexer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" - duplexify@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" @@ -2016,18 +1962,6 @@ exec-sh@^0.2.0: dependencies: merge "^1.1.3" -execa@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -2211,9 +2145,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.46.0: - version "0.46.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.46.0.tgz#06ad7fe19dddb1042264438064a2a32fee12b872" +flow-bin@^0.52.0: + version "0.52.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.52.0.tgz#b6d9abe8bcd1ee5c62df386451a4e2553cadc3a3" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" @@ -2249,14 +2183,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-extra@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291" - dependencies: - graceful-fs "^4.1.2" - jsonfile "^3.0.0" - universalify "^0.1.0" - fs-extra@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e" @@ -2500,16 +2426,6 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2927,7 +2843,7 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" -is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: +is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -3468,46 +3384,6 @@ lcov-parse@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" -lerna@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-2.0.0.tgz#49a72fe70e06aebfd7ea23efb2ab41abe60ebeea" - dependencies: - async "^1.5.0" - chalk "^1.1.1" - cmd-shim "^2.0.2" - columnify "^1.5.4" - command-join "^2.0.0" - conventional-changelog-cli "^1.3.1" - conventional-recommended-bump "^1.0.0" - dedent "^0.7.0" - execa "^0.6.3" - find-up "^2.1.0" - fs-extra "^3.0.1" - get-port "^3.1.0" - glob "^7.1.2" - globby "^6.1.0" - graceful-fs "^4.1.11" - inquirer "^3.0.6" - is-ci "^1.0.10" - load-json-file "^2.0.0" - lodash "^4.17.4" - minimatch "^3.0.4" - npmlog "^4.1.0" - p-finally "^1.0.0" - path-exists "^3.0.0" - read-cmd-shim "^1.0.1" - read-pkg "^2.0.0" - rimraf "^2.6.1" - safe-buffer "^5.0.1" - semver "^5.1.0" - signal-exit "^3.0.2" - strong-log-transformer "^1.0.6" - temp-write "^3.3.0" - write-file-atomic "^2.1.0" - write-json-file "^2.1.0" - write-pkg "^3.0.1" - yargs "^8.0.1" - leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3639,7 +3515,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.1.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3688,12 +3564,6 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -make-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" - dependencies: - pify "^2.3.0" - makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" @@ -3776,7 +3646,7 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -meow@^3.3.0, meow@^3.7.0: +meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -3869,10 +3739,6 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -minimist@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de" - mixin-deep@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.2.0.tgz#d02b8c6f8b6d4b8f5982d3fd009c4919851c3fe2" @@ -3880,7 +3746,7 @@ mixin-deep@^1.1.3: for-in "^1.0.2" is-extendable "^0.1.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3913,10 +3779,6 @@ module-deps-sortable@4.0.6: through2 "^2.0.0" xtend "^4.0.0" -moment@^2.6.0: - version "2.18.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" @@ -4027,7 +3889,7 @@ npm-which@^3.0.1: npm-path "^2.0.2" which "^1.2.10" -npmlog@^4.0.2, npmlog@^4.1.0: +npmlog@^4.0.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" dependencies: @@ -4157,7 +4019,7 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -4339,7 +4201,7 @@ performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" -pify@^2.0.0, pify@^2.2.0, pify@^2.3.0: +pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -4455,12 +4317,6 @@ rc@^1.1.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -read-cmd-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" - dependencies: - graceful-fs "^4.1.2" - read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -4561,7 +4417,7 @@ regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" -regenerator-runtime@^0.10.0: +regenerator-runtime@^0.10.0, regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" @@ -4937,10 +4793,6 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" -slide@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -4974,18 +4826,6 @@ sntp@1.x.x: dependencies: hoek "2.x.x" -sort-keys@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" - dependencies: - is-plain-obj "^1.0.0" - -sort-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" - dependencies: - is-plain-obj "^1.0.0" - source-map-resolve@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.0.tgz#fcad0b64b70afb27699e425950cb5ebcd410bc20" @@ -5220,16 +5060,6 @@ strip-json-comments@^2.0.0, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -strong-log-transformer@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-1.0.6.tgz#f7fb93758a69a571140181277eea0c2eb1301fa3" - dependencies: - byline "^5.0.0" - duplexer "^0.1.1" - minimist "^0.1.0" - moment "^2.6.0" - through "^2.3.4" - subarg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" @@ -5292,28 +5122,6 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -temp-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" - -temp-write@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-3.3.0.tgz#c1a96de2b36061342eae81f44ff001aec8f615a9" - dependencies: - graceful-fs "^4.1.2" - is-stream "^1.1.0" - make-dir "^1.0.0" - pify "^2.2.0" - temp-dir "^1.0.0" - uuid "^3.0.1" - -tempfile@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/tempfile/-/tempfile-1.1.1.tgz#5bcc4eaecc4ab2c707d8bc11d99ccc9a2cb287f2" - dependencies: - os-tmpdir "^1.0.0" - uuid "^2.0.1" - test-exclude@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" @@ -5357,7 +5165,7 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@~2.0.0: readable-stream "^2.1.5" xtend "~4.0.1" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -5378,6 +5186,12 @@ tmp@^0.0.31: dependencies: os-tmpdir "~1.0.1" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" @@ -5612,11 +5426,7 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" -uuid@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" - -uuid@^3.0.0, uuid@^3.0.1: +uuid@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" @@ -5724,12 +5534,6 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" -wcwidth@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - dependencies: - defaults "^1.0.3" - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -5819,32 +5623,6 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.1.0.tgz#1769f4b551eedce419f0505deae2e26763542d37" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - -write-json-file@^2.1.0, write-json-file@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.2.0.tgz#51862506bbb3b619eefab7859f1fd6c6d0530876" - dependencies: - detect-indent "^5.0.0" - graceful-fs "^4.1.2" - make-dir "^1.0.0" - pify "^2.0.0" - sort-keys "^1.1.1" - write-file-atomic "^2.0.0" - -write-pkg@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.1.0.tgz#030a9994cc9993d25b4e75a9f1a1923607291ce9" - dependencies: - sort-keys "^2.0.0" - write-json-file "^2.2.0" - write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" From e9d734b6a6eb1087bce0d1c261200e7b4b7ab26c Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 12 Aug 2017 14:30:32 -0700 Subject: [PATCH 109/555] chore(release): 5.2.1 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f6750d24..0d19248db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.2.1](https://github.com/documentationjs/documentation/compare/v5.2.0...v5.2.1) (2017-08-12) + + + # [5.2.0](https://github.com/documentationjs/documentation/compare/v5.1.1...v5.2.0) (2017-08-09) diff --git a/package.json b/package.json index 1774efda4..32ad3779f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.2.0", + "version": "5.2.1", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 762bca9d50730bdef6a70d0e647f4baaccb5bfa1 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 15 Aug 2017 19:26:35 +0000 Subject: [PATCH 110/555] chore(package): update regenerator-runtime to version 0.11.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 32ad3779f..e712ad75c 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "mock-fs": "^4.2.0", "p-event": "^1.0.0", "prettier": "^1.0.0", - "regenerator-runtime": "^0.10.5", + "regenerator-runtime": "^0.11.0", "standard-version": "^4.0.0", "tmp": "^0.0.33" }, From eddfcc29857b0349c01bc7b69e13f1958aafcceb Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Wed, 16 Aug 2017 12:46:30 +0300 Subject: [PATCH 111/555] chore: Update tests for new tag --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 88a453630..456eced67 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.2.0 | Documentation + documentation 5.2.1 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.2.0
    +
    5.2.1
    - documentation 5.2.0 | Documentation + documentation 5.2.1 | Documentation @@ -760,7 +760,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.2.0
    +
    5.2.1
    Date: Wed, 16 Aug 2017 10:54:45 -0700 Subject: [PATCH 112/555] chore: Use tilde dependency on babel-generator --- package.json | 2 +- yarn.lock | 452 ++++++++++++++++++++++++++------------------------- 2 files changed, 235 insertions(+), 219 deletions(-) diff --git a/package.json b/package.json index e712ad75c..4e62e4566 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "ansi-html": "^0.0.7", "babel-core": "^6.17.0", - "babel-generator": "6.25.0", + "babel-generator": "^6.25.0", "babel-plugin-system-import-transformer": "3.1.0", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-preset-es2015": "^6.16.0", diff --git a/yarn.lock b/yarn.lock index 23a3c3c62..546532125 100644 --- a/yarn.lock +++ b/yarn.lock @@ -37,7 +37,7 @@ acorn@^4.0.3, acorn@^4.0.4: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^5.0.1: +acorn@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" @@ -104,11 +104,11 @@ ansi-styles@^3.0.0, ansi-styles@^3.1.0: color-convert "^1.9.0" anymatch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" dependencies: - arrify "^1.0.0" micromatch "^2.1.5" + normalize-path "^2.0.0" app-root-path@^2.0.0: version "2.0.1" @@ -242,57 +242,57 @@ aws4@^1.2.1: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" babel-cli@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.1.tgz#207cd705bba61489b2ea41b5312341cf6aca2283" - dependencies: - babel-core "^6.24.1" - babel-polyfill "^6.23.0" - babel-register "^6.24.1" - babel-runtime "^6.22.0" - commander "^2.8.1" - convert-source-map "^1.1.0" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" fs-readdir-recursive "^1.0.0" - glob "^7.0.0" - lodash "^4.2.0" - output-file-sync "^1.1.0" - path-is-absolute "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" slash "^1.0.0" - source-map "^0.5.0" - v8flags "^2.0.10" + source-map "^0.5.6" + v8flags "^2.1.1" optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" +babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: - chalk "^1.1.0" + chalk "^1.1.3" esutils "^2.0.2" - js-tokens "^3.0.0" + js-tokens "^3.0.2" -babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.25.0.tgz#7dd42b0463c742e9d5296deb3ec67a9322dad729" +babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" dependencies: - babel-code-frame "^6.22.0" - babel-generator "^6.25.0" + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" babel-helpers "^6.24.1" babel-messages "^6.23.0" - babel-register "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.25.0" - babel-traverse "^6.25.0" - babel-types "^6.25.0" - babylon "^6.17.2" - convert-source-map "^1.1.0" - debug "^2.1.1" - json5 "^0.5.0" - lodash "^4.2.0" - minimatch "^3.0.2" - path-is-absolute "^1.0.0" - private "^0.1.6" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" slash "^1.0.0" - source-map "^0.5.0" + source-map "^0.5.6" babel-eslint@^7.2.3: version "7.2.3" @@ -303,17 +303,17 @@ babel-eslint@^7.2.3: babel-types "^6.23.0" babylon "^6.17.0" -babel-generator@6.25.0, babel-generator@^6.18.0, babel-generator@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" +babel-generator@^6.18.0, babel-generator@^6.25.0, babel-generator@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" dependencies: babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" detect-indent "^4.0.0" jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" + lodash "^4.17.4" + source-map "^0.5.6" trim-right "^1.0.1" babel-helper-bindify-decorators@^6.24.1: @@ -333,12 +333,12 @@ babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: babel-types "^6.24.1" babel-helper-builder-react-jsx@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.24.1.tgz#0ad7917e33c8d751e646daca4e77cc19377d2cbc" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz#39ff8313b75c8b65dceff1f31d383e0ff2a408a0" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - esutils "^2.0.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + esutils "^2.0.2" babel-helper-call-delegate@^6.24.1: version "6.24.1" @@ -350,13 +350,13 @@ babel-helper-call-delegate@^6.24.1: babel-types "^6.24.1" babel-helper-define-map@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.24.1.tgz#7a9747f258d8947d32d515f6aa1c7bd02204a080" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" dependencies: babel-helper-function-name "^6.24.1" - babel-runtime "^6.22.0" - babel-types "^6.24.1" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" babel-helper-explode-assignable-expression@^6.24.1: version "6.24.1" @@ -407,12 +407,12 @@ babel-helper-optimise-call-expression@^6.24.1: babel-types "^6.24.1" babel-helper-regex@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.24.1.tgz#d36e22fab1008d79d88648e32116868128456ce8" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" dependencies: - babel-runtime "^6.22.0" - babel-types "^6.24.1" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" babel-helper-remap-async-to-generator@^6.24.1: version "6.24.1" @@ -607,14 +607,14 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: babel-runtime "^6.22.0" babel-plugin-transform-es2015-block-scoping@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" dependencies: - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-traverse "^6.24.1" - babel-types "^6.24.1" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" babel-plugin-transform-es2015-classes@^6.24.1: version "6.24.1" @@ -679,13 +679,13 @@ babel-plugin-transform-es2015-modules-amd@^6.24.1: babel-template "^6.24.1" babel-plugin-transform-es2015-modules-commonjs@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.24.1.tgz#d3e310b40ef664a36622200097c6d440298f2bfe" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" dependencies: babel-plugin-transform-strict-mode "^6.24.1" - babel-runtime "^6.22.0" - babel-template "^6.24.1" - babel-types "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" babel-plugin-transform-es2015-modules-systemjs@^6.24.1: version "6.24.1" @@ -792,11 +792,11 @@ babel-plugin-transform-function-bind@^6.22.0: babel-runtime "^6.22.0" babel-plugin-transform-object-rest-spread@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.23.0.tgz#875d6bc9be761c58a2ae3feee5dc4895d8c7f921" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz#0f36692d50fef6b7e2d4b3ac1478137a963b7b06" dependencies: babel-plugin-syntax-object-rest-spread "^6.8.0" - babel-runtime "^6.22.0" + babel-runtime "^6.26.0" babel-plugin-transform-react-display-name@^6.23.0: version "6.25.0" @@ -827,10 +827,10 @@ babel-plugin-transform-react-jsx@^6.24.1: babel-runtime "^6.22.0" babel-plugin-transform-regenerator@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.24.1.tgz#b8da305ad43c3c99b4848e4fe4037b770d23c418" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" dependencies: - regenerator-transform "0.9.11" + regenerator-transform "^0.10.0" babel-plugin-transform-strict-mode@^6.24.1: version "6.24.1" @@ -839,13 +839,13 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-polyfill@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" dependencies: - babel-runtime "^6.22.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" babel-preset-es2015@^6.16.0: version "6.24.1" @@ -934,57 +934,57 @@ babel-preset-stage-3@^6.24.1: babel-plugin-transform-exponentiation-operator "^6.24.1" babel-plugin-transform-object-rest-spread "^6.22.0" -babel-register@^6.24.1: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" dependencies: - babel-core "^6.24.1" - babel-runtime "^6.22.0" - core-js "^2.4.0" + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" home-or-tmp "^2.0.0" - lodash "^4.2.0" + lodash "^4.17.4" mkdirp "^0.5.1" - source-map-support "^0.4.2" + source-map-support "^0.4.15" -babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" +babel-runtime@^6.18.0, babel-runtime@^6.2.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" dependencies: core-js "^2.4.0" - regenerator-runtime "^0.10.0" + regenerator-runtime "^0.11.0" -babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.25.0, babel-template@^6.3.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0, babel-template@^6.3.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.25.0" - babel-types "^6.25.0" - babylon "^6.17.2" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" -babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" +babel-traverse@^6.16.0, babel-traverse@^6.18.0, babel-traverse@^6.23.1, babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" dependencies: - babel-code-frame "^6.22.0" + babel-code-frame "^6.26.0" babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" - babylon "^6.17.2" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" -babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" +babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" dependencies: - babel-runtime "^6.22.0" + babel-runtime "^6.26.0" esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" + lodash "^4.17.4" + to-fast-properties "^1.0.3" babelify@^7.3.0: version "7.3.0" @@ -993,9 +993,9 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@^6.17.0, babylon@^6.17.2, babylon@^6.17.4: - version "6.17.4" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" +babylon@^6.17.0, babylon@^6.17.2, babylon@^6.17.4, babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" bail@^1.0.0: version "1.0.2" @@ -1026,8 +1026,8 @@ bcrypt-pbkdf@^1.0.0: tweetnacl "^0.14.3" binary-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.9.0.tgz#66506c16ce6f4d6928a5b3cd6a33ca41e941e37b" + version "1.10.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" block-stream@*: version "0.0.9" @@ -1182,7 +1182,7 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1193,8 +1193,8 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: supports-color "^2.0.0" chalk@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" dependencies: ansi-styles "^3.1.0" escape-string-regexp "^1.0.5" @@ -1366,7 +1366,7 @@ comma-separated-tokens@^1.0.1: dependencies: trim "0.0.1" -commander@^2.8.1, commander@^2.9.0: +commander@^2.11.0, commander@^2.9.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" @@ -1566,7 +1566,7 @@ conventional-recommended-bump@^1.0.0: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.4.0: +convert-source-map@^1.1.1, convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -1574,11 +1574,11 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" +core-js@^2.4.0, core-js@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.0.tgz#569c050918be6486b3837552028ae0466b717086" -core-util-is@~1.0.0: +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1669,7 +1669,7 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.1.1, debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8, debug@~2.6.7: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8, debug@~2.6.7: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -1730,8 +1730,8 @@ delegates@^1.0.0: resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" detab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.0.tgz#485bd7954d2348092e998f7ff1a79fd9869d9b50" + version "2.0.1" + resolved "https://registry.yarnpkg.com/detab/-/detab-2.0.1.tgz#531f5e326620e2fd4f03264a905fb3bcc8af4df4" dependencies: repeat-string "^1.5.4" @@ -1794,10 +1794,10 @@ duplexer2@^0.1.2, duplexer2@~0.1.0: readable-stream "^2.0.2" duplexify@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" + version "3.5.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" dependencies: - end-of-stream "1.0.0" + end-of-stream "^1.0.0" inherits "^2.0.1" readable-stream "^2.0.0" stream-shift "^1.0.0" @@ -1816,11 +1816,11 @@ elegant-spinner@^1.0.1: version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" -end-of-stream@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" +end-of-stream@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" dependencies: - once "~1.3.0" + once "^1.4.0" errno@^0.1.4: version "0.1.4" @@ -1876,8 +1876,8 @@ eslint-scope@^3.7.1: estraverse "^4.1.1" eslint@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.3.0.tgz#fcd7c96376bbf34c85ee67ed0012a299642b108f" + version "4.4.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.4.1.tgz#99cd7eafcffca2ff99a5c8f5f2a474d6364b4bd3" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" @@ -1887,7 +1887,7 @@ eslint@^4.1.1: debug "^2.6.8" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.4.3" + espree "^3.5.0" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" @@ -1899,7 +1899,7 @@ eslint@^4.1.1: imurmurhash "^0.1.4" inquirer "^3.0.6" is-resolvable "^1.0.0" - js-yaml "^3.8.4" + js-yaml "^3.9.1" json-stable-stringify "^1.0.1" levn "^0.3.0" lodash "^4.17.4" @@ -1916,11 +1916,11 @@ eslint@^4.1.1: table "^4.0.1" text-table "~0.2.0" -espree@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" +espree@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" dependencies: - acorn "^5.0.1" + acorn "^5.1.1" acorn-jsx "^3.0.0" esprima@^2.6.0, esprima@^2.7.1: @@ -1952,7 +1952,7 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -esutils@^2.0.0, esutils@^2.0.2: +esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1974,6 +1974,18 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" @@ -2039,9 +2051,9 @@ extglob@^1.1.0: snapdragon "^0.8.1" to-regex "^2.1.0" -extsprintf@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +extsprintf@1.3.0, extsprintf@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" fast-deep-equal@^1.0.0: version "1.0.0" @@ -2184,8 +2196,8 @@ fs-access@^1.0.0: null-check "^1.0.0" fs-extra@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e" + version "4.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880" dependencies: graceful-fs "^4.1.2" jsonfile "^3.0.0" @@ -2411,7 +2423,7 @@ globals-docs@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.3.0.tgz#dca4088af196f7800f4eba783eaeff335cb6759c" -globals@^9.0.0, globals@^9.17.0: +globals@^9.17.0, globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -2652,7 +2664,7 @@ interpret@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" -invariant@^2.2.0: +invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: @@ -3231,7 +3243,7 @@ jest@^20.0.4: dependencies: jest-cli "^20.0.4" -js-tokens@^3.0.0: +js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -3242,9 +3254,9 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4: - version "3.9.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" +js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4, js-yaml@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -3254,8 +3266,8 @@ jsbn@~0.1.0: resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" jschardet@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.0.tgz#a61f310306a5a71188e1b1acd08add3cfbb08b1e" + version "1.5.1" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.5.1.tgz#c519f629f86b3a5bedba58a88d311309eec097f9" jsdom@^9.12.0: version "9.12.0" @@ -3307,7 +3319,7 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json5@^0.5.0: +json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -3330,13 +3342,13 @@ jsonpointer@^4.0.0: resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" jsprim@^1.2.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.0.tgz#a3b87e40298d8c380552d8cc7628a0bb95a22918" + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" dependencies: assert-plus "1.0.0" - extsprintf "1.0.2" + extsprintf "1.3.0" json-schema "0.2.3" - verror "1.3.6" + verror "1.10.0" kebab-case@^1.0.0: version "1.0.0" @@ -3355,8 +3367,8 @@ kind-of@^4.0.0: is-buffer "^1.1.5" kind-of@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.0.0.tgz#9038420f740b2e836ce48b34617bcb855947f2a9" + version "5.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.0.2.tgz#f57bec933d9a2209ffa96c5c08343607b7035fda" lazy-cache@^1.0.3: version "1.0.4" @@ -3396,12 +3408,12 @@ levn@^0.3.0, levn@~0.3.0: type-check "~0.3.2" lint-staged@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.2.tgz#8e83e11e9e1656c09b6117f6db0d55fd4960a1c0" + version "4.0.3" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.3.tgz#1ce55591bc2c83a781a90b69a0a0c8aa0fc6370b" dependencies: app-root-path "^2.0.0" cosmiconfig "^1.1.0" - execa "^0.7.0" + execa "^0.8.0" listr "^0.12.0" lodash.chunk "^4.2.0" minimatch "^3.0.0" @@ -3515,7 +3527,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3731,7 +3743,7 @@ mimic-fn@^1.0.0: dependencies: brace-expansion "^1.1.7" -minimist@0.0.8, minimist@~0.0.1: +minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -3739,6 +3751,10 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2 version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + mixin-deep@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.2.0.tgz#d02b8c6f8b6d4b8f5982d3fd009c4919851c3fe2" @@ -3859,7 +3875,7 @@ normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" -normalize-path@^2.0.1: +normalize-path@^2.0.0, normalize-path@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: @@ -3951,12 +3967,6 @@ once@^1.3.0, once@^1.3.3, once@^1.4.0: dependencies: wrappy "1" -once@~1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - dependencies: - wrappy "1" - onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" @@ -4030,7 +4040,7 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -output-file-sync@^1.1.0: +output-file-sync@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" dependencies: @@ -4153,7 +4163,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -4246,7 +4256,7 @@ pretty-format@^20.0.3: ansi-regex "^2.1.1" ansi-styles "^3.0.0" -private@^0.1.6: +private@^0.1.6, private@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" @@ -4417,13 +4427,17 @@ regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" -regenerator-runtime@^0.10.0, regenerator-runtime@^0.10.5: +regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" -regenerator-transform@0.9.11: - version "0.9.11" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" +regenerator-runtime@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" + +regenerator-transform@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.0.tgz#f9ab3eac9cc2de38431d996a6a8abf1c50f2e459" dependencies: babel-runtime "^6.18.0" babel-types "^6.19.0" @@ -4542,8 +4556,8 @@ remote-origin-url@0.4.0: parse-git-config "^0.2.0" remove-trailing-separator@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" repeat-element@^1.1.2: version "1.1.2" @@ -4703,8 +4717,8 @@ rx-lite@*, rx-lite@^4.0.8: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" rxjs@^5.0.0-beta.11: - version "5.4.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.2.tgz#2a3236fcbf03df57bae06fd6972fd99e5c08fcf7" + version "5.4.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.3.tgz#0758cddee6033d68e0fd53676f0f3596ce3d483f" dependencies: symbol-observable "^1.0.1" @@ -4835,7 +4849,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.2: +source-map-support@^0.4.15: version "0.4.15" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" dependencies: @@ -4851,7 +4865,7 @@ source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: +source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -4894,8 +4908,8 @@ split2@^2.0.0: through2 "^2.0.2" split@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.0.tgz#c4395ce683abcd254bc28fe1dabb6e5c27dcffae" + version "1.0.1" + resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" dependencies: through "2" @@ -5202,7 +5216,7 @@ to-absolute-glob@^0.1.1: dependencies: extend-shallow "^2.0.1" -to-fast-properties@^1.0.1: +to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -5430,7 +5444,7 @@ uuid@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04" -v8flags@^2.0.10: +v8flags@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" dependencies: @@ -5447,11 +5461,13 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -verror@1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" dependencies: - extsprintf "1.0.2" + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" vfile-location@^2.0.0: version "2.0.2" @@ -5539,8 +5555,8 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" webidl-conversions@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" websocket-driver@>=0.5.1: version "0.6.5" @@ -5574,8 +5590,8 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" which@^1.2.10, which@^1.2.12, which@^1.2.9: - version "1.2.14" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: isexe "^2.0.0" @@ -5606,8 +5622,8 @@ wordwrap@~1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" worker-farm@^1.3.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.4.1.tgz#a438bc993a7a7d133bcb6547c95eca7cff4897d8" + version "1.5.0" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.5.0.tgz#adfdf0cd40581465ed0a1f648f9735722afd5c8d" dependencies: errno "^0.1.4" xtend "^4.0.1" From 1ba5f03ad200f92c1bb4b2f3c1d899c51452a1ea Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 16 Aug 2017 08:00:11 +0000 Subject: [PATCH 113/555] chore(package): update flow-bin to version 0.53.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e62e4566..843b4c2fd 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.1.1", "eslint-config-prettier": "^2.3.0", "eslint-plugin-flowtype": "^2.34.1", - "flow-bin": "^0.52.0", + "flow-bin": "^0.53.0", "fs-extra": "^4.0.0", "husky": "^0.14.0", "jest": "^20.0.4", From 1286a1ff8725825cfceca378907fcd81bb53ec35 Mon Sep 17 00:00:00 2001 From: Jean-Luc Martin Date: Mon, 21 Aug 2017 17:11:41 -0400 Subject: [PATCH 114/555] fix($compile): prevent babel from transpiling non-module scripts in default_theme's assets Transpiling the assets in the default theme was causing `this` to be transpiled to `undefined`. The Babel config now ignores those files. 888 --- .babelrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 9597d17b6..dcbdcf171 100644 --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,7 @@ { "presets": ["es2015", "stage-0", "flow"], - "plugins": ["syntax-async-functions"] + "plugins": ["syntax-async-functions"], + "ignore": [ + "**/default_theme/assets/*" + ] } From 64a057369e31f6c62e1569cd592891d07b44820a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 22 Aug 2017 10:36:48 -0700 Subject: [PATCH 115/555] chore: Update yarn.lock --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 546532125..d93460f6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2157,9 +2157,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.52.0: - version "0.52.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.52.0.tgz#b6d9abe8bcd1ee5c62df386451a4e2553cadc3a3" +flow-bin@^0.53.0: + version "0.53.1" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.53.1.tgz#9b22b63a23c99763ae533ebbab07f88c88c97d84" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" From 2df8b4c196cf321d10df5fbb0a14dec7e23bb6a5 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 22 Aug 2017 10:58:55 -0700 Subject: [PATCH 116/555] chore(release): 5.2.2 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d19248db..e78d624e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.2.2](https://github.com/documentationjs/documentation/compare/v5.2.1...v5.2.2) (2017-08-22) + + +### Bug Fixes + +* **$compile:** prevent babel from transpiling non-module scripts in default_theme's assets ([1286a1f](https://github.com/documentationjs/documentation/commit/1286a1f)) + + + ## [5.2.1](https://github.com/documentationjs/documentation/compare/v5.2.0...v5.2.1) (2017-08-12) diff --git a/package.json b/package.json index 843b4c2fd..39b8aa208 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.2.1", + "version": "5.2.2", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From b486988cddf6d08add3a1923d988208e94bd7f62 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Thu, 24 Aug 2017 15:28:24 +0300 Subject: [PATCH 117/555] chore: Update tests for new tag --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 456eced67..1d55f33d1 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.2.1 | Documentation + documentation 5.2.2 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.2.1
    +
    5.2.2
    - documentation 5.2.1 | Documentation + documentation 5.2.2 | Documentation @@ -760,7 +760,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.2.1
    +
    5.2.2
    Date: Sat, 2 Sep 2017 10:20:47 -0700 Subject: [PATCH 118/555] style: Making return type params consistent with the rest of the code base (#894) --- src/commands/readme.js | 2 +- src/default_theme/assets/anchor.js | 12 ++++++------ src/extractors/comments.js | 2 +- src/filter_access.js | 2 +- src/github.js | 2 +- src/input/shallow.js | 2 +- src/is_jsdoc_comment.js | 2 +- src/lint.js | 2 +- src/module_filters.js | 2 +- src/nest.js | 2 +- src/output/markdown.js | 2 +- src/parse.js | 2 +- src/parsers/javascript.js | 2 +- src/sort.js | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/commands/readme.js b/src/commands/readme.js index ada303bb6..a5d113aef 100644 --- a/src/commands/readme.js +++ b/src/commands/readme.js @@ -49,7 +49,7 @@ module.exports.builder = { * Insert API documentation into a Markdown readme * @private * @param {Object} argv args from the CLI option parser - * @return {undefined} has the side-effect of writing a file or printing to stdout + * @returns {undefined} has the side-effect of writing a file or printing to stdout */ module.exports.handler = function readme(argv: Object) { argv._handled = true; diff --git a/src/default_theme/assets/anchor.js b/src/default_theme/assets/anchor.js index 0e55b515e..5c29527c6 100644 --- a/src/default_theme/assets/anchor.js +++ b/src/default_theme/assets/anchor.js @@ -49,7 +49,7 @@ /** * Checks to see if this device supports touch. Uses criteria pulled from Modernizr: * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40 - * @return {Boolean} - true if the current device supports touch. + * @returns {Boolean} - true if the current device supports touch. */ this.isTouchDevice = function() { return !!( @@ -62,7 +62,7 @@ * Add anchor links to page elements. * @param {String|Array|Nodelist} selector - A CSS selector for targeting the elements you wish to add anchor links * to. Also accepts an array or nodeList containing the relavant elements. - * @return {this} - The AnchorJS object + * @returns {this} - The AnchorJS object */ this.add = function(selector) { var elements, @@ -191,7 +191,7 @@ * Removes all anchorjs-links from elements targed by the selector. * @param {String|Array|Nodelist} selector - A CSS selector string targeting elements with anchor links, * OR a nodeList / array containing the DOM elements. - * @return {this} - The AnchorJS object + * @returns {this} - The AnchorJS object */ this.remove = function(selector) { var index, @@ -227,7 +227,7 @@ * remove extra hyphens, truncate, trim hyphens, and make lowercase. * * @param {String} text - Any text. Usually pulled from the webpage element we are linking to. - * @return {String} - hyphen-delimited text for use in IDs and URLs. + * @returns {String} - hyphen-delimited text for use in IDs and URLs. */ this.urlify = function(text) { // Regex for finding the nonsafe URL characters (many need escaping): & +$,:;=?@"#{}|^~[`%!'<>]./()*\ @@ -258,7 +258,7 @@ * Determines if this element already has an AnchorJS link on it. * Uses this technique: http://stackoverflow.com/a/5898748/1154642 * @param {HTMLElemnt} el - a DOM node - * @return {Boolean} true/false + * @returns {Boolean} true/false */ this.hasAnchorJSLink = function(el) { var hasLeftAnchor = @@ -276,7 +276,7 @@ * It also throws errors on any other inputs. Used to handle inputs to .add and .remove. * @param {String|Array|Nodelist} input - A CSS selector string targeting elements with anchor links, * OR a nodeList / array containing the DOM elements. - * @return {Array} - An array containing the elements we want. + * @returns {Array} - An array containing the elements we want. */ function _getElements(input) { var elements; diff --git a/src/extractors/comments.js b/src/extractors/comments.js index 8130e4dbe..6bf52eb83 100644 --- a/src/extractors/comments.js +++ b/src/extractors/comments.js @@ -35,7 +35,7 @@ function walkComments( * Parse a comment with doctrine and decorate the result with file position and code context. * * @param {Object} comment the current state of the parsed JSDoc comment - * @return {undefined} this emits data + * @returns {undefined} this emits data */ function parseComment(comment) { newResults.push( diff --git a/src/filter_access.js b/src/filter_access.js index ca05409a5..5ff4dbc6e 100644 --- a/src/filter_access.js +++ b/src/filter_access.js @@ -9,7 +9,7 @@ import { walk } from './walk'; * * @param {Array} [levels=['public', 'undefined', 'protected']] included access levels. * @param {Array} comments parsed comments (can be nested) - * @return {Array} filtered comments + * @returns {Array} filtered comments */ function filterAccess(levels: Array, comments: Array) { function filter(comment) { diff --git a/src/github.js b/src/github.js index c25817e47..a739c5aae 100644 --- a/src/github.js +++ b/src/github.js @@ -9,7 +9,7 @@ var getGithubURLPrefix = require('./git/url_prefix'); * * @name linkGitHub * @param {Object} comment parsed comment - * @return {Object} comment with github inferred + * @returns {Object} comment with github inferred */ module.exports = function(comment: Comment) { var repoPath = findGit(comment.context.file); diff --git a/src/input/shallow.js b/src/input/shallow.js index 4ebf2cfaf..8d5ce743a 100644 --- a/src/input/shallow.js +++ b/src/input/shallow.js @@ -16,7 +16,7 @@ var smartGlob = require('../smart_glob.js'); * * @param indexes entry points * @param config parsing options - * @return promise with parsed files + * @returns promise with parsed files */ module.exports = function( indexes: Array, diff --git a/src/is_jsdoc_comment.js b/src/is_jsdoc_comment.js index 9fd9605f1..c8495f8e8 100644 --- a/src/is_jsdoc_comment.js +++ b/src/is_jsdoc_comment.js @@ -10,7 +10,7 @@ * * @name isJSDocComment * @param {Object} comment an ast path of the comment - * @return {boolean} whether it is valid + * @returns {boolean} whether it is valid */ module.exports = function isJSDocComment( comment /*: { diff --git a/src/lint.js b/src/lint.js index 2d2a45148..7ecccb719 100644 --- a/src/lint.js +++ b/src/lint.js @@ -67,7 +67,7 @@ function lintComments(comment: Comment) { * @private * Extract lint instructions from comments and generate user-readable output. * @param {Array} comments a list of comments - * @return {string} user-readable output + * @returns {string} user-readable output */ function formatLint(comments: Array): string { var vFiles = {}; diff --git a/src/module_filters.js b/src/module_filters.js index 55b6cec34..ab30d06b7 100644 --- a/src/module_filters.js +++ b/src/module_filters.js @@ -25,7 +25,7 @@ module.exports = { * @param {Object} options - An options object with `external` being a * micromatch-compaitible glob. *NOTE:* the glob will be matched relative to * the top-level node_modules directory for each entry point. - * @return {function} - A function for use as the module-deps `postFilter` + * @returns {function} - A function for use as the module-deps `postFilter` * options. */ externals: function externalModuleFilter( diff --git a/src/nest.js b/src/nest.js index 6a9987fc2..91a3cce6f 100644 --- a/src/nest.js +++ b/src/nest.js @@ -95,7 +95,7 @@ var nestTag = ( * This assumes that incoming comments have been flattened. * * @param {Object} comment input comment - * @return {Object} nested comment + * @returns {Object} nested comment */ var nest = (comment: Comment) => Object.assign(comment, { diff --git a/src/output/markdown.js b/src/output/markdown.js index aa0aad5df..1379d6f17 100644 --- a/src/output/markdown.js +++ b/src/output/markdown.js @@ -10,7 +10,7 @@ var remark = require('remark'), * @param {Array} comments parsed comments * @param {Object} args Options that can customize the output * @name formats.markdown - * @return {Promise} a promise of the eventual value + * @returns {Promise} a promise of the eventual value * @public * @example * var documentation = require('documentation'); diff --git a/src/parse.js b/src/parse.js index 048da3c8b..c1cef57b7 100644 --- a/src/parse.js +++ b/src/parse.js @@ -564,7 +564,7 @@ function flattenKindShorthand(result, tag, key) { * @param {string} comment input to be parsed * @param {Object} loc location of the input * @param {Object} context code context of the input - * @return {Comment} an object conforming to the + * @returns {Comment} an object conforming to the * [documentation schema](https://github.com/documentationjs/api-json) */ function parseJSDoc(comment: string, loc: ?Object, context: ?Object): Comment { diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js index 7b2157bda..b6ebfd584 100644 --- a/src/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -32,7 +32,7 @@ function leftPad(str, width) { * * @param {Object} data a chunk of data provided by module-deps * @param {Object} config config - * @return {Array} an array of parsed comments + * @returns {Array} an array of parsed comments */ function parseJavaScript(data: Object, config: DocumentationConfig) { var visited = new Set(); diff --git a/src/sort.js b/src/sort.js index 0a8b0176f..465db052d 100644 --- a/src/sort.js +++ b/src/sort.js @@ -11,7 +11,7 @@ var fs = require('fs'); * * @param {Array} comments all comments * @param {Object} options options from documentation.yml - * @return {number} sorting value + * @returns {number} sorting value * @private */ module.exports = function sortDocs(comments: Array, options: Object) { From 7a07d5118d12a575e20b92615903ad0fa753f30e Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 4 Sep 2017 02:07:13 -0400 Subject: [PATCH 119/555] feat: implement @hideconstructor (#898) Per usejsdoc.org, this tag goes either in a comment attached to a function that has declared that function to be a class, or in a comment on an ES6 class constructor. --- __tests__/lib/infer/params.js | 24 ++++++++++++++++++++++++ __tests__/lib/parse.js | 8 ++++++++ declarations/comment.js | 2 ++ src/infer/params.js | 13 +++++++++++-- src/parse.js | 1 + src/parsers/javascript.js | 34 +++++++++++++++++++++++++--------- 6 files changed, 71 insertions(+), 11 deletions(-) diff --git a/__tests__/lib/infer/params.js b/__tests__/lib/infer/params.js index 01eba07d3..66ea1b209 100644 --- a/__tests__/lib/infer/params.js +++ b/__tests__/lib/infer/params.js @@ -163,4 +163,28 @@ test('inferParams', function() { expect( evaluate('/** Test */ export default function f(x) {}').params ).toEqual([{ lineNumber: 1, name: 'x', title: 'param' }]); + + expect( + evaluate(function() { + /** + * @class + * @hideconstructor + */ + function SomeClass(foo, bar) {} + }).params + ).toEqual([]); + + expect( + evaluate(` + /** + * Test + */ + class SomeClass { + /** + * @hideconstructor + */ + constructor(foo, bar) {} + } + `).params + ).toEqual([]); }); diff --git a/__tests__/lib/parse.js b/__tests__/lib/parse.js index 2349ec8ff..f8c7acb7c 100644 --- a/__tests__/lib/parse.js +++ b/__tests__/lib/parse.js @@ -444,6 +444,14 @@ test('parse - @global', function() { ).toBe('global'); }); +test('parse - @hideconstructor', function() { + expect( + evaluate(function() { + /** @hideconstructor */ + })[0].hideconstructor + ).toBe(true); +}); + test('parse - @host', function() {}); test('parse - @ignore', function() { diff --git a/declarations/comment.js b/declarations/comment.js index 17d2c3e63..9f0ddab56 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -84,6 +84,7 @@ type Comment = { classdesc?: Remark, members: CommentMembers, + constructorComment?: Comment, name?: string, kind?: Kind, @@ -100,6 +101,7 @@ type Comment = { since?: string, lends?: string, override?: boolean, + hideconstructor?: true, type?: DoctrineType, diff --git a/src/infer/params.js b/src/infer/params.js index cb9791000..c0503a44c 100644 --- a/src/infer/params.js +++ b/src/infer/params.js @@ -23,7 +23,10 @@ function inferParams(comment: Comment) { // If this is an ES6 class with a constructor method, infer // parameters from that constructor method. - if (t.isClassDeclaration(path)) { + if ( + t.isClassDeclaration(path) && + !(comment.constructorComment && comment.constructorComment.hideconstructor) + ) { let constructor = path.node.body.body.find(item => { // https://github.com/babel/babylon/blob/master/ast/spec.md#classbody return t.isClassMethod(item) && item.kind === 'constructor'; @@ -37,6 +40,10 @@ function inferParams(comment: Comment) { return comment; } + if (comment.kind === 'class' && comment.hideconstructor) { + return comment; + } + return inferAndCombineParams(path.node.params, comment); } @@ -277,7 +284,9 @@ function mergeTopNodes(inferred, explicit) { var errors = explicitTagsWithoutInference.map(tag => { return { - message: `An explicit parameter named ${tag.name || ''} was specified but didn't match ` + + message: + `An explicit parameter named ${tag.name || + ''} was specified but didn't match ` + `inferred information ${Array.from(inferredNames).join(', ')}`, commentLineNumber: tag.lineNumber }; diff --git a/src/parse.js b/src/parse.js index c1cef57b7..d21a69ef3 100644 --- a/src/parse.js +++ b/src/parse.js @@ -168,6 +168,7 @@ var flatteners = { global(result) { result.scope = 'global'; }, + hideconstructor: flattenBoolean, host: synonym('external'), ignore: flattenBoolean, implements: todo, diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js index b6ebfd584..900e153b6 100644 --- a/src/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -36,9 +36,10 @@ function leftPad(str, width) { */ function parseJavaScript(data: Object, config: DocumentationConfig) { var visited = new Set(); + const commentsByNode = new Map(); var ast = parseToAst(data.source); - var addComment = _addComment.bind(null, visited); + var addComment = _addComment.bind(null, visited, commentsByNode); return _.flatMap( config.documentExported @@ -54,6 +55,7 @@ function parseJavaScript(data: Object, config: DocumentationConfig) { function _addComment( visited, + commentsByNode, data, commentValue, commentLoc, @@ -89,19 +91,33 @@ function _addComment( value: path }); - // #689 - if (t.isClassMethod(path) && path.node.kind === 'constructor') { - debuglog( - 'A constructor was documented explicitly: document along with the class instead' - ); - } - if (path.parentPath && path.parentPath.node) { var parentNode = path.parentPath.node; context.code = data.source.substring(parentNode.start, parentNode.end); } } - return parse(commentValue, commentLoc, context); + const comment = parse(commentValue, commentLoc, context); + if (includeContext) { + commentsByNode.set(path.node, comment); + + if (t.isClassMethod(path) && path.node.kind === 'constructor') { + // #689 + if (!comment.hideconstructor) { + debuglog( + 'A constructor was documented explicitly: document along with the class instead' + ); + } + + const parentComment = commentsByNode.get( + path.parentPath.parentPath.node + ); + if (parentComment) { + parentComment.constructorComment = comment; + return; + } + } + } + return comment; } } From c94412a7aa15e5c15f23861c9616916f831e2b49 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 4 Sep 2017 02:44:31 -0400 Subject: [PATCH 120/555] feat: groups in toc (#895) --- __tests__/__snapshots__/test.js.snap | 49 ++++++++++++++++ __tests__/fixture/sections.config.yml | 12 ++++ __tests__/fixture/sections.input.js | 24 ++++++++ __tests__/lib/__snapshots__/sort.js.snap | 66 +++++++++++++++++++++- __tests__/lib/sort.js | 18 +++++- __tests__/test.js | 9 +++ docs/CONFIG.md | 19 +++++++ src/hierarchy.js | 71 ++++++++++++++++++------ src/output/markdown_ast.js | 13 ++++- src/sort.js | 54 +++++++++++------- 10 files changed, 290 insertions(+), 45 deletions(-) create mode 100644 __tests__/fixture/sections.config.yml create mode 100644 __tests__/fixture/sections.input.js diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 57a8751a4..2657f91e8 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -34,6 +34,55 @@ World " `; +exports[`config with nested sections 1`] = ` +" + +## Alpha + + + + +### third + +This function is third + +### first + +This function is first + +## Bravo + +Contains a subsection! + + +### Charlie + +Second is in here + + +#### second + +This class has some members + +##### foo + +second::foo + +**Parameters** + +- \`pork\` + +##### bar + +second::bar + +**Parameters** + +- \`beans\` +- \`rice\` +" +`; + exports[`external modules option 1`] = ` Array [ Object { diff --git a/__tests__/fixture/sections.config.yml b/__tests__/fixture/sections.config.yml new file mode 100644 index 000000000..0efa7b0ed --- /dev/null +++ b/__tests__/fixture/sections.config.yml @@ -0,0 +1,12 @@ +toc: + - name: Alpha + children: + - third + - first + - name: Bravo + description: Contains a subsection! + children: + - name: Charlie + description: Second is in here + children: + - second diff --git a/__tests__/fixture/sections.input.js b/__tests__/fixture/sections.input.js new file mode 100644 index 000000000..1a11c2122 --- /dev/null +++ b/__tests__/fixture/sections.input.js @@ -0,0 +1,24 @@ +/** + * This function is first + */ +function first() {} + +/** + * This class has some members + */ +function second() {} + +/** + * second::foo + */ +second.prototype.foo = function(pork) {}; + +/** + * second::bar + */ +second.prototype.bar = function(beans, rice) {}; + +/** + * This function is third + */ +function third() {} diff --git a/__tests__/lib/__snapshots__/sort.js.snap b/__tests__/lib/__snapshots__/sort.js.snap index 134b42c51..26a127dbb 100644 --- a/__tests__/lib/__snapshots__/sort.js.snap +++ b/__tests__/lib/__snapshots__/sort.js.snap @@ -3,9 +3,67 @@ exports[`sort toc with files 1`] = ` Array [ Object { - "file": "test/fixture/snowflake.md", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + }, + "type": "text", + "value": "The Snowflake", + }, + ], + "depth": 1, + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "heading", + }, + ], + "position": Object { + "end": Object { + "column": 1, + "line": 2, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, "kind": "note", "name": "snowflake", + "path": Array [ + Object { + "name": "snowflake", + "scope": "static", + }, + ], }, Object { "context": Object { @@ -86,6 +144,12 @@ Array [ }, "kind": "note", "name": "snowflake", + "path": Array [ + Object { + "name": "snowflake", + "scope": "static", + }, + ], }, Object { "context": Object { diff --git a/__tests__/lib/sort.js b/__tests__/lib/sort.js index cdc7b2a11..099b671ea 100644 --- a/__tests__/lib/sort.js +++ b/__tests__/lib/sort.js @@ -87,7 +87,13 @@ test('sort stream with configuration and a section', function() { } } }, - kind: 'note' + kind: 'note', + path: [ + { + name: 'This is the banana type', + scope: 'static' + } + ] }; expect( @@ -161,7 +167,13 @@ test('sort an already-sorted stream containing a section/description', function( } } }, - kind: 'note' + kind: 'note', + path: [ + { + name: 'This is the banana type', + scope: 'static' + } + ] }; var config = { @@ -180,7 +192,7 @@ test('sort toc with files', function() { var snowflake = { name: 'snowflake', - file: 'test/fixture/snowflake.md' + file: path.join(__dirname, '../fixture/snowflake.md') }; expect( diff --git a/__tests__/test.js b/__tests__/test.js index cbcbbacca..604ae889d 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -179,6 +179,15 @@ test('config', async function() { expect(md).toMatchSnapshot(); }); +test('config with nested sections', async function() { + var file = path.join(__dirname, 'fixture', 'sections.input.js'); + const out = await documentation.build([file], { + config: path.join(__dirname, 'fixture', 'sections.config.yml') + }); + const md = await outputMarkdown(out, {}); + expect(md).toMatchSnapshot(); +}); + test('multi-file input', async function() { const result = await documentation.build( [ diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 7abdfc5ff..6dab84d58 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -53,3 +53,22 @@ and areas on the sphere. ``` it would produce the same output as the previous example. + +## Groups + +The `children` property can be used to group content under headings instead of just arranging them in order. Example: + +```yml +toc: + - name: Geography + children: + - Map + - LngLat + - LngLatBounds + - name: Navigation + description: | + Here are some helper functions for navigation. + children: + - shortestPath + - salesman +``` diff --git a/src/hierarchy.js b/src/hierarchy.js index f8bb120fb..b4067a5d0 100644 --- a/src/hierarchy.js +++ b/src/hierarchy.js @@ -55,32 +55,63 @@ module.exports = function(comments) { members: getMembers() }; + const namesToUnroot = []; + comments.forEach(comment => { - var path = []; + let path = comment.path; + if (!path) { + path = []; + + if (comment.memberof) { + // TODO: full namepath parsing + path = comment.memberof + .split('.') + .map(segment => ({ scope: 'static', name: segment })); + } - if (comment.memberof) { - // TODO: full namepath parsing - path = comment.memberof.split('.').map(segment => ['static', segment]); - } + if (!comment.name) { + comment.errors.push({ + message: 'could not determine @name for hierarchy' + }); + } - if (!comment.name) { - comment.errors.push({ - message: 'could not determine @name for hierarchy' + path.push({ + scope: comment.scope || 'static', + name: comment.name || 'unknown_' + id++ }); } - path.push([comment.scope || 'static', comment.name || 'unknown_' + id++]); - var node = root; while (path.length) { - var segment = path.shift(), scope = segment[0], name = segment[1]; + var segment = path.shift(), + scope = segment.scope, + name = segment.name; if (!hasOwnProperty.call(node.members[scope], name)) { - node.members[scope][name] = { - comments: [], - members: getMembers() - }; + // If segment.toc is true, everything up to this point in the path + // represents how the documentation should be nested, but not how the + // actual code is nested. To ensure that child members end up in the + // right places in the tree, we temporarily push the same node a second + // time to the root of the tree, and unroot it after all the comments + // have found their homes. + if ( + segment.toc && + node !== root && + hasOwnProperty.call(root.members[scope], name) + ) { + node.members[scope][name] = root.members[scope][name]; + namesToUnroot.push(name); + } else { + const newNode = (node.members[scope][name] = { + comments: [], + members: getMembers() + }); + if (segment.toc && node !== root) { + root.members[scope][name] = newNode; + namesToUnroot.push(name); + } + } } node = node.members[scope][name]; @@ -88,6 +119,9 @@ module.exports = function(comments) { node.comments.push(comment); }); + namesToUnroot.forEach(function(name) { + delete root.members.static[name]; + }); /* * Massage the hierarchy into a format more suitable for downstream consumers: @@ -107,7 +141,8 @@ module.exports = function(comments) { * Person~say // the inner method named "say." */ function toComments(nodes, root, hasUndefinedParent, path) { - var result = [], scope; + var result = [], + scope; path = path || []; @@ -119,7 +154,9 @@ module.exports = function(comments) { node.members[scope], root || result, !node.comments.length, - node.comments.length ? path.concat(node.comments[0]) : [] + node.comments.length && node.comments[0].kind !== 'note' + ? path.concat(node.comments[0]) + : [] ); } diff --git a/src/output/markdown_ast.js b/src/output/markdown_ast.js index ab1b1dae7..3096f096e 100644 --- a/src/output/markdown_ast.js +++ b/src/output/markdown_ast.js @@ -303,9 +303,16 @@ function buildMarkdownAST( } if (comment.kind === 'note') { - return [u('heading', { depth }, [u('text', comment.name || '')])].concat( - comment.description - ); + return [u('heading', { depth }, [u('text', comment.name || '')])] + .concat(comment.description) + .concat( + !!comment.members.static.length && + comment.members.static.reduce( + (memo, child) => memo.concat(generate(depth + 1, child)), + [] + ) + ) + .filter(Boolean); } return [u('heading', { depth }, [u('text', comment.name || '')])] diff --git a/src/sort.js b/src/sort.js index 465db052d..668ea4f8b 100644 --- a/src/sort.js +++ b/src/sort.js @@ -18,28 +18,19 @@ module.exports = function sortDocs(comments: Array, options: Object) { if (!options || !options.toc) { return sortComments(comments, options && options.sortOrder); } - var indexes = options.toc.reduce(function(memo, val, i) { + let i = 0; + const indexes: { [?string]: number } = Object.create(null); + const toBeSorted: { [?string]: boolean } = Object.create(null); + const paths: { + [?string]: Array<{ scope: Scope, name: string }> + } = Object.create(null); + const fixed = []; + const walk = function(tocPath, val) { if (typeof val === 'object' && val.name) { val.kind = 'note'; - memo[val.name] = i; - } else { - memo[val] = i; - } - return memo; - }, Object.create(null)); - var toBeSorted = options.toc.reduce(function(memo, val) { - if (typeof val === 'string') { - memo[val] = false; - } - return memo; - }, Object.create(null)); - // Table of contents 'theme' entries: defined as objects - // in the YAML list - var fixed = options.toc - .filter(val => typeof val === 'object' && val.name) - .map(function(val) { + indexes[val.name] = i++; if (typeof val.file === 'string') { - var filename = val.file; + let filename = val.file; if (!path.isAbsolute(val.file)) { filename = path.join(process.cwd(), val.file); } @@ -50,14 +41,34 @@ module.exports = function sortDocs(comments: Array, options: Object) { } catch (err) { process.stderr.write(chalk.red(`Failed to read file ${filename}`)); } + } else if (!val.description) { + val.description = ''; } if (typeof val.description === 'string') { val.description = parseMarkdown(val.description); } - return val; - }); + const childPath = tocPath.concat({ scope: 'static', name: val.name }); + val.path = childPath; + if (val.children) { + val.children.forEach(walk.bind(null, childPath)); + } + fixed.push(val); + } else { + indexes[val] = i++; + toBeSorted[val] = false; + paths[val] = tocPath.concat({ scope: 'static', name: val, toc: true }); + } + }; + // Table of contents 'theme' entries: defined as objects + // in the YAML list + options.toc.forEach(walk.bind(null, [])); var unfixed = []; comments.forEach(function(comment) { + const commentPath = paths[comment.name]; + if (commentPath) { + comment.path = commentPath; + } + // If comment is of kind 'note', this means that we must be _re_ sorting // the list, and the TOC note entries were already added to the list. Bail // out here so that we don't add duplicates. @@ -78,6 +89,7 @@ module.exports = function sortDocs(comments: Array, options: Object) { if (indexes[a.name] !== undefined && indexes[b.name] !== undefined) { return indexes[a.name] - indexes[b.name]; } + return 0; }); sortComments(unfixed, options.sortOrder); Object.keys(toBeSorted) From a04b6fd61dd9edf3b8d83d2b91857e2535c4e7e8 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 4 Sep 2017 02:44:55 -0400 Subject: [PATCH 121/555] fix: @name tag disconnects comment (#897) The previous support for @name tags suppressing inference from surrounding code was ad-hoc and incomplete. This commit makes a @name tag (or a tag acting as a @kind/@name shorthand combo, like @function) detach the `ast` field from the comment context, so that the surrounding code will be universally ignored per the JSDoc spec. --- __tests__/__snapshots__/bin.js.snap | 23 +- __tests__/__snapshots__/test.js.snap | 23 +- __tests__/bin.js | 4 - .../fixture/html/nested.config-output.html | 1359 ----------------- __tests__/lib/parse.js | 23 + declarations/comment.js | 2 +- src/extractors/exported.js | 13 +- src/infer/finders.js | 2 +- src/infer/membership.js | 34 +- src/infer/params.js | 3 + src/infer/return.js | 3 + src/output/html.js | 2 +- src/output/json.js | 3 +- src/parse.js | 6 + 14 files changed, 59 insertions(+), 1441 deletions(-) delete mode 100644 __tests__/fixture/html/nested.config-output.html diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 1d55f33d1..9c7329263 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -896,7 +896,7 @@ k.isArrayOfBuffers();

    a typedef with nested properties

    -
    CustomError(other: any, also: any)
    +
    CustomError
    @@ -908,27 +908,6 @@ k.isArrayOfBuffers(); -
    Parameters
    -
    - -
    -
    - other (any) - -
    - -
    - -
    -
    - also (any) - -
    - -
    - -
    -
    Properties
    diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 2657f91e8..4a4f32c3d 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -1650,7 +1650,7 @@ k.isArrayOfBuffers();

    a typedef with nested properties

    -
    CustomError(other: any, also: any)
    +
    CustomError
    @@ -1662,27 +1662,6 @@ k.isArrayOfBuffers(); -
    Parameters
    -
    - -
    -
    - other (any) - -
    - -
    - -
    -
    - also (any) - -
    - -
    - -
    -
    Properties
    diff --git a/__tests__/bin.js b/__tests__/bin.js index 084cfe4d7..b5b8ae5d2 100644 --- a/__tests__/bin.js +++ b/__tests__/bin.js @@ -163,10 +163,6 @@ test('--config', async function() { var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); fs.mkdirSync(dst); var outputIndex = path.join(dst, 'index.html'); - var expectedOutputPath = path.join( - __dirname, - 'fixture/html/nested.config-output.html' - ); const data = await documentation( [ 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + diff --git a/__tests__/fixture/html/nested.config-output.html b/__tests__/fixture/html/nested.config-output.html deleted file mode 100644 index e08471d15..000000000 --- a/__tests__/fixture/html/nested.config-output.html +++ /dev/null @@ -1,1359 +0,0 @@ - - - - - documentation 4.0.0-rc.0 | Documentation - - - - - - -
    -
    -
    -
    -

    documentation

    -
    4.0.0-rc.0
    - -
    - -
    - -
    -
    -
    - - -
    - -

    - Highlighted section -

    - - -

    The public key is a base64 encoded string of a protobuf containing an RSA DER -buffer. This uses a node buffer to pass the base64 encoded public key protobuf -to the multihash for ID generation.

    -
    var PeerId = require('peer-id')
    -
    -PeerId.create({ bits: 1024 }, (err, id) => {
    -  console.log(JSON.stringify(id.toJSON(), null, 2)
    -})
    -
    {
    -  "id": "Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi",
    -  "privKey": "CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..",
    -  "pubKey": "CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY..."
    -}
    -
    - - -
    -
    - - - -
    - - -
    - -

    - Klass -

    - - -
    - - -

    Creates a new Klass

    - - -
    new Klass(foo: any)
    - - -

    - Extends - - Stream.Writable - -

    - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - foo (any) - -
    - -
    - -
    - - - - - - - - - - - -
    Static Members
    -
    - -
    -
    -
    - - isClass(other, also) -
    -
    - -
    - -
    -
    -
    - - isWeird(other) -
    -
    - -
    - -
    -
    -
    - - isBuffer(buf, size) -
    -
    - -
    - -
    -
    -
    - - isArrayOfBuffers(buffers) -
    -
    - -
    - -
    -
    -
    - - MAGIC_NUMBER -
    -
    - -
    - -
    - - - - -
    Instance Members
    -
    - -
    -
    -
    - - getFoo() -
    -
    - -
    - -
    -
    -
    - - withOptions(options, otherOptions) -
    -
    - -
    - -
    - - - - -
    Events
    -
    - -
    -
    -
    - - event -
    -
    - -
    - -
    - - -
    - - - - -
    - - -
    - -

    - CustomError -

    - - -
    - - -

    a typedef with nested properties

    - - -
    CustomError(other: any, also: any)
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - other (any) - -
    - -
    - -
    -
    - also (any) - -
    - -
    - -
    - - - -
    Properties
    -
    - -
    - error (object) - : An error - - -
      - -
    • error.code string - -

      The error's code

      -
    • - -
    • error.description string - -

      The error's description

      -
    • - -
    - -
    - -
    - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - bar -

    - - -
    - - -

    Get an instance of Klass. Will make -a klass instance multiword, -like a klass

    - - -
    bar(): Klass
    - - - - - - - - - - - - - - - - -
    Returns
    - Klass: - that class - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - bar -

    - - -
    - - -

    Rest property function

    - - -
    bar(toys: ...Number): undefined
    - - - - - - - - - - - -
    Parameters
    -
    - -
    -
    - toys (...Number) - -
    - -
    - -
    - - - - - - -
    Returns
    - undefined: - nothing - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - bar -

    - - -
    - - -

    Get an instance of Klass. Will make -a klass instance multiword, -like a klass. This needs a number input.

    - - -
    bar(): undefined
    - - - - - - - - - - - - - - - - -
    Returns
    - undefined: - nothing - - - - - - - - - - - - - - -
    - - - - -
    - - -
    - -

    - Foo -

    - - -
    - - -

    This is Foo

    - - -
    new Foo()
    - - - - - - - - - - - - - - - - - - - - - - - -
    Instance Members
    -
    - -
    -
    -
    - - bar -
    -
    - -
    - -
    - - - - -
    - - - - -
    - - -
    - -

    - customStreams -

    - - -
    - - -

    I am the container of stream types

    - - -
    customStreams
    - - - - - - - - - - - - - - - - - - - - - -
    Static Members
    -
    - -
    -
    -
    - - new passthrough() -
    -
    - -
    - -
    - - - - - - -
    - - - -
    -
    -
    - - - - diff --git a/__tests__/lib/parse.js b/__tests__/lib/parse.js index f8c7acb7c..06daf5aa0 100644 --- a/__tests__/lib/parse.js +++ b/__tests__/lib/parse.js @@ -434,6 +434,22 @@ test('parse - @function', function() { kind: 'function', name: 'name' }); + + // When @function takes a name, it is acting as a shorthand for @name and + // should detach from code the same way @name does. + expect( + evaluate(function() { + /** @function */ + function foo() {} + })[0].context.ast + ).toBeDefined(); + + expect( + evaluate(function() { + /** @function name */ + function foo() {} + })[0].context.ast + ).toBeUndefined(); }); test('parse - @global', function() { @@ -648,6 +664,13 @@ test('parse - @name', function() { /** @name test */ })[0].name ).toBe('test'); + + expect( + evaluate(function() { + /** @name foo */ + const bar = 0; + })[0].context.ast + ).toBeUndefined(); }); test('parse - @namespace', function() { diff --git a/declarations/comment.js b/declarations/comment.js index 9f0ddab56..257dee204 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -44,7 +44,7 @@ type SourceFile = { type CommentContext = { sortKey: string, file: string, - ast: Object, + ast?: Object, loc: CommentLoc, code: string, github?: CommentContextGitHub diff --git a/src/extractors/exported.js b/src/extractors/exported.js index 6d36eea6b..b8b724529 100644 --- a/src/extractors/exported.js +++ b/src/extractors/exported.js @@ -151,14 +151,17 @@ function traverseExportedSubtree(path, data, addComments, overrideName) { } addComments(data, attachCommentPath, overrideName); - path = findTarget(path); + let target = findTarget(path); + if (!target) { + return; + } - if (t.isVariableDeclarator(path) && path.has('init')) { - path = path.get('init'); + if (t.isVariableDeclarator(target) && target.has('init')) { + target = target.get('init'); } - if (path.isClass() || path.isObjectExpression()) { - path.traverse({ + if (target.isClass() || target.isObjectExpression()) { + target.traverse({ Property(path) { addComments(data, path); path.skip(); diff --git a/src/infer/finders.js b/src/infer/finders.js index 645c22b86..f85471b08 100644 --- a/src/infer/finders.js +++ b/src/infer/finders.js @@ -10,7 +10,7 @@ var t = require('babel-types'); * @returns {?Object} ast path, if one is found. * @private */ -function findTarget(path: Object) { +function findTarget(path: ?Object) { if (!path) { return path; } diff --git a/src/infer/membership.js b/src/infer/membership.js index 2b2f852da..f887109cd 100644 --- a/src/infer/membership.js +++ b/src/infer/membership.js @@ -241,32 +241,15 @@ module.exports = function() { return comment; } - function shouldSkipInference(comment: Comment): boolean { - // If someone uses the @name tag, they explicitly ask for inference - // to be skipped. - if (comment.tags.some(tag => tag.title === 'name')) { - return true; - } - + return function inferMembership(comment: Comment) { // Lends tags are go-betweens that let people reassign membership // in bulk: they themselves don't get an inference step if (comment.lends) { - return true; - } - - // If this chunk doesn't have code attached, like if it was the result - // of a polyglot parse, don't try to infer anything. - if (!comment.context.ast) { - return true; + return comment; } - return false; - } - - return function inferMembership(comment: Comment) { - // First skip inference if the user indicates it or if it isn't possible. - if (shouldSkipInference(comment)) { - return comment; + if (comment.kind === 'module') { + currentModule = comment; } // If someone explicitly specifies the parent of this chunk, don't @@ -275,11 +258,12 @@ module.exports = function() { return normalizeMemberof(comment); } - if (comment.kind === 'module') { - currentModule = comment; - } - var path = comment.context.ast; + // If this chunk doesn't have code attached, like if it was the result + // of a polyglot parse, don't try to infer anything. + if (!path) { + return comment; + } // INFERENCE =============================================================== // Deal with an oddity of espree: the jsdoc comment is attached to a different diff --git a/src/infer/params.js b/src/infer/params.js index c0503a44c..17f8ad543 100644 --- a/src/infer/params.js +++ b/src/infer/params.js @@ -14,6 +14,9 @@ import flowDoctrine from '../flow_doctrine'; */ function inferParams(comment: Comment) { var path = finders.findTarget(comment.context.ast); + if (!path) { + return comment; + } // In case of `/** */ var x = function () {}` findTarget returns // the declarator. diff --git a/src/infer/return.js b/src/infer/return.js index e1bc147e5..bd22c9f00 100644 --- a/src/infer/return.js +++ b/src/infer/return.js @@ -21,6 +21,9 @@ function inferReturn(comment: Comment) { } var path = findTarget(comment.context.ast); var fn = path && path.node; + if (!fn) { + return comment; + } // In case of `/** */ var x = function () {}` findTarget returns // the declarator. diff --git a/src/output/html.js b/src/output/html.js index 35485702d..0c004889e 100644 --- a/src/output/html.js +++ b/src/output/html.js @@ -6,7 +6,7 @@ var mergeConfig = require('../merge_config'); /** * Formats documentation as HTML. * - * @param comments parsed comments + * @param {Array} comments parsed comments * @param {Object} config Options that can customize the output * @param {string} [config.theme='default_theme'] Name of a module used for an HTML theme. * @returns {Promise>} Promise with results diff --git a/src/output/json.js b/src/output/json.js index a210c6362..01d5248d8 100644 --- a/src/output/json.js +++ b/src/output/json.js @@ -5,7 +5,8 @@ import { walk } from '../walk'; /** * Formats documentation as a JSON string. * - * @param comments parsed comments + * @param {Array} comments parsed comments + * @returns {Promise} * @name formats.json * @public * @example diff --git a/src/parse.js b/src/parse.js index d21a69ef3..256214f8d 100644 --- a/src/parse.js +++ b/src/parse.js @@ -623,6 +623,12 @@ function parseJSDoc(comment: string, loc: ?Object, context: ?Object): Comment { } }); + // Using the @name tag, or any other tag that sets the name of a comment, + // disconnects the comment from its surrounding code. + if (context && result.name) { + delete context.ast; + } + return result; } From 769ed235d1a1fb77f2a8fb97b798591e991ea730 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sun, 3 Sep 2017 23:50:03 -0700 Subject: [PATCH 122/555] chore(release): 5.3.0 --- CHANGELOG.md | 16 ++++++++++++++++ package.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e78d624e4..cfdf7f822 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +# [5.3.0](https://github.com/documentationjs/documentation/compare/v5.2.2...v5.3.0) (2017-09-04) + + +### Bug Fixes + +* [@name](https://github.com/name) tag disconnects comment ([#897](https://github.com/documentationjs/documentation/issues/897)) ([a04b6fd](https://github.com/documentationjs/documentation/commit/a04b6fd)) + + +### Features + +* groups in toc ([#895](https://github.com/documentationjs/documentation/issues/895)) ([c94412a](https://github.com/documentationjs/documentation/commit/c94412a)) +* implement [@hideconstructor](https://github.com/hideconstructor) ([#898](https://github.com/documentationjs/documentation/issues/898)) ([7a07d51](https://github.com/documentationjs/documentation/commit/7a07d51)) + + + ## [5.2.2](https://github.com/documentationjs/documentation/compare/v5.2.1...v5.2.2) (2017-08-22) diff --git a/package.json b/package.json index 39b8aa208..6959a95ca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.2.2", + "version": "5.3.0", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 0307dbaaa668d9338ec5f1f3711f16895ac1fb49 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 4 Sep 2017 00:13:00 -0700 Subject: [PATCH 123/555] chore: Update test fixtures --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 9c7329263..b78c6b7df 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.2.2 | Documentation + documentation 5.3.0 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.2.2
    +
    5.3.0
    - documentation 5.2.2 | Documentation + documentation 5.3.0 | Documentation @@ -809,7 +809,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.2.2
    +
    5.3.0
    Date: Mon, 4 Sep 2017 16:37:30 -0400 Subject: [PATCH 124/555] fix: cover more hideconstructor cases --- __tests__/lib/parsers/javascript.js | 21 +++++++++++++++++++++ src/parsers/javascript.js | 8 ++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/__tests__/lib/parsers/javascript.js b/__tests__/lib/parsers/javascript.js index 46b840551..cf5b114fa 100644 --- a/__tests__/lib/parsers/javascript.js +++ b/__tests__/lib/parsers/javascript.js @@ -84,3 +84,24 @@ test('parse - document exported', function() { ).length ).toBe(2); }); + +test('parse - constructor comments', function() { + expect( + toComments(` + class Test { + /** @hideconstructor */ + constructor() {} + } + `).length + ).toBe(0); + + expect( + toComments(` + /** Test */ + export class Test { + /** @hideconstructor */ + constructor() {} + } + `)[0].constructorComment + ).toBeDefined(); +}); diff --git a/src/parsers/javascript.js b/src/parsers/javascript.js index 900e153b6..37aa06087 100644 --- a/src/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -6,7 +6,8 @@ var _ = require('lodash'), walkComments = require('../extractors/comments'), walkExported = require('../extractors/exported'), util = require('util'), - debuglog = util.debuglog('documentation'); + debuglog = util.debuglog('documentation'), + findTarget = require('../infer/finders').findTarget; import { parseToAst } from './parse_to_ast'; @@ -98,7 +99,7 @@ function _addComment( } const comment = parse(commentValue, commentLoc, context); if (includeContext) { - commentsByNode.set(path.node, comment); + commentsByNode.set((findTarget(path) || path).node, comment); if (t.isClassMethod(path) && path.node.kind === 'constructor') { // #689 @@ -115,6 +116,9 @@ function _addComment( parentComment.constructorComment = comment; return; } + if (comment.hideconstructor) { + return; + } } } return comment; From 125a577199f70b789701edf6d4581935d312cbf4 Mon Sep 17 00:00:00 2001 From: Ryan Hendrickson Date: Mon, 4 Sep 2017 19:25:40 -0400 Subject: [PATCH 125/555] fix: regression in toc causing crash --- __tests__/__snapshots__/test.js.snap | 11 +++++++++++ __tests__/fixture/sections.input.js | 15 +++++++++++++++ src/sort.js | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 820e794b4..1873d589d 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -50,6 +50,10 @@ This function is third This function is first +### first + +forgot a memberof here... sure hope that doesn't crash anything! + ## Bravo Contains a subsection! @@ -80,6 +84,13 @@ second::bar - \`beans\` - \`rice\` + +## AClass + +### second + +shares a name with a top level item referenced in the TOC... sure hope +that doesn't crash anything! " `; diff --git a/__tests__/fixture/sections.input.js b/__tests__/fixture/sections.input.js index 1a11c2122..e0fc3ef50 100644 --- a/__tests__/fixture/sections.input.js +++ b/__tests__/fixture/sections.input.js @@ -3,6 +3,21 @@ */ function first() {} +/** */ +class AClass { + /** + * forgot a memberof here... sure hope that doesn't crash anything! + * @method first + */ + first(x, y) {} + + /** + * shares a name with a top level item referenced in the TOC... sure hope + * that doesn't crash anything! + */ + second() {} +} + /** * This class has some members */ diff --git a/src/sort.js b/src/sort.js index 668ea4f8b..e87717c58 100644 --- a/src/sort.js +++ b/src/sort.js @@ -64,9 +64,10 @@ module.exports = function sortDocs(comments: Array, options: Object) { options.toc.forEach(walk.bind(null, [])); var unfixed = []; comments.forEach(function(comment) { - const commentPath = paths[comment.name]; - if (commentPath) { + let commentPath; + if (!comment.memberof && (commentPath = paths[comment.name])) { comment.path = commentPath; + delete paths[comment.name]; } // If comment is of kind 'note', this means that we must be _re_ sorting From 67c0a29e580067a83f17a4fac35eb135d420aea0 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 6 Sep 2017 10:04:39 -0700 Subject: [PATCH 126/555] chore(package): update babel-jest to version 21.0.0 (#900) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6959a95ca..66f82d792 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "are-we-flow-yet": "^1.0.0", "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", - "babel-jest": "^20.0.1", + "babel-jest": "^21.0.0", "babel-plugin-syntax-async-functions": "^6.13.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-preset-flow": "^6.23.0", From b97241f8d16bb7aec3ad5f777bc3166e8da7b94e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 7 Sep 2017 09:51:24 -0700 Subject: [PATCH 127/555] fix: Enable dynamicImport plugin to support import() syntax (#903) Fixes #902 --- __tests__/fixture/es6-import.input.js | 2 ++ src/parsers/parse_to_ast.js | 18 ++++++++---------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/__tests__/fixture/es6-import.input.js b/__tests__/fixture/es6-import.input.js index 51fe5fca6..7ab6cfc35 100644 --- a/__tests__/fixture/es6-import.input.js +++ b/__tests__/fixture/es6-import.input.js @@ -2,6 +2,8 @@ import hasEx6 from './es6-ext'; import multiply from './simple.input.js'; import * as foo from 'some-other-module'; +import('./simple.input.js').then(() => {}); + /** * This function returns the number one. * @returns {Number} numberone diff --git a/src/parsers/parse_to_ast.js b/src/parsers/parse_to_ast.js index e9720e538..5bc2aa5bd 100644 --- a/src/parsers/parse_to_ast.js +++ b/src/parsers/parse_to_ast.js @@ -6,20 +6,18 @@ var opts = { allowImportExportEverywhere: true, sourceType: 'module', plugins: [ - 'jsx', - 'flow', - 'asyncFunctions', + 'asyncGenerators', 'classConstructorCall', - 'doExpressions', - 'trailingFunctionCommas', - 'objectRestSpread', - 'decorators', 'classProperties', + 'decorators', + 'doExpressions', 'exportExtensions', - 'exponentiationOperator', - 'asyncGenerators', + 'flow', 'functionBind', - 'functionSent' + 'functionSent', + 'jsx', + 'objectRestSpread', + 'dynamicImport' ] }; From 29601d91a0a952af3588df0ad1b30cadafe3c47f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 7 Sep 2017 09:52:36 -0700 Subject: [PATCH 128/555] chore: Update yarn.lock --- yarn.lock | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index d93460f6d..fc330e35a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -442,7 +442,7 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^20.0.1, babel-jest@^20.0.3: +babel-jest@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" dependencies: @@ -450,6 +450,13 @@ babel-jest@^20.0.1, babel-jest@^20.0.3: babel-plugin-istanbul "^4.0.0" babel-preset-jest "^20.0.3" +babel-jest@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-21.0.0.tgz#4f636a7dce105aa5753d5f3dde4422ff50c1d6c5" + dependencies: + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^21.0.0" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -474,6 +481,10 @@ babel-plugin-jest-hoist@^20.0.3: version "20.0.3" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" +babel-plugin-jest-hoist@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.0.0.tgz#aa2dbab7b0d58fa635640efd53aab730be7b3273" + babel-plugin-syntax-async-functions@^6.13.0, babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -888,6 +899,12 @@ babel-preset-jest@^20.0.3: dependencies: babel-plugin-jest-hoist "^20.0.3" +babel-preset-jest@^21.0.0: + version "21.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.0.0.tgz#13a8d82e999aa49f8b2dc14d0023d362f2e4ba23" + dependencies: + babel-plugin-jest-hoist "^21.0.0" + babel-preset-react@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" From bc470756366af819d005196da804f423908b8231 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 7 Sep 2017 09:52:53 -0700 Subject: [PATCH 129/555] chore(release): 5.3.1 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfdf7f822..cd1772858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.3.1](https://github.com/documentationjs/documentation/compare/v5.3.0...v5.3.1) (2017-09-07) + + +### Bug Fixes + +* cover more hideconstructor cases ([5bdbf1f](https://github.com/documentationjs/documentation/commit/5bdbf1f)) +* Enable dynamicImport plugin to support import() syntax ([#903](https://github.com/documentationjs/documentation/issues/903)) ([b97241f](https://github.com/documentationjs/documentation/commit/b97241f)), closes [#902](https://github.com/documentationjs/documentation/issues/902) +* regression in toc causing crash ([125a577](https://github.com/documentationjs/documentation/commit/125a577)) + + + # [5.3.0](https://github.com/documentationjs/documentation/compare/v5.2.2...v5.3.0) (2017-09-04) diff --git a/package.json b/package.json index 66f82d792..f4c7011e9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.3.0", + "version": "5.3.1", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From a8201748e6fec71febc914252381a1a8459ab6d9 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 14:09:36 -0700 Subject: [PATCH 130/555] chore: Update tests for latest release (#912) --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index b78c6b7df..b429121b5 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.3.0 | Documentation + documentation 5.3.1 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.3.0
    +
    5.3.1
    - documentation 5.3.0 | Documentation + documentation 5.3.1 | Documentation @@ -820,7 +820,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.3.0
    +
    5.3.1
    Date: Thu, 14 Sep 2017 17:27:24 +0200 Subject: [PATCH 131/555] fix: special property names in flowtypes --- src/flow_doctrine.js | 2 +- src/infer/params.js | 4 ++-- src/infer/properties.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/flow_doctrine.js b/src/flow_doctrine.js index 25f18f756..208df57d8 100644 --- a/src/flow_doctrine.js +++ b/src/flow_doctrine.js @@ -27,7 +27,7 @@ function propertyToField(property) { } return { type: 'FieldType', - key: property.key.name, + key: property.key.name || property.key.value, value: type }; } diff --git a/src/infer/params.js b/src/infer/params.js index 17f8ad543..ba99d707f 100644 --- a/src/infer/params.js +++ b/src/infer/params.js @@ -197,8 +197,8 @@ function paramToDoc( }); } case 'ObjectProperty': { - return _.assign(paramToDoc(param.value, prefix + '.' + param.key.name), { - name: prefix + '.' + param.key.name + return _.assign(paramToDoc(param.value, prefix + '.' + param.key.name || param.key.value), { + name: prefix + '.' + param.key.name || param.key.value }); } case 'RestProperty': // (a, ...b) diff --git a/src/infer/properties.js b/src/infer/properties.js index 19b63dd95..12d9639ee 100644 --- a/src/infer/properties.js +++ b/src/infer/properties.js @@ -12,6 +12,7 @@ function prefixedName(name, prefix) { function propertyToDoc(property, prefix): CommentTag { var type = flowDoctrine(property.value); + var name = property.key.name || property.key.value if (property.optional) { type = { type: 'OptionalType', @@ -20,7 +21,7 @@ function propertyToDoc(property, prefix): CommentTag { } return { title: 'property', - name: prefixedName(property.key.name, prefix), + name: prefixedName(name, prefix), lineNumber: property.loc.start.line, type }; From adf1bd04c0de3957a9ed50040978fbe6d0356ee5 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 15:37:00 -0700 Subject: [PATCH 132/555] test: Add specific test for quoted properties in type definitions --- __tests__/lib/infer/type.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/__tests__/lib/infer/type.js b/__tests__/lib/infer/type.js index 4832d9d1c..c7da9b312 100644 --- a/__tests__/lib/infer/type.js +++ b/__tests__/lib/infer/type.js @@ -40,6 +40,28 @@ test('inferType', function() { type: 'TypeApplication' }); + expect(evaluate('/** */' + "type V = {a:number,'b':string}").type).toEqual({ + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + name: 'number', + type: 'NameExpression' + } + }, + { + key: 'b', + type: 'FieldType', + value: { + name: 'string', + type: 'NameExpression' + } + } + ], + type: 'RecordType' + }); + expect(evaluate('/** */' + 'type V = Array').type).toEqual({ applications: [ { From 8779369ce5922a3e90c56710048dd541f478d5ba Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 16:11:37 -0700 Subject: [PATCH 133/555] test: Add stronger jest tests for inference --- .../lib/infer/__snapshots__/params.js.snap | 54 +++++++++++++++++-- __tests__/lib/infer/name.js | 12 +++++ __tests__/lib/infer/params.js | 4 ++ __tests__/lib/infer/return.js | 44 +++++++++++++++ 4 files changed, 110 insertions(+), 4 deletions(-) create mode 100644 __tests__/lib/infer/return.js diff --git a/__tests__/lib/infer/__snapshots__/params.js.snap b/__tests__/lib/infer/__snapshots__/params.js.snap index 4dd7dcd46..0c7e8dd46 100644 --- a/__tests__/lib/infer/__snapshots__/params.js.snap +++ b/__tests__/lib/infer/__snapshots__/params.js.snap @@ -30,6 +30,52 @@ Array [ `; exports[`inferParams 2`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 1, + "name": "$0.0", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 1, + "name": "$0.1", + "title": "param", + }, + Object { + "anonymous": true, + "name": "$0.2", + "properties": Array [ + Object { + "lineNumber": 1, + "name": "$0.2.c", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Array", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 3`] = ` Array [ Object { "description": Object { @@ -102,7 +148,7 @@ Array [ ] `; -exports[`inferParams 3`] = ` +exports[`inferParams 4`] = ` Array [ Object { "default": "4", @@ -114,7 +160,7 @@ Array [ ] `; -exports[`inferParams 4`] = ` +exports[`inferParams 5`] = ` Array [ Object { "default": "4", @@ -129,7 +175,7 @@ Array [ ] `; -exports[`inferParams 5`] = ` +exports[`inferParams 6`] = ` Array [ Object { "anonymous": true, @@ -150,7 +196,7 @@ Array [ ] `; -exports[`inferParams 6`] = ` +exports[`inferParams 7`] = ` Array [ Object { "anonymous": true, diff --git a/__tests__/lib/infer/name.js b/__tests__/lib/infer/name.js index a07a46c8b..2fe7a3915 100644 --- a/__tests__/lib/infer/name.js +++ b/__tests__/lib/infer/name.js @@ -62,6 +62,18 @@ test('inferName', function() { }).name ).toBe('name'); + expect( + evaluate(function() { + exports = { + // Property + // Identifier (comment attached here) + // FunctionExpression + /** Test */ + name() {} + }; + }).name + ).toBe('name'); + expect( evaluate(function() { /** Test */ diff --git a/__tests__/lib/infer/params.js b/__tests__/lib/infer/params.js index 66ea1b209..2dbf7e61d 100644 --- a/__tests__/lib/infer/params.js +++ b/__tests__/lib/infer/params.js @@ -93,6 +93,10 @@ test('inferParams', function() { evaluate(`/** Test */function f({ x, ...xs }) {};`).params ).toMatchSnapshot(); + expect( + evaluate(`/** Test */function f([a: string, b, {c}]) {};`).params + ).toMatchSnapshot(); + expect( evaluate( ` diff --git a/__tests__/lib/infer/return.js b/__tests__/lib/infer/return.js new file mode 100644 index 000000000..0f04dd12f --- /dev/null +++ b/__tests__/lib/infer/return.js @@ -0,0 +1,44 @@ +/*eslint-disable no-unused-vars*/ +var inferReturn = require('../../../src/infer/return'), + parse = require('../../../src/parsers/javascript'); + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(code) { + return inferReturn(toComment(code)); +} + +test('inferReturn', function() { + expect(evaluate('/** */function a(): number {}').returns).toEqual([ + { + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + } + ]); + expect(evaluate('/** */var a = function(): number {}').returns).toEqual([ + { + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + } + ]); + expect( + evaluate('/** @returns {string} */function a(): number {}').returns[0].type + ).toEqual({ + name: 'string', + type: 'NameExpression' + }); +}); From 61b6976594cc16fdfb01d4fb3288836d397edc58 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 16:28:13 -0700 Subject: [PATCH 134/555] test: More tests --- __tests__/lib/infer/augments.js | 26 +++++++++++ __tests__/lib/infer/properties.js | 72 +++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 __tests__/lib/infer/augments.js create mode 100644 __tests__/lib/infer/properties.js diff --git a/__tests__/lib/infer/augments.js b/__tests__/lib/infer/augments.js new file mode 100644 index 000000000..38801d81d --- /dev/null +++ b/__tests__/lib/infer/augments.js @@ -0,0 +1,26 @@ +/*eslint-disable no-unused-vars*/ +var inferAugments = require('../../../src/infer/augments'), + parse = require('../../../src/parsers/javascript'); + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(code) { + return inferAugments(toComment(code)); +} + +test('inferAugments', function() { + expect(evaluate('/** */class A extends B {}').augments).toEqual([ + { + name: 'B', + title: 'augments' + } + ]); +}); diff --git a/__tests__/lib/infer/properties.js b/__tests__/lib/infer/properties.js new file mode 100644 index 000000000..a8a5e0404 --- /dev/null +++ b/__tests__/lib/infer/properties.js @@ -0,0 +1,72 @@ +/*eslint-disable no-unused-vars*/ +var inferProperties = require('../../../src/infer/properties'), + parse = require('../../../src/parsers/javascript'); + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(code) { + return inferProperties(toComment(code)); +} + +test('inferProperties', function() { + expect(evaluate('/** */type a = { b: 1 };').properties).toEqual([ + { + lineNumber: 1, + name: 'b', + title: 'property', + type: { + type: 'NumericLiteralType', + value: 1 + } + } + ]); + + expect( + evaluate('/** */interface a { b: 1, c: { d: 2 } };').properties + ).toEqual([ + { + lineNumber: 1, + name: 'b', + title: 'property', + type: { + type: 'NumericLiteralType', + value: 1 + } + }, + { + lineNumber: 1, + name: 'c', + title: 'property', + type: { + fields: [ + { + key: 'd', + type: 'FieldType', + value: { + type: 'NumericLiteralType', + value: 2 + } + } + ], + type: 'RecordType' + } + }, + { + lineNumber: 1, + name: 'c.d', + title: 'property', + type: { + type: 'NumericLiteralType', + value: 2 + } + } + ]); +}); From 2605a3b5fd607ed7db065cddaa409a1f599ab99d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 16:49:35 -0700 Subject: [PATCH 135/555] test: Tests for dependency resolution --- __tests__/lib/input/dependency.js | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 __tests__/lib/input/dependency.js diff --git a/__tests__/lib/input/dependency.js b/__tests__/lib/input/dependency.js new file mode 100644 index 000000000..8f32e2737 --- /dev/null +++ b/__tests__/lib/input/dependency.js @@ -0,0 +1,37 @@ +var os = require('os'); +var shell = require('shelljs'); +var path = require('path'); +var fs = require('fs'); +var dependency = require('../../../src/input/dependency'); + +function inputs(contents) { + var dirEntry = os.tmpdir(); + var paths = {}; + for (var filename in contents) { + paths[filename] = path.join(dirEntry, '/', filename); + fs.writeFileSync(paths[filename], contents[filename]); + } + return { + paths + }; +} + +test('dependency', async function() { + let { paths, cleanup } = inputs({ + 'index.js': 'module.exports = 1;', + 'requires.js': "module.exports = require('./foo');", + 'foo.js': 'module.exports = 2;' + }); + { + let dependencies = await dependency([paths['index.js']], { + parseExtension: ['js'] + }); + expect(dependencies.length).toEqual(1); + } + { + let dependencies = await dependency([paths['requires.js']], { + parseExtension: ['js'] + }); + expect(dependencies.length).toEqual(2); + } +}); From de19175980cb1ab732f6c5772d289ed37540c837 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 16:57:14 -0700 Subject: [PATCH 136/555] test: Add tests for moduleFilters, tiny typo fix --- __tests__/lib/module_filters.js | 13 +++++++++++++ src/module_filters.js | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 __tests__/lib/module_filters.js diff --git a/__tests__/lib/module_filters.js b/__tests__/lib/module_filters.js new file mode 100644 index 000000000..82309cf08 --- /dev/null +++ b/__tests__/lib/module_filters.js @@ -0,0 +1,13 @@ +var moduleFilters = require('../../src/module_filters'); + +test('moduleFilters.internalOnly', function() { + expect(moduleFilters.internalOnly('./foo')).toEqual(true); + expect(moduleFilters.internalOnly('foo')).toEqual(false); +}); + +test('moduleFilters.externals', function() { + expect(moduleFilters.externals([], {})('./foo')).toEqual(true); + expect( + moduleFilters.externals([], { external: 'node_modules' })('./foo') + ).toEqual(true); +}); diff --git a/src/module_filters.js b/src/module_filters.js index ab30d06b7..bf5bd796b 100644 --- a/src/module_filters.js +++ b/src/module_filters.js @@ -23,7 +23,7 @@ module.exports = { * @param {Array} indexes - the list of entry points that will be * used by module-deps * @param {Object} options - An options object with `external` being a - * micromatch-compaitible glob. *NOTE:* the glob will be matched relative to + * micromatch-compatible glob. *NOTE:* the glob will be matched relative to * the top-level node_modules directory for each entry point. * @returns {function} - A function for use as the module-deps `postFilter` * options. From c746c9b0ae980861cfbb5d436639a748b61f626a Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 17:05:51 -0700 Subject: [PATCH 137/555] chore(release): 5.3.2 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd1772858..6d8926874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.3.2](https://github.com/documentationjs/documentation/compare/v5.3.1...v5.3.2) (2017-09-15) + + +### Bug Fixes + +* special property names in flowtypes ([7fc6ca8](https://github.com/documentationjs/documentation/commit/7fc6ca8)) + + + ## [5.3.1](https://github.com/documentationjs/documentation/compare/v5.3.0...v5.3.1) (2017-09-07) diff --git a/package.json b/package.json index f4c7011e9..5b183711d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.3.1", + "version": "5.3.2", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From e02b91f8d5df7c9ed130c2b9e559f88898969f3b Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 14 Sep 2017 17:07:36 -0700 Subject: [PATCH 138/555] chore: Update tests for release --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index b429121b5..28d01d242 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.3.1 | Documentation + documentation 5.3.2 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.3.1
    +
    5.3.2
    - documentation 5.3.1 | Documentation + documentation 5.3.2 | Documentation @@ -820,7 +820,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.3.1
    +
    5.3.2
    Date: Thu, 14 Sep 2017 17:22:26 -0700 Subject: [PATCH 139/555] test: Even more tests --- __tests__/__snapshots__/index.js.snap | 196 ++++++++++++++++++++++++++ __tests__/index.js | 68 +++++++++ 2 files changed, 264 insertions(+) create mode 100644 __tests__/__snapshots__/index.js.snap create mode 100644 __tests__/index.js diff --git a/__tests__/__snapshots__/index.js.snap b/__tests__/__snapshots__/index.js.snap new file mode 100644 index 000000000..109f90e23 --- /dev/null +++ b/__tests__/__snapshots__/index.js.snap @@ -0,0 +1,196 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`build 1`] = ` +Array [ + Object { + "augments": Array [], + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "hi", + }, + ], + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": SourceLocation { + "end": Position { + "column": 9, + "line": 1, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "name", + "namespace": "name", + "params": Array [], + "path": Array [ + Object { + "kind": undefined, + "name": "name", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`build 2`] = ` +" + +## name + +hi +" +`; + +exports[`build 3`] = ` +"[ + { + \\"description\\": { + \\"type\\": \\"root\\", + \\"children\\": [ + { + \\"type\\": \\"paragraph\\", + \\"children\\": [ + { + \\"type\\": \\"text\\", + \\"value\\": \\"hi\\", + \\"position\\": { + \\"start\\": { + \\"line\\": 1, + \\"column\\": 1, + \\"offset\\": 0 + }, + \\"end\\": { + \\"line\\": 1, + \\"column\\": 3, + \\"offset\\": 2 + }, + \\"indent\\": [] + } + } + ], + \\"position\\": { + \\"start\\": { + \\"line\\": 1, + \\"column\\": 1, + \\"offset\\": 0 + }, + \\"end\\": { + \\"line\\": 1, + \\"column\\": 3, + \\"offset\\": 2 + }, + \\"indent\\": [] + } + } + ], + \\"position\\": { + \\"start\\": { + \\"line\\": 1, + \\"column\\": 1, + \\"offset\\": 0 + }, + \\"end\\": { + \\"line\\": 1, + \\"column\\": 3, + \\"offset\\": 2 + } + } + }, + \\"tags\\": [], + \\"loc\\": { + \\"start\\": { + \\"line\\": 1, + \\"column\\": 0 + }, + \\"end\\": { + \\"line\\": 1, + \\"column\\": 9 + } + }, + \\"augments\\": [], + \\"examples\\": [], + \\"params\\": [], + \\"properties\\": [], + \\"returns\\": [], + \\"sees\\": [], + \\"throws\\": [], + \\"todos\\": [], + \\"name\\": \\"name\\", + \\"members\\": { + \\"global\\": [], + \\"inner\\": [], + \\"instance\\": [], + \\"events\\": [], + \\"static\\": [] + }, + \\"path\\": [ + { + \\"name\\": \\"name\\" + } + ], + \\"namespace\\": \\"name\\" + } +]" +`; diff --git a/__tests__/index.js b/__tests__/index.js new file mode 100644 index 000000000..ceeb374c4 --- /dev/null +++ b/__tests__/index.js @@ -0,0 +1,68 @@ +var documentation = require('../src/'); +var os = require('os'); +var path = require('path'); +var fs = require('fs'); + +function inputs(contents) { + var dirEntry = os.tmpdir(); + var paths = {}; + for (var filename in contents) { + paths[filename] = path.join(dirEntry, '/', filename); + fs.writeFileSync(paths[filename], contents[filename]); + } + return { + paths + }; +} + +function cleanup(comments) { + comments.forEach(c => { + delete c.context; + }); +} + +test('lint', async function() { + var { paths } = inputs({ + 'index.js': '/** hi */var name = 1;' + }); + + const data = await documentation.lint([paths['index.js']], {}); + expect(data).toEqual(''); +}); + +test('build', async function() { + var { paths } = inputs({ + 'index.js': '/** hi */var name = 1;' + }); + + const data = await documentation.build([paths['index.js']], {}); + cleanup(data); + expect(data).toMatchSnapshot(); + + const md = await documentation.formats.md(data); + expect(md).toMatchSnapshot(); + + const json = await documentation.formats.json(data, {}); + expect(json).toMatchSnapshot(); +}); + +test('expandInputs', async function() { + var { paths } = inputs({ + 'index.js': '/** hi */var name = 1;' + }); + + { + const data = await documentation.expandInputs([paths['index.js']], { + parseExtension: ['js'] + }); + expect(data.length).toEqual(1); + } + + { + const data = await documentation.expandInputs([paths['index.js']], { + parseExtension: ['js'], + shallow: true + }); + expect(data.length).toEqual(1); + } +}); From 2b74956b18d4556ed746e3f8f1281f794c475876 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 21 Sep 2017 04:08:34 +0000 Subject: [PATCH 140/555] fix(package): update github-slugger to version 1.2.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5b183711d..17b98eca4 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "doctrine-temporary-fork": "2.0.0-alpha-allowarrayindex", "get-port": "^3.1.0", "git-url-parse": "^6.0.1", - "github-slugger": "1.1.3", + "github-slugger": "1.2.0", "glob": "^7.0.0", "globals-docs": "^2.3.0", "highlight.js": "^9.1.0", From 334559ea1ed8a8bd56987a993758236f2b84ae8a Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 28 Sep 2017 16:08:06 +0000 Subject: [PATCH 141/555] chore(package): update coveralls to version 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17b98eca4..60b1503cc 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", - "coveralls": "^2.13.1", + "coveralls": "^3.0.0", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", "eslint": "^4.1.1", From 337b7a639e33db9f3712d34a69e185c777521f46 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 11:43:58 +0300 Subject: [PATCH 142/555] chore: updated jest 21 version --- __tests__/__snapshots__/test.js.snap | 36124 +++++++++++++++++++++++++ __tests__/bin.js | 12 +- __tests__/lib/walk.js | 8 +- __tests__/test.js | 11 +- package.json | 22 +- 5 files changed, 36145 insertions(+), 32 deletions(-) diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 0e8a7d026..995315509 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -2538,3 +2538,36127 @@ Array [ }, ] `; + +exports[`outputs boolean-literal-type.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f", + "namespace": "f", + "params": Array [ + Object { + "lineNumber": 2, + "name": "t", + "title": "param", + "type": Object { + "type": "BooleanLiteralType", + "value": true, + }, + }, + Object { + "lineNumber": 2, + "name": "f", + "title": "param", + "type": Object { + "type": "BooleanLiteralType", + "value": false, + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "f", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "title": "returns", + "type": Object { + "elements": Array [ + Object { + "type": "BooleanLiteralType", + "value": true, + }, + Object { + "type": "BooleanLiteralType", + "value": false, + }, + ], + "type": "ArrayType", + }, + }, + ], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs boolean-literal-type.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs boolean-literal-type.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "t", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "true", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "f", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "false", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "[", + }, + Object { + "type": "inlineCode", + "value": "true", + }, + Object { + "type": "text", + "value": ", ", + }, + Object { + "type": "inlineCode", + "value": "false", + }, + Object { + "type": "text", + "value": "]", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs class.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my class, a demo thing.", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 17, + }, + "start": Object { + "column": 0, + "line": 15, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the number 42", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "memberof": "MyClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getFoo", + "namespace": "MyClass#getFoo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "whether to get the number", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "getIt", + "title": "param", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + Object { + "kind": "function", + "name": "getFoo", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forty-two", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "whether to get the number", + "lineNumber": 2, + "name": "getIt", + "title": "param", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + Object { + "description": "forty-two", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 47, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 23, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get undefined", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 22, + }, + "start": Object { + "column": 0, + "line": 19, + }, + }, + "memberof": "MyClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getUndefined", + "namespace": "MyClass#getUndefined", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + Object { + "kind": "function", + "name": "getUndefined", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "does not return anything.", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "does not return anything.", + "lineNumber": 2, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "MyClass", + "namespace": "MyClass", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + ], + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "how many things it contains", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "howMany", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "MyClass", + "title": "class", + "type": null, + }, + Object { + "description": "how many things it contains", + "lineNumber": 3, + "name": "howMany", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs class.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs class.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "MyClass", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my class, a demo thing.", + }, + ], + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Properties", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "howMany", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "how many things it contains", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getFoo", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the number 42", + }, + ], + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "getIt", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "whether to get the number", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forty-two", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getUndefined", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get undefined", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "undefined", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "does not return anything.", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs default-export-function.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "i am foo", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "default-export-function.input", + "namespace": "default-export-function.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "default-export-function.input", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "i am foo's son", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "commentLineNumber": 0, + "message": "@memberof reference to default-export-function.input not found", + }, + ], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 23, + "line": 3, + }, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "memberof": "default-export-function.input", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bar", + "namespace": ".bar", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "bar", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs default-export-function.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs default-export-function.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "default-export-function.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "i am foo", + }, + ], + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "bar", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "i am foo's son", + }, + ], + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs document-exported.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "memberof": "z", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "zMethod", + "namespace": "z#zMethod", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "z", + }, + Object { + "kind": "function", + "name": "zMethod", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "z", + "namespace": "z", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "z", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "x", + "namespace": "x", + "params": Array [ + Object { + "lineNumber": 1, + "name": "yparam", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "x", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 1, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "classMethod", + "namespace": "Class#classMethod", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "function", + "name": "classMethod", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 22, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "classGetter", + "namespace": "Class#classGetter", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "member", + "name": "classGetter", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 23, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "classSetter", + "namespace": "Class#classSetter", + "params": Array [ + Object { + "lineNumber": 7, + "name": "v", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "member", + "name": "classSetter", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 26, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "staticMethod", + "namespace": "Class.staticMethod", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "function", + "name": "staticMethod", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 30, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "staticGetter", + "namespace": "Class.staticGetter", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "member", + "name": "staticGetter", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 31, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "memberof": "Class", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "staticSetter", + "namespace": "Class.staticSetter", + "params": Array [ + Object { + "lineNumber": 10, + "name": "v", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + Object { + "kind": "member", + "name": "staticSetter", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "Class", + "namespace": "Class", + "params": Array [ + Object { + "lineNumber": 4, + "name": "a", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Class", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 25, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T5", + "namespace": "T5", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T5", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "y2Default", + "namespace": "y2Default", + "params": Array [], + "path": Array [ + Object { + "name": "y2Default", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Description of y3", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 24, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "y4", + "namespace": "y4", + "params": Array [ + Object { + "lineNumber": 8, + "name": "p", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "y4", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "title": "returns", + "type": Object { + "type": "VoidLiteral", + }, + }, + ], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 2, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 13, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "memberof": "object", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "method", + "namespace": "object.method", + "params": Array [], + "path": Array [ + Object { + "name": "object", + }, + Object { + "kind": "function", + "name": "method", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 17, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "memberof": "object", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getter", + "namespace": "object.getter", + "params": Array [], + "path": Array [ + Object { + "name": "object", + }, + Object { + "kind": "member", + "name": "getter", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 18, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + "memberof": "object", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "setter", + "namespace": "object.setter", + "params": Array [ + Object { + "lineNumber": 16, + "name": "v", + "title": "param", + }, + ], + "path": Array [ + Object { + "name": "object", + }, + Object { + "kind": "member", + "name": "setter", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + "memberof": "object", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "prop", + "namespace": "object.prop", + "params": Array [], + "path": Array [ + Object { + "name": "object", + }, + Object { + "name": "prop", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 18, + }, + "start": Object { + "column": 2, + "line": 18, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 21, + "line": 18, + }, + "start": Object { + "column": 2, + "line": 18, + }, + }, + "memberof": "object", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "func", + "namespace": "object.func", + "params": Array [], + "path": Array [ + Object { + "name": "object", + }, + Object { + "kind": "function", + "name": "func", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "object", + "namespace": "object", + "params": Array [], + "path": Array [ + Object { + "name": "object", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 55, + }, + "start": Object { + "column": 0, + "line": 55, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 16, + "line": 55, + }, + "start": Object { + "column": 0, + "line": 55, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f1", + "namespace": "f1", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "f1", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 56, + }, + "start": Object { + "column": 0, + "line": 56, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 16, + "line": 56, + }, + "start": Object { + "column": 0, + "line": 56, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f3", + "namespace": "f3", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "f3", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 60, + }, + "start": Object { + "column": 0, + "line": 60, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 23, + "line": 60, + }, + "start": Object { + "column": 0, + "line": 60, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T", + "namespace": "T", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 61, + }, + "start": Object { + "column": 0, + "line": 61, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 17, + "line": 61, + }, + "start": Object { + "column": 0, + "line": 61, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T2", + "namespace": "T2", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T2", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 62, + }, + "start": Object { + "column": 0, + "line": 62, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 17, + "line": 62, + }, + "start": Object { + "column": 0, + "line": 62, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T4", + "namespace": "T4", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T4", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 68, + }, + "start": Object { + "column": 0, + "line": 68, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 34, + "line": 68, + }, + "start": Object { + "column": 0, + "line": 68, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f4", + "namespace": "f4", + "params": Array [ + Object { + "lineNumber": 68, + "name": "x", + "title": "param", + "type": Object { + "name": "X", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "f4", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 74, + }, + "start": Object { + "column": 0, + "line": 72, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 2, + "line": 74, + }, + "start": Object { + "column": 0, + "line": 72, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 73, + }, + "start": Object { + "column": 2, + "line": 73, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 10, + "line": 73, + }, + "start": Object { + "column": 2, + "line": 73, + }, + }, + "memberof": "o1", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "om1", + "namespace": "o1.om1", + "params": Array [], + "path": Array [ + Object { + "name": "o1", + }, + Object { + "kind": "function", + "name": "om1", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "o1", + "namespace": "o1", + "params": Array [], + "path": Array [ + Object { + "name": "o1", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 80, + }, + "start": Object { + "column": 0, + "line": 77, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "f5 comment", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 17, + "line": 76, + }, + "start": Object { + "column": 0, + "line": 76, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f5", + "namespace": "f5", + "params": Array [ + Object { + "lineNumber": 77, + "name": "y", + "title": "param", + "type": Object { + "name": "Y", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "f5", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 80, + }, + "start": Object { + "column": 2, + "line": 78, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 80, + }, + "start": Object { + "column": 2, + "line": 78, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 79, + }, + "start": Object { + "column": 4, + "line": 79, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 12, + "line": 79, + }, + "start": Object { + "column": 4, + "line": 79, + }, + }, + "memberof": "o2", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "om2", + "namespace": "o2.om2", + "params": Array [], + "path": Array [ + Object { + "name": "o2", + }, + Object { + "kind": "function", + "name": "om2", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "o2", + "namespace": "o2", + "params": Array [], + "path": Array [ + Object { + "name": "o2", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs document-exported.input.js markdown 1`] = `"[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs document-exported.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "z", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "zMethod", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "x", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "yparam", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Class", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "classMethod", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "classGetter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "classSetter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "v", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "staticMethod", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "staticGetter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "staticSetter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "v", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T5", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "y2Default", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "y4", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Description of y3", + }, + ], + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "p", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "void", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "object", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "method", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "setter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "v", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "prop", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "func", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f1", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f3", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T2", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T4", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f4", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "X", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "o1", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "om1", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f5", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "f5 comment", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "y", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Y", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "o2", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "om2", + }, + ], + "depth": 3, + "type": "heading", + }, + ], + "type": "root", +} +`; + +exports[`outputs document-exported-export-default-object.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "document-exported-export-default-object.input", + "namespace": "document-exported-export-default-object.input", + "params": Array [], + "path": Array [ + Object { + "name": "document-exported-export-default-object.input", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [ + Object { + "commentLineNumber": 0, + "message": "@memberof reference to document-exported-export-default-object.input not found", + }, + ], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "memberof": "document-exported-export-default-object.input", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "x", + "namespace": ".x", + "params": Array [], + "path": Array [ + Object { + "name": "x", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs document-exported-export-default-object.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs document-exported-export-default-object.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "document-exported-export-default-object.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "x", + }, + ], + "depth": 2, + "type": "heading", + }, + ], + "type": "root", +} +`; + +exports[`outputs document-exported-export-default-value.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 18, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "document-exported-export-default-value.input", + "namespace": "document-exported-export-default-value.input", + "params": Array [], + "path": Array [ + Object { + "name": "document-exported-export-default-value.input", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs document-exported-export-default-value.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs document-exported-export-default-value.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "document-exported-export-default-value.input", + }, + ], + "depth": 2, + "type": "heading", + }, + ], + "type": "root", +} +`; + +exports[`outputs es6.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 33, + "line": 2, + "offset": 88, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function destructures with defaults. It should not +have any parameter descriptions.", + }, + ], + "position": Object { + "end": Object { + "column": 33, + "line": 2, + "offset": 88, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 33, + "line": 2, + "offset": 88, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "destructure", + "namespace": "destructure", + "params": Array [ + Object { + "anonymous": true, + "default": "{}", + "name": "$0", + "properties": Array [ + Object { + "default": "[]", + "lineNumber": 6, + "name": "$0.phoneNumbers", + "title": "param", + }, + Object { + "default": "[]", + "lineNumber": 6, + "name": "$0.emailAddresses", + "title": "param", + }, + Object { + "lineNumber": 6, + "name": "$0.params", + "title": "param", + "type": Object { + "type": "RestType", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "destructure", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 14, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Similar, but with an array", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "description": "destructure([1, 2, 3])", + }, + ], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "destructure", + "namespace": "destructure", + "params": Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 14, + "name": "$0.0", + "title": "param", + }, + Object { + "lineNumber": 14, + "name": "$0.1", + "title": "param", + }, + Object { + "lineNumber": 14, + "name": "$0.2", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Array", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "destructure", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "destructure([1, 2, 3])", + "lineNumber": 2, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 21, + }, + "start": Object { + "column": 0, + "line": 21, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 0, + "line": 16, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "multiply", + "namespace": "multiply", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an array of numbers", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "Number", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "lineNumber": 21, + "name": "b", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "multiply", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "an array of numbers", + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "Number", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "description": "numberone", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 60, + }, + "start": Object { + "column": 0, + "line": 28, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a sink", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 27, + }, + "start": Object { + "column": 0, + "line": 23, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 37, + }, + "start": Object { + "column": 2, + "line": 37, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a property of the sink.", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 5, + "line": 36, + }, + "start": Object { + "column": 2, + "line": 34, + }, + }, + "memberof": "Sink", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "staticProp", + "namespace": "Sink#staticProp", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Sink", + }, + Object { + "kind": "member", + "name": "staticProp", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 44, + }, + "start": Object { + "column": 2, + "line": 42, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Is it empty", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 41, + }, + "start": Object { + "column": 2, + "line": 39, + }, + }, + "memberof": "Sink", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "empty", + "namespace": "Sink#empty", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Sink", + }, + Object { + "kind": "function", + "name": "empty", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 59, + }, + "start": Object { + "column": 2, + "line": 57, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 2, + "offset": 63, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a getter method: it should be documented +as a property.", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 2, + "offset": 63, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 2, + "offset": 63, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "member", + "loc": Object { + "end": Object { + "column": 5, + "line": 56, + }, + "start": Object { + "column": 2, + "line": 53, + }, + }, + "memberof": "Sink", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "aGetter", + "namespace": "Sink#aGetter", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Sink", + }, + Object { + "kind": "member", + "name": "aGetter", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 51, + }, + "start": Object { + "column": 2, + "line": 49, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method says hello", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 48, + }, + "start": Object { + "column": 2, + "line": 46, + }, + }, + "memberof": "Sink", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "hello", + "namespace": "Sink.hello", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Sink", + }, + Object { + "kind": "function", + "name": "hello", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "Sink", + "namespace": "Sink", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the height of the thing", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "height", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the width of the thing", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "width", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Sink", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "the height of the thing", + "lineNumber": 2, + "name": "height", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "the width of the thing", + "lineNumber": 3, + "name": "width", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 67, + }, + "start": Object { + "column": 0, + "line": 67, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 61, + "line": 1, + "offset": 60, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + }, + ], + "position": Object { + "end": Object { + "column": 61, + "line": 1, + "offset": 60, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 61, + "line": 1, + "offset": 60, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 66, + }, + "start": Object { + "column": 0, + "line": 62, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "makeABasket", + "namespace": "makeABasket", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "makeABasket", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "a basket", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Basket", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "a basket", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "Basket", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 75, + }, + "start": Object { + "column": 0, + "line": 75, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method returns a ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "sink", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 40, + "line": 1, + "offset": 39, + }, + "indent": Array [], + "start": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + }, + "title": null, + "type": "link", + "url": "Sink", + }, + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 2, + "offset": 79, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 40, + "line": 1, + "offset": 39, + }, + }, + "type": "text", + "value": ". The type should be linked. +It takes a ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 26, + "line": 2, + "offset": 93, + }, + "indent": Array [], + "start": Object { + "column": 12, + "line": 2, + "offset": 79, + }, + }, + "title": null, + "type": "link", + "url": "number", + }, + Object { + "position": Object { + "end": Object { + "column": 55, + "line": 2, + "offset": 122, + }, + "indent": Array [], + "start": Object { + "column": 26, + "line": 2, + "offset": 93, + }, + }, + "type": "text", + "value": " which should also be linked.", + }, + ], + "position": Object { + "end": Object { + "column": 55, + "line": 2, + "offset": 122, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 55, + "line": 2, + "offset": 122, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 74, + }, + "start": Object { + "column": 0, + "line": 69, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "makeASink", + "namespace": "makeASink", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "makeASink", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "a sink", + }, + ], + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Sink", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "a sink", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "Sink", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 80, + }, + "start": Object { + "column": 0, + "line": 80, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function takes rest params", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 79, + }, + "start": Object { + "column": 0, + "line": 77, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "functionWithRest", + "namespace": "functionWithRest", + "params": Array [ + Object { + "lineNumber": 80, + "name": "someParams", + "title": "param", + "type": Object { + "type": "RestType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "functionWithRest", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 92, + }, + "start": Object { + "column": 0, + "line": 85, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "So does this one, with types", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 84, + }, + "start": Object { + "column": 0, + "line": 82, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "functionWithRestAndType", + "namespace": "functionWithRestAndType", + "params": Array [ + Object { + "lineNumber": 85, + "name": "someParams", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "RestType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "functionWithRestAndType", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 99, + }, + "start": Object { + "column": 0, + "line": 99, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is an async method", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 98, + }, + "start": Object { + "column": 0, + "line": 96, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 107, + }, + "start": Object { + "column": 0, + "line": 107, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 106, + }, + "start": Object { + "column": 0, + "line": 103, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "es6.input", + "namespace": "es6.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "es6.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 114, + }, + "start": Object { + "column": 0, + "line": 112, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support of optional parameters in ES6", + }, + ], + "position": Object { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 111, + }, + "start": Object { + "column": 0, + "line": 109, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "veryImportantTransform", + "namespace": "veryImportantTransform", + "params": Array [ + Object { + "default": "'bar'", + "lineNumber": 112, + "name": "foo", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "veryImportantTransform", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "access": "protected", + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 128, + }, + "start": Object { + "column": 0, + "line": 128, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A protected function", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 127, + }, + "start": Object { + "column": 0, + "line": 124, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "iAmProtected", + "namespace": "iAmProtected", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "iAmProtected", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "title": "protected", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "access": "public", + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 134, + }, + "start": Object { + "column": 0, + "line": 134, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A public function", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 133, + }, + "start": Object { + "column": 0, + "line": 130, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "iAmPublic", + "namespace": "iAmPublic", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "iAmPublic", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "title": "public", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 145, + }, + "start": Object { + "column": 0, + "line": 145, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is re-exported", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 144, + }, + "start": Object { + "column": 0, + "line": 142, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "execute", + "namespace": "execute", + "params": Array [], + "path": Array [ + Object { + "name": "execute", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 154, + }, + "start": Object { + "column": 0, + "line": 148, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Regression check for #498", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 32, + "line": 147, + }, + "start": Object { + "column": 0, + "line": 147, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "isArrayEqualWith", + "namespace": "isArrayEqualWith", + "params": Array [ + Object { + "lineNumber": 149, + "name": "array1", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "T", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "lineNumber": 150, + "name": "array2", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "T", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "default": "(a:T,b:T):boolean=>a===b", + "lineNumber": 151, + "name": "compareFunction", + "title": "param", + "type": Object { + "params": Array [ + Object { + "expression": Object { + "name": "T", + "type": "NameExpression", + }, + "name": "a", + "type": "ParameterType", + }, + Object { + "expression": Object { + "name": "T", + "type": "NameExpression", + }, + "name": "b", + "type": "ParameterType", + }, + ], + "result": Object { + "name": "boolean", + "type": "NameExpression", + }, + "type": "FunctionType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "isArrayEqualWith", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "title": "returns", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 159, + }, + "start": Object { + "column": 0, + "line": 157, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Regression check for #749", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 32, + "line": 156, + }, + "start": Object { + "column": 0, + "line": 156, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "paramWithMemberType", + "namespace": "paramWithMemberType", + "params": Array [ + Object { + "lineNumber": 157, + "name": "a", + "title": "param", + "type": Object { + "name": "atype.property", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "paramWithMemberType", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "title": "returns", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs es6.input.js markdown 1`] = `"[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs es6.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "destructure", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 33, + "line": 2, + "offset": 88, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function destructures with defaults. It should not +have any parameter descriptions.", + }, + ], + "position": Position { + "end": Object { + "column": 33, + "line": 2, + "offset": 88, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "{}", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.phoneNumbers", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "[]", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.emailAddresses", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "[]", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.params", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "...", + }, + Object { + "type": "text", + "value": "any", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "destructure", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Similar, but with an array", + }, + ], + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.0", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.1", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$0.2", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Examples", + }, + ], + "type": "strong", + }, + Object { + "lang": "javascript", + "type": "code", + "value": "destructure([1, 2, 3])", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "multiply", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an array of numbers", + }, + ], + "position": Position { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "b", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Sink", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a sink", + }, + ], + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "height", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the height of the thing", + }, + ], + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "width", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the width of the thing", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "staticProp", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a property of the sink.", + }, + ], + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "empty", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Is it empty", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "aGetter", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 2, + "offset": 63, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is a getter method: it should be documented +as a property.", + }, + ], + "position": Position { + "end": Object { + "column": 15, + "line": 2, + "offset": 63, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "hello", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method says hello", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "makeABasket", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 61, + "line": 1, + "offset": 60, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method returns a basket. The type should not be linked.", + }, + ], + "position": Position { + "end": Object { + "column": 61, + "line": 1, + "offset": 60, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Basket", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "a basket", + }, + ], + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "makeASink", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method returns a ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "sink", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 40, + "line": 1, + "offset": 39, + }, + "indent": Array [], + "start": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + }, + "title": null, + "type": "link", + "url": "#sink", + }, + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 2, + "offset": 79, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 40, + "line": 1, + "offset": 39, + }, + }, + "type": "text", + "value": ". The type should be linked. +It takes a ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 26, + "line": 2, + "offset": 93, + }, + "indent": Array [], + "start": Object { + "column": 12, + "line": 2, + "offset": 79, + }, + }, + "title": null, + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "position": Position { + "end": Object { + "column": 55, + "line": 2, + "offset": 122, + }, + "indent": Array [], + "start": Object { + "column": 26, + "line": 2, + "offset": 93, + }, + }, + "type": "text", + "value": " which should also be linked.", + }, + ], + "position": Position { + "end": Object { + "column": 55, + "line": 2, + "offset": 122, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Sink", + }, + ], + "href": "#sink", + "type": "link", + "url": "#sink", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "a sink", + }, + ], + "position": Position { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "functionWithRest", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function takes rest params", + }, + ], + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "someParams", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "...", + }, + Object { + "type": "text", + "value": "any", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "functionWithRestAndType", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "So does this one, with types", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "someParams", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "...", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is an async method", + }, + ], + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "es6.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "veryImportantTransform", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support of optional parameters in ES6", + }, + ], + "position": Position { + "end": Object { + "column": 53, + "line": 1, + "offset": 52, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "foo", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "'bar'", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "iAmProtected", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A protected function", + }, + ], + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "iAmPublic", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A public function", + }, + ], + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "execute", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is re-exported", + }, + ], + "position": Position { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "isArrayEqualWith", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Regression check for #498", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "array1", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "type": "text", + "value": "T", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "array2", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "type": "text", + "value": "T", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "compareFunction", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "function (", + }, + Object { + "type": "text", + "value": "a: ", + }, + Object { + "type": "text", + "value": "T", + }, + Object { + "type": "text", + "value": ", ", + }, + Object { + "type": "text", + "value": "b: ", + }, + Object { + "type": "text", + "value": "T", + }, + Object { + "type": "text", + "value": ")", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "(a:T,b:T):boolean=>a===b", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "paramWithMemberType", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Regression check for #749", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "atype.property", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs es6.input.js no markdown TOC 1`] = `"[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs es6-class.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [ + Object { + "name": "React.Component", + "title": "augments", + }, + ], + "context": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my component. This is from issue #458", + }, + ], + "position": Object { + "end": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Foo", + "namespace": "Foo", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 18, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Does nothing. This is from issue #556", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 16, + }, + "start": Object { + "column": 4, + "line": 16, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A useless property", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 7, + "line": 15, + }, + "start": Object { + "column": 4, + "line": 12, + }, + }, + "memberof": "Bar", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bar", + "namespace": "Bar#bar", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Bar", + }, + Object { + "name": "bar", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "title": "type", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "Bar", + "namespace": "Bar", + "params": Array [ + Object { + "lineNumber": 2, + "name": "str", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Bar", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "str", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 25, + }, + "start": Object { + "column": 0, + "line": 23, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This class has fully inferred constructor parameters.", + }, + ], + "position": Object { + "end": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 22, + }, + "start": Object { + "column": 0, + "line": 20, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Baz", + "namespace": "Baz", + "params": Array [ + Object { + "lineNumber": 24, + "name": "n", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 24, + "name": "l", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Baz", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs es6-class.input.js markdown 1`] = `"[object Object],[object Object],[object Object]"`; + +exports[`outputs es6-class.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Extends ", + }, + Object { + "type": "text", + "value": "React.Component", + }, + ], + "type": "strong", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my component. This is from issue #458", + }, + ], + "position": Position { + "end": Object { + "column": 46, + "line": 1, + "offset": 45, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Bar", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Does nothing. This is from issue #556", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "str", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "bar", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A useless property", + }, + ], + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Baz", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This class has fully inferred constructor parameters.", + }, + ], + "position": Position { + "end": Object { + "column": 54, + "line": 1, + "offset": 53, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "n", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "l", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs es6-default2.input.js JSON 1`] = ` +Array [ + Object { + "access": "public", + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "es6-default2.input", + "namespace": "es6-default2.input", + "params": Array [ + Object { + "lineNumber": 4, + "name": "thisIsTheArgument", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "es6-default2.input", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "title": "public", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs es6-default2.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs es6-default2.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "es6-default2.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "thisIsTheArgument", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs es6-import.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 11, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "multiplyTwice", + "namespace": "multiplyTwice", + "params": Array [ + Object { + "lineNumber": 11, + "name": "a", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "multiplyTwice", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is the default export frogs!", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "es6-ext", + "namespace": "es6-ext", + "params": Array [], + "path": Array [ + Object { + "name": "es6-ext", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs es6-import.input.js markdown 1`] = `"[object Object],[object Object],[object Object]"`; + +exports[`outputs es6-import.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "multiplyTwice", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "es6-ext", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is the default export frogs!", + }, + ], + "position": Position { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "simple.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs event.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Mouse event", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "event", + "loc": Object { + "end": Object { + "column": 3, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Map#mousemove", + "namespace": ".event:Map#mousemove", + "params": Array [], + "path": Array [ + Object { + "kind": "event", + "name": "Map#mousemove", + }, + ], + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the pixel location of the event", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "point", + "title": "property", + "type": Object { + "name": "Point", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the original DOM event", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 6, + "name": "originalEvent", + "title": "property", + "type": Object { + "name": "Event", + "type": "NameExpression", + }, + }, + ], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "Map#mousemove", + "lineNumber": 3, + "title": "event", + }, + Object { + "description": null, + "lineNumber": 4, + "title": "type", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + Object { + "description": "the pixel location of the event", + "lineNumber": 5, + "name": "point", + "title": "property", + "type": Object { + "name": "Point", + "type": "NameExpression", + }, + }, + Object { + "description": "the original DOM event", + "lineNumber": 6, + "name": "originalEvent", + "title": "property", + "type": Object { + "name": "Event", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs event.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs event.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Map#mousemove", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Mouse event", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Properties", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "point", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Point", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the pixel location of the event", + }, + ], + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "originalEvent", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Event", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/API/Event", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/API/Event", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the original DOM event", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs example-caption.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "caption": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "demonstrates how to run foo", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "description": "foo(1);", + }, + ], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "caption": "demonstrates how to run foo", + "description": "foo(1);", + "lineNumber": 3, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs example-caption.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs example-caption.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Examples", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "demonstrates how to run foo", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "emphasis", + }, + ], + "type": "paragraph", + }, + Object { + "lang": "javascript", + "type": "code", + "value": "foo(1);", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs external.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs external.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs external.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs factory.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 18, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an area chart generator", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "area", + "namespace": "area", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "area", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "chart", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "area", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "chart", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "area", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 9, + }, + "start": Object { + "column": 2, + "line": 9, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 5, + "line": 8, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "area", + "namespace": "area", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "area", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "name": "area", + "title": "class", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Sets the chart data.", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "commentLineNumber": 0, + "message": "@memberof reference to chart not found", + }, + ], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "memberof": "chart", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "data", + "namespace": ".data", + "params": Array [ + Object { + "lineNumber": 15, + "name": "_", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "data", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": null, + "title": "function", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs factory.input.js markdown 1`] = `"[object Object],[object Object],[object Object]"`; + +exports[`outputs factory.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "area", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an area chart generator", + }, + ], + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "area", + }, + ], + "href": "#area", + "type": "link", + "url": "#area", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "chart", + }, + ], + "position": Position { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "area", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "data", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Sets the chart data.", + }, + ], + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "_", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs flow-unnamed-params.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "x2", + }, + ], + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "x2", + "namespace": "x2", + "params": Array [], + "path": Array [ + Object { + "name": "x2", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "params": Array [ + Object { + "expression": Object { + "name": "T", + "type": "NameExpression", + }, + "name": "a", + "type": "ParameterType", + }, + ], + "result": Object { + "name": "string", + "type": "NameExpression", + }, + "type": "FunctionType", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "T", + }, + ], + "position": Object { + "end": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 8, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T", + "namespace": "T", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "params": Array [ + Object { + "expression": Object { + "applications": Array [ + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + "name": "", + "type": "ParameterType", + }, + ], + "result": Object { + "fields": Array [ + Object { + "key": "num", + "type": "FieldType", + "value": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "type": "RecordType", + }, + "type": "FunctionType", + }, + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "T2", + }, + ], + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 9, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "T2", + "namespace": "T2", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "T2", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "params": Array [ + Object { + "expression": Object { + "applications": Array [ + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + "name": "a", + "type": "ParameterType", + }, + ], + "result": Object { + "fields": Array [ + Object { + "key": "num", + "type": "FieldType", + "value": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "type": "RecordType", + }, + "type": "FunctionType", + }, + }, +] +`; + +exports[`outputs flow-unnamed-params.input.js markdown 1`] = `"[object Object],[object Object],[object Object]"`; + +exports[`outputs flow-unnamed-params.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "x2", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "x2", + }, + ], + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "type": "text", + "value": "function (", + }, + Object { + "type": "text", + "value": "a: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T", + }, + ], + "href": "#t", + "type": "link", + "url": "#t", + }, + Object { + "type": "text", + "value": ")", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "T", + }, + ], + "position": Position { + "end": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "type": "text", + "value": "function (", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": ">", + }, + Object { + "type": "text", + "value": ")", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "type": "text", + "value": "{", + }, + Object { + "type": "text", + "value": "num: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "}", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "T2", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "T2", + }, + ], + "position": Position { + "end": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "type": "text", + "value": "function (", + }, + Object { + "type": "text", + "value": "a: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": ">", + }, + Object { + "type": "text", + "value": ")", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "type": "text", + "value": "{", + }, + Object { + "type": "text", + "value": "num: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "}", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs infer-private.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 14, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "C description", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 20, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "m description", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 22, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 10, + }, + }, + "memberof": "C", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "m", + "namespace": "C#m", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + Object { + "kind": "function", + "name": "m", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "C", + "namespace": "C", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs infer-private.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs infer-private.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "C", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "C description", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "m", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "m description", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs inheritance.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [ + Object { + "name": "Array", + "title": "augments", + }, + ], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "With ES6, built-in types are extensible!", + }, + ], + "position": Object { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "SpecialArray", + "namespace": "SpecialArray", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "SpecialArray", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 42, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 17, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Foo", + "namespace": "Foo", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 0, + "name": "Foo", + "title": "class", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs inheritance.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs inheritance.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "SpecialArray", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Extends ", + }, + Object { + "type": "text", + "value": "Array", + }, + ], + "type": "strong", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "With ES6, built-in types are extensible!", + }, + ], + "position": Position { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Foo", + }, + ], + "depth": 2, + "type": "heading", + }, + ], + "type": "root", +} +`; + +exports[`outputs inline-link.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Adds one to a number", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "addOne", + "namespace": "addOne", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the input", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "addOne", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the output", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the input", + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "the output", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 21, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 1, + "line": 2, + "offset": 60, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one. Internally, this uses +", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "addOne", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 15, + "line": 2, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 2, + "offset": 60, + }, + }, + "title": null, + "type": "link", + "url": "addOne", + }, + Object { + "position": Object { + "end": Object { + "column": 1, + "line": 3, + "offset": 109, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 15, + "line": 2, + "offset": 74, + }, + }, + "type": "text", + "value": " to do the math. This demonstrates +", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Addition", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 56, + "line": 3, + "offset": 164, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 109, + }, + }, + "title": null, + "type": "link", + "url": "https://en.wikipedia.org/wiki/Addition", + }, + Object { + "position": Object { + "end": Object { + "column": 5, + "line": 4, + "offset": 169, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 56, + "line": 3, + "offset": 164, + }, + }, + "type": "text", + "value": " +and ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "https://en.wikipedia.org/wiki/Addition", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 51, + "line": 4, + "offset": 215, + }, + "indent": Array [], + "start": Object { + "column": 5, + "line": 4, + "offset": 169, + }, + }, + "title": null, + "type": "link", + "url": "https://en.wikipedia.org/wiki/Addition", + }, + ], + "position": Object { + "end": Object { + "column": 51, + "line": 4, + "offset": 215, + }, + "indent": Array [ + 1, + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 30, + "line": 6, + "offset": 246, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 6, + "offset": 217, + }, + }, + "type": "text", + "value": "This link refers to nothing: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "nothing", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 45, + "line": 6, + "offset": 261, + }, + "indent": Array [], + "start": Object { + "column": 30, + "line": 6, + "offset": 246, + }, + }, + "title": null, + "type": "link", + "url": "nothing", + }, + ], + "position": Object { + "end": Object { + "column": 45, + "line": 6, + "offset": 261, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 6, + "offset": 217, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 45, + "line": 6, + "offset": 261, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "inline-link.input", + "namespace": "inline-link.input", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the input", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 8, + "name": "a", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "inline-link.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the input", + "lineNumber": 8, + "name": "a", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "numberone", + "lineNumber": 9, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs inline-link.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs inline-link.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "addOne", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Adds one to a number", + }, + ], + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the input", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the output", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "inline-link.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 1, + "line": 2, + "offset": 60, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one. Internally, this uses +", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "addOne", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 15, + "line": 2, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 2, + "offset": 60, + }, + }, + "title": null, + "type": "link", + "url": "#addone", + }, + Object { + "position": Position { + "end": Object { + "column": 1, + "line": 3, + "offset": 109, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 15, + "line": 2, + "offset": 74, + }, + }, + "type": "text", + "value": " to do the math. This demonstrates +", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Addition", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 56, + "line": 3, + "offset": 164, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 109, + }, + }, + "title": null, + "type": "link", + "url": "https://en.wikipedia.org/wiki/Addition", + }, + Object { + "position": Position { + "end": Object { + "column": 5, + "line": 4, + "offset": 169, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 56, + "line": 3, + "offset": 164, + }, + }, + "type": "text", + "value": " +and ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "https://en.wikipedia.org/wiki/Addition", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 51, + "line": 4, + "offset": 215, + }, + "indent": Array [], + "start": Object { + "column": 5, + "line": 4, + "offset": 169, + }, + }, + "title": null, + "type": "link", + "url": "https://en.wikipedia.org/wiki/Addition", + }, + ], + "position": Position { + "end": Object { + "column": 51, + "line": 4, + "offset": 215, + }, + "indent": Array [ + 1, + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 30, + "line": 6, + "offset": 246, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 6, + "offset": 217, + }, + }, + "type": "text", + "value": "This link refers to nothing: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "nothing", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 45, + "line": 6, + "offset": 261, + }, + "indent": Array [], + "start": Object { + "column": 30, + "line": 6, + "offset": 246, + }, + }, + "title": null, + "type": "link", + "url": "nothing", + }, + ], + "position": Position { + "end": Object { + "column": 45, + "line": 6, + "offset": 261, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 6, + "offset": 217, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the input", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs interface.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [ + Object { + "name": "Bar", + "title": "extends", + }, + Object { + "name": "Baz", + "title": "extends", + }, + ], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my interface.", + }, + ], + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "interface", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Foo", + "namespace": "Foo", + "params": Array [], + "path": Array [ + Object { + "kind": "interface", + "name": "Foo", + }, + ], + "properties": Array [ + Object { + "lineNumber": 5, + "name": "prop1", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 6, + "name": "prop2", + "title": "property", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs interface.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs interface.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Extends ", + }, + Object { + "type": "text", + "value": "Bar, Baz", + }, + ], + "type": "strong", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my interface.", + }, + ], + "position": Position { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Properties", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "prop1", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "prop2", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs internal.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs internal.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs internal.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs lends.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [ + Object { + "description": null, + "lineNumber": 3, + "name": "Augmented", + "title": "augments", + "type": null, + }, + ], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 26, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A neat layout view", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 16, + }, + "start": Object { + "column": 4, + "line": 14, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "My neat function", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 7, + "line": 13, + }, + "start": Object { + "column": 4, + "line": 9, + }, + }, + "memberof": "TheClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "TheClass#foo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "word", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "TheClass", + }, + Object { + "kind": "function", + "name": "foo", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word but one better", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "your word", + "lineNumber": 2, + "name": "word", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "your word but one better", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 24, + }, + "start": Object { + "column": 4, + "line": 22, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "My neat function", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 7, + "line": 21, + }, + "start": Object { + "column": 4, + "line": 17, + }, + }, + "memberof": "TheClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bar", + "namespace": "TheClass#bar", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "word", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "TheClass", + }, + Object { + "kind": "function", + "name": "bar", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word but one better", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "your word", + "lineNumber": 2, + "name": "word", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "your word but one better", + "lineNumber": 3, + "title": "returns", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "TheClass", + "namespace": "TheClass", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "TheClass", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "TheClass", + "title": "class", + "type": null, + }, + Object { + "description": null, + "lineNumber": 3, + "name": "Augmented", + "title": "augments", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs lends.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs lends.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "TheClass", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Extends ", + }, + Object { + "type": "text", + "value": "Augmented", + }, + ], + "type": "strong", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A neat layout view", + }, + ], + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "My neat function", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "word", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word but one better", + }, + ], + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "bar", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "My neat function", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "word", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "your word but one better", + }, + ], + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs literal_types.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f", + "namespace": "f", + "params": Array [ + Object { + "lineNumber": 1, + "name": "x", + "title": "param", + "type": Object { + "elements": Array [ + Object { + "type": "StringLiteralType", + "value": "a", + }, + Object { + "type": "StringLiteralType", + "value": "b", + }, + Object { + "type": "StringLiteralType", + "value": "", + }, + Object { + "type": "NumericLiteralType", + "value": 0, + }, + Object { + "type": "NumericLiteralType", + "value": -42, + }, + Object { + "type": "NumericLiteralType", + "value": 3.14, + }, + ], + "type": "UnionType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "f", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "name": "x", + "title": "param", + "type": Object { + "elements": Array [ + Object { + "type": "StringLiteralType", + "value": "a", + }, + Object { + "type": "StringLiteralType", + "value": "b", + }, + Object { + "type": "StringLiteralType", + "value": "", + }, + Object { + "type": "NumericLiteralType", + "value": 0, + }, + Object { + "type": "NumericLiteralType", + "value": -42, + }, + Object { + "type": "NumericLiteralType", + "value": 3.14, + }, + ], + "type": "UnionType", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 49, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "g", + "namespace": "g", + "params": Array [ + Object { + "lineNumber": 7, + "name": "x", + "title": "param", + "type": Object { + "elements": Array [ + Object { + "type": "StringLiteralType", + "value": "a", + }, + Object { + "type": "StringLiteralType", + "value": "b", + }, + Object { + "type": "StringLiteralType", + "value": "", + }, + Object { + "type": "NumericLiteralType", + "value": 0, + }, + Object { + "type": "NumericLiteralType", + "value": -42, + }, + Object { + "type": "NumericLiteralType", + "value": 3.14, + }, + ], + "type": "UnionType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "g", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs literal_types.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs literal_types.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "(", + }, + Object { + "type": "inlineCode", + "value": "\\"a\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "\\"b\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "\\"\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "0", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "-42", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "3.14", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "g", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "(", + }, + Object { + "type": "inlineCode", + "value": "\\"a\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "\\"b\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "\\"\\"", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "0", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "-42", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "type": "inlineCode", + "value": "3.14", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs memberedclass.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 28, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my class, a demo thing.", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "commentLineNumber": 4, + "message": "@memberof reference to com.Test not found", + }, + ], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "memberof": "com.Test", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 20, + }, + "start": Object { + "column": 2, + "line": 18, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the number 42", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 7, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + "memberof": "com.Test.MyClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getFoo", + "namespace": "MyClass#getFoo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "whether to get the number", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "getIt", + "title": "param", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + Object { + "kind": "function", + "name": "getFoo", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forty-two", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "whether to get the number", + "lineNumber": 3, + "name": "getIt", + "title": "param", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + Object { + "description": "forty-two", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 27, + }, + "start": Object { + "column": 2, + "line": 27, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get undefined", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 7, + "line": 26, + }, + "start": Object { + "column": 2, + "line": 22, + }, + }, + "memberof": "com.Test.MyClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getUndefined", + "namespace": "MyClass.getUndefined", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + Object { + "kind": "function", + "name": "getUndefined", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "does not return anything.", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "scope": "static", + "sees": Array [], + "tags": Array [ + Object { + "description": "does not return anything.", + "lineNumber": 3, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "MyClass", + "namespace": "MyClass", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "MyClass", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 3, + "name": "MyClass", + "title": "class", + "type": null, + }, + Object { + "description": "com.Test", + "lineNumber": 4, + "title": "memberof", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs memberedclass.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs memberedclass.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "MyClass", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is my class, a demo thing.", + }, + ], + "position": Position { + "end": Object { + "column": 32, + "line": 1, + "offset": 31, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getFoo", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the number 42", + }, + ], + "position": Position { + "end": Object { + "column": 18, + "line": 1, + "offset": 17, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "getIt", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "whether to get the number", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forty-two", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getUndefined", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get undefined", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "undefined", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "does not return anything.", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs merge-infered-type.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Add five to ", + }, + Object { + "position": Object { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + }, + "type": "inlineCode", + "value": "x", + }, + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "addFive", + "namespace": "addFive", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number to add five to.", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "addFive", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "x plus five.", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "The number to add five to.", + "lineNumber": 3, + "name": "x", + "title": "param", + "type": null, + }, + Object { + "description": "x plus five.", + "lineNumber": 4, + "title": "returns", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs merge-infered-type.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs merge-infered-type.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "addFive", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Add five to ", + }, + Object { + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + }, + "type": "inlineCode", + "value": "x", + }, + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number to add five to.", + }, + ], + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "x plus five.", + }, + ], + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs meta.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 16, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + }, + "copyright": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Tom MacWright", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "license": "BSD", + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "meta.input", + "namespace": "meta.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "meta.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "github", + }, + ], + "jsdoc": true, + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "title": null, + "type": "link", + "url": "http://github.com/", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "TestCase", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + }, + "type": "text", + "value": "markdown link", + }, + ], + "position": Object { + "end": Object { + "column": 33, + "line": 1, + "offset": 32, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "title": null, + "type": "link", + "url": "http://foo.com/", + }, + ], + "position": Object { + "end": Object { + "column": 33, + "line": 1, + "offset": 32, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 33, + "line": 1, + "offset": 32, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + ], + "since": "2.0.0", + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "This function returns the number one.", + "lineNumber": 3, + "title": "description", + }, + Object { + "description": "{@link http://github.com/|github}", + "lineNumber": 4, + "title": "see", + }, + Object { + "description": "TestCase", + "lineNumber": 5, + "title": "see", + }, + Object { + "description": "[markdown link](http://foo.com/)", + "lineNumber": 6, + "title": "see", + }, + Object { + "description": "1.0.0", + "lineNumber": 7, + "title": "version", + }, + Object { + "description": "2.0.0", + "lineNumber": 8, + "title": "since", + }, + Object { + "description": "Tom MacWright", + "lineNumber": 9, + "title": "copyright", + }, + Object { + "description": "BSD", + "lineNumber": 10, + "title": "license", + }, + ], + "throws": Array [], + "todos": Array [], + "version": "1.0.0", + }, +] +`; + +exports[`outputs meta.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs meta.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "meta.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "See: ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "github", + }, + ], + "jsdoc": true, + "position": Position { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "title": null, + "type": "link", + "url": "http://github.com/", + }, + ], + "position": Position { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "strong", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "See: ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "TestCase", + }, + ], + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "strong", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "See: ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 2, + "line": 1, + "offset": 1, + }, + }, + "type": "text", + "value": "markdown link", + }, + ], + "position": Position { + "end": Object { + "column": 33, + "line": 1, + "offset": 32, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "title": null, + "type": "link", + "url": "http://foo.com/", + }, + ], + "position": Position { + "end": Object { + "column": 33, + "line": 1, + "offset": 32, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "strong", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Meta", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "version", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "type": "text", + "value": "1.0.0", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "since", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "type": "text", + "value": "2.0.0", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "copyright", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Tom MacWright", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "license", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": ": ", + }, + Object { + "type": "text", + "value": "BSD", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs multisignature.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the time", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getTheTime", + "namespace": "getTheTime", + "params": Array [ + Object { + "lineNumber": 13, + "name": "time", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "getTheTime", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current date", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Date", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the current date", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Date", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 13, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Set the time", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 12, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "getTheTime", + "namespace": "getTheTime", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current time", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "time", + "title": "param", + "type": Object { + "name": "Date", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "getTheTime", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 8, + "line": 1, + "offset": 7, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "nothing", + }, + ], + "position": Object { + "end": Object { + "column": 8, + "line": 1, + "offset": 7, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 8, + "line": 1, + "offset": 7, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the current time", + "lineNumber": 2, + "name": "time", + "title": "param", + "type": Object { + "name": "Date", + "type": "NameExpression", + }, + }, + Object { + "description": "nothing", + "lineNumber": 3, + "title": "returns", + "type": Object { + "type": "UndefinedLiteral", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs multisignature.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs multisignature.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getTheTime", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Get the time", + }, + ], + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "time", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Date", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current date", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "getTheTime", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Set the time", + }, + ], + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "time", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Date", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current time", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "undefined", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 8, + "line": 1, + "offset": 7, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "nothing", + }, + ], + "position": Position { + "end": Object { + "column": 8, + "line": 1, + "offset": 7, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs nearby_params.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Attempt to establish a cookie-based session in exchange for credentials.", + }, + ], + "position": Object { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "sessions.create", + "namespace": "sessions.create", + "params": Array [ + Object { + "lineNumber": 3, + "name": "credentials", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Login username. Also accepted as ", + }, + Object { + "position": Object { + "end": Object { + "column": 44, + "line": 1, + "offset": 43, + }, + "indent": Array [], + "start": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + }, + "type": "inlineCode", + "value": "username", + }, + Object { + "position": Object { + "end": Object { + "column": 48, + "line": 1, + "offset": 47, + }, + "indent": Array [], + "start": Object { + "column": 44, + "line": 1, + "offset": 43, + }, + }, + "type": "text", + "value": " or ", + }, + Object { + "position": Object { + "end": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + "indent": Array [], + "start": Object { + "column": 48, + "line": 1, + "offset": 47, + }, + }, + "type": "inlineCode", + "value": "email", + }, + Object { + "position": Object { + "end": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + "indent": Array [], + "start": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Object { + "end": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "credentials.name", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Login password", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "credentials.password", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "name": "object", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Gets passed ", + }, + Object { + "position": Object { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + }, + "type": "inlineCode", + "value": "(err, { success:Boolean })", + }, + Object { + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 6, + "name": "callback", + "title": "param", + "type": Object { + "expression": Object { + "name": "function", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "sessions.create", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "promise, to be resolved on success or rejected on failure", + }, + ], + "position": Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Promise", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "name": null, + "title": "function", + }, + Object { + "description": null, + "lineNumber": 2, + "name": "sessions.create", + "title": "name", + }, + Object { + "description": null, + "lineNumber": 3, + "name": "credentials", + "title": "param", + "type": Object { + "name": "object", + "type": "NameExpression", + }, + }, + Object { + "description": "Login username. Also accepted as \`username\` or \`email\`.", + "lineNumber": 4, + "name": "credentials.name", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "Login password", + "lineNumber": 5, + "name": "credentials.password", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "Gets passed \`(err, { success:Boolean })\`.", + "lineNumber": 6, + "name": "callback", + "title": "param", + "type": Object { + "expression": Object { + "name": "function", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "promise, to be resolved on success or rejected on failure", + "lineNumber": 7, + "title": "returns", + "type": Object { + "name": "Promise", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs nearby_params.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs nearby_params.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "sessions.create", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Attempt to establish a cookie-based session in exchange for credentials.", + }, + ], + "position": Position { + "end": Object { + "column": 73, + "line": 1, + "offset": 72, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "credentials", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "credentials.name", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Login username. Also accepted as ", + }, + Object { + "position": Position { + "end": Object { + "column": 44, + "line": 1, + "offset": 43, + }, + "indent": Array [], + "start": Object { + "column": 34, + "line": 1, + "offset": 33, + }, + }, + "type": "inlineCode", + "value": "username", + }, + Object { + "position": Position { + "end": Object { + "column": 48, + "line": 1, + "offset": 47, + }, + "indent": Array [], + "start": Object { + "column": 44, + "line": 1, + "offset": 43, + }, + }, + "type": "text", + "value": " or ", + }, + Object { + "position": Position { + "end": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + "indent": Array [], + "start": Object { + "column": 48, + "line": 1, + "offset": 47, + }, + }, + "type": "inlineCode", + "value": "email", + }, + Object { + "position": Position { + "end": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + "indent": Array [], + "start": Object { + "column": 55, + "line": 1, + "offset": 54, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 56, + "line": 1, + "offset": 55, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "credentials.password", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Login password", + }, + ], + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "callback", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "function", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Gets passed ", + }, + Object { + "position": Position { + "end": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + "indent": Array [], + "start": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + }, + "type": "inlineCode", + "value": "(err, { success:Boolean })", + }, + Object { + "position": Position { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 41, + "line": 1, + "offset": 40, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Promise", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "promise, to be resolved on success or rejected on failure", + }, + ], + "position": Position { + "end": Object { + "column": 58, + "line": 1, + "offset": 57, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs nest_params.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 51, + "line": 1, + "offset": 50, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employees who are responsible for the project.", + }, + ], + "position": Object { + "end": Object { + "column": 51, + "line": 1, + "offset": 50, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 51, + "line": 1, + "offset": 50, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 1, + "name": "employees", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The name of an employee.", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "employees[].name", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employee's department.", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "employees[].department", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "Object", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "default": "minion", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employee's type.", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "type", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "The employees who are responsible for the project.", + "lineNumber": 1, + "name": "employees", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "Object", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + Object { + "description": "The name of an employee.", + "lineNumber": 2, + "name": "employees[].name", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "The employee's department.", + "lineNumber": 3, + "name": "employees[].department", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "default": "minion", + "description": "The employee's type.", + "lineNumber": 4, + "name": "type", + "title": "param", + "type": Object { + "expression": Object { + "name": "string", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "some options", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "options", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "how much", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "options.much", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "something else", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "bar", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "name": "foo", + }, + ], + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current time", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "theTime", + "properties": Array [ + Object { + "lineNumber": 6, + "name": "theTime.hours", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 7, + "name": "theTime.minutes", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 8, + "name": "theTime.seconds", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "title": "property", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "foo something else", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "name": "foo", + "title": "name", + }, + Object { + "description": "some options", + "lineNumber": 2, + "name": "options", + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + Object { + "description": "how much", + "lineNumber": 3, + "name": "options.much", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "something else", + "lineNumber": 4, + "name": "bar", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "the current time", + "lineNumber": 5, + "name": "theTime", + "title": "property", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + Object { + "description": null, + "lineNumber": 6, + "name": "theTime.hours", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": null, + "lineNumber": 7, + "name": "theTime.minutes", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": null, + "lineNumber": 8, + "name": "theTime.seconds", + "title": "property", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "foo something else", + "lineNumber": 9, + "title": "returns", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs nest_params.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs nest_params.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "employees", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 51, + "line": 1, + "offset": 50, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employees who are responsible for the project.", + }, + ], + "position": Position { + "end": Object { + "column": 51, + "line": 1, + "offset": 50, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "employees[].name", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The name of an employee.", + }, + ], + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "employees[].department", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employee's department.", + }, + ], + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "type", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The employee's type.", + }, + ], + "position": Position { + "end": Object { + "column": 21, + "line": 1, + "offset": 20, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "minion", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "some options", + }, + ], + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.much", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "how much", + }, + ], + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "bar", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "something else", + }, + ], + "position": Position { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Properties", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "theTime", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the current time", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "theTime.hours", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "theTime.minutes", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "theTime.seconds", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "foo something else", + }, + ], + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs newline-in-description.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A function.", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "message": "could not determine @name for hierarchy", + }, + ], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "namespace": "", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 34, + "line": 3, + "offset": 132, + }, + "indent": Array [ + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The input to the function. +I should be able to continue the description on a new line, and have it +still work in the markdown table.", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 3, + "offset": 132, + }, + "indent": Array [ + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 34, + "line": 3, + "offset": 132, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "path": Array [], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "The input to the function. +I should be able to continue the description on a new line, and have it +still work in the markdown table.", + "lineNumber": 2, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs newline-in-description.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs newline-in-description.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A function.", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 34, + "line": 3, + "offset": 132, + }, + "indent": Array [ + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The input to the function. +I should be able to continue the description on a new line, and have it +still work in the markdown table.", + }, + ], + "position": Position { + "end": Object { + "column": 34, + "line": 3, + "offset": 132, + }, + "indent": Array [ + 1, + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs no-name.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Set the time", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "message": "could not determine @name for hierarchy", + }, + ], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "namespace": "", + "params": Array [ + Object { + "lineNumber": 2, + "name": "bar", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "bar", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs no-name.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs no-name.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Set the time", + }, + ], + "position": Position { + "end": Object { + "column": 13, + "line": 1, + "offset": 12, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "bar", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs optional-record-field-type.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Record", + "namespace": "Record", + "params": Array [], + "path": Array [ + Object { + "kind": "typedef", + "name": "Record", + }, + ], + "properties": Array [ + Object { + "lineNumber": 3, + "name": "opt", + "title": "property", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "lineNumber": 4, + "name": "req", + "title": "property", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + "type": Object { + "fields": Array [ + Object { + "key": "opt", + "type": "FieldType", + "value": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "key": "req", + "type": "FieldType", + "value": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "type": "RecordType", + }, + }, +] +`; + +exports[`outputs optional-record-field-type.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs optional-record-field-type.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Record", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "type": "text", + "value": "{", + }, + Object { + "type": "text", + "value": "opt: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "?", + }, + Object { + "type": "text", + "value": ", ", + }, + Object { + "type": "text", + "value": "req: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": "}", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Properties", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "opt", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "req", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs params.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "addThem", + "namespace": "addThem", + "params": Array [ + Object { + "lineNumber": 5, + "name": "a", + "title": "param", + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the second param", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "b", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 5, + "name": "c", + "title": "param", + }, + Object { + "anonymous": true, + "name": "$3", + "properties": Array [ + Object { + "lineNumber": 5, + "name": "$3.d", + "title": "param", + }, + Object { + "lineNumber": 5, + "name": "$3.e", + "title": "param", + }, + Object { + "lineNumber": 5, + "name": "$3.f", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "addThem", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "the second param", + "lineNumber": 2, + "name": "b", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 16, + }, + "start": Object { + "column": 0, + "line": 14, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method has partially inferred params", + }, + ], + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "fishesAndFoxes", + "namespace": "fishesAndFoxes", + "params": Array [ + Object { + "lineNumber": 2, + "name": "options", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "number of kinds of fish", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "options.fishes", + "title": "param", + "type": Object { + "name": "String", + "type": "NameExpression", + }, + }, + Object { + "lineNumber": 14, + "name": "options.foxes", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "fishesAndFoxes", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "options", + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, + Object { + "description": "number of kinds of fish", + "lineNumber": 3, + "name": "options.fishes", + "title": "param", + "type": Object { + "name": "String", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 24, + }, + "start": Object { + "column": 0, + "line": 22, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method has a type in the description and a default in the code", + }, + ], + "position": Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 21, + }, + "start": Object { + "column": 0, + "line": 18, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "withDefault", + "namespace": "withDefault", + "params": Array [ + Object { + "default": "2", + "lineNumber": 2, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "withDefault", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 35, + }, + "start": Object { + "column": 0, + "line": 29, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is foo's documentation", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 0, + "line": 26, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 34, + }, + "start": Object { + "column": 2, + "line": 34, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The method", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 33, + }, + "start": Object { + "column": 2, + "line": 30, + }, + }, + "memberof": "Foo", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "method", + "namespace": "Foo#method", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Param to method", + }, + ], + "position": Object { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Foo", + }, + Object { + "kind": "function", + "name": "method", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [ + Object { + "description": "Param to method", + "lineNumber": 2, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "Foo", + "namespace": "Foo", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 47, + }, + "start": Object { + "column": 0, + "line": 40, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Traditional object", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 39, + }, + "start": Object { + "column": 0, + "line": 37, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 46, + }, + "start": Object { + "column": 2, + "line": 44, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method should acquire the param x", + }, + ], + "position": Object { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 43, + }, + "start": Object { + "column": 2, + "line": 41, + }, + }, + "memberof": "TraditionalObject", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "traditionalMethod", + "namespace": "TraditionalObject.traditionalMethod", + "params": Array [ + Object { + "lineNumber": 44, + "name": "x", + "title": "param", + }, + ], + "path": Array [ + Object { + "name": "TraditionalObject", + }, + Object { + "kind": "function", + "name": "traditionalMethod", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + }, + "name": "TraditionalObject", + "namespace": "TraditionalObject", + "params": Array [], + "path": Array [ + Object { + "name": "TraditionalObject", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 61, + }, + "start": Object { + "column": 0, + "line": 61, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Represents an IPv6 address", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 47, + "line": 3, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 28, + }, + }, + "type": "text", + "value": "This tests our support of optional parameters", + }, + ], + "position": Object { + "end": Object { + "column": 47, + "line": 3, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 28, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 47, + "line": 3, + "offset": 74, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "description": "var address = new Address6('2001::/32');", + }, + ], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 60, + }, + "start": Object { + "column": 0, + "line": 49, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Address6", + "namespace": "Address6", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "address", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "default": "8", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "How many octets to parse", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 6, + "name": "groups", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A third argument", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 7, + "name": "third", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "prefix": true, + "type": "NullableType", + }, + }, + Object { + "default": "[1]", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "to properly be parsed", + }, + ], + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 8, + "name": "foo", + "title": "param", + "type": Object { + "name": "Array", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Address6", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 4, + "name": "Address6", + "title": "class", + "type": null, + }, + Object { + "description": "An IPv6 address string", + "lineNumber": 5, + "name": "address", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "default": "8", + "description": "How many octets to parse", + "lineNumber": 6, + "name": "groups", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "A third argument", + "lineNumber": 7, + "name": "third", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "prefix": true, + "type": "NullableType", + }, + }, + Object { + "default": "[1]", + "description": "to properly be parsed", + "lineNumber": 8, + "name": "foo", + "title": "param", + "type": Object { + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "var address = new Address6('2001::/32');", + "lineNumber": 9, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 77, + }, + "start": Object { + "column": 0, + "line": 75, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Create a GeoJSON data source instance given an options object", + }, + ], + "position": Object { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 44, + "line": 3, + "offset": 106, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 63, + }, + }, + "type": "text", + "value": "This tests our support of nested parameters", + }, + ], + "position": Object { + "end": Object { + "column": 44, + "line": 3, + "offset": 106, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 63, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 44, + "line": 3, + "offset": 106, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 74, + }, + "start": Object { + "column": 0, + "line": 63, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "GeoJSONSource", + "namespace": "GeoJSONSource", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "optional options", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "options", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 92, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A GeoJSON data object or URL to it. +The latter is preferable in case of large GeoJSON files.", + }, + ], + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 92, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 92, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 6, + "name": "options.data", + "title": "param", + "type": Object { + "elements": Array [ + Object { + "name": "Object", + "type": "NameExpression", + }, + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "type": "UnionType", + }, + }, + Object { + "default": "14", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 36, + "line": 1, + "offset": 35, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Maximum zoom to preserve detail at.", + }, + ], + "position": Object { + "end": Object { + "column": 36, + "line": 1, + "offset": 35, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 36, + "line": 1, + "offset": 35, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 8, + "name": "options.maxzoom", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Tile buffer on each side.", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 9, + "name": "options.buffer", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Simplification tolerance (higher means simpler).", + }, + ], + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 10, + "name": "options.tolerance", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + ], + "title": "param", + "type": Object { + "expression": Object { + "name": "Object", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "GeoJSONSource", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 4, + "name": "GeoJSONSource", + "title": "class", + "type": null, + }, + Object { + "description": "optional options", + "lineNumber": 5, + "name": "options", + "title": "param", + "type": Object { + "expression": Object { + "name": "Object", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "A GeoJSON data object or URL to it. +The latter is preferable in case of large GeoJSON files.", + "lineNumber": 6, + "name": "options.data", + "title": "param", + "type": Object { + "elements": Array [ + Object { + "name": "Object", + "type": "NameExpression", + }, + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "type": "UnionType", + }, + }, + Object { + "default": "14", + "description": "Maximum zoom to preserve detail at.", + "lineNumber": 8, + "name": "options.maxzoom", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "Tile buffer on each side.", + "lineNumber": 9, + "name": "options.buffer", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + Object { + "description": "Simplification tolerance (higher means simpler).", + "lineNumber": 10, + "name": "options.tolerance", + "title": "param", + "type": Object { + "expression": Object { + "name": "number", + "type": "NameExpression", + }, + "type": "OptionalType", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 87, + }, + "start": Object { + "column": 0, + "line": 87, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 26, + "line": 2, + "offset": 100, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support for parameters with explicit types but with default +values specified in code.", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 2, + "offset": 100, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 26, + "line": 2, + "offset": 100, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "constant", + "loc": Object { + "end": Object { + "column": 3, + "line": 86, + }, + "start": Object { + "column": 0, + "line": 79, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "myfunc", + "namespace": "myfunc", + "params": Array [ + Object { + "default": "123", + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an argument", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "constant", + "name": "myfunc", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 5, + "line": 1, + "offset": 4, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "some", + }, + ], + "position": Object { + "end": Object { + "column": 5, + "line": 1, + "offset": 4, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 5, + "line": 1, + "offset": 4, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "an argument", + "lineNumber": 4, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + Object { + "description": "some", + "lineNumber": 6, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 97, + }, + "start": Object { + "column": 0, + "line": 95, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 125, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support of JSDoc param tags without type information, +or any type information we could infer from annotations.", + }, + ], + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 125, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 57, + "line": 2, + "offset": 125, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 94, + }, + "start": Object { + "column": 0, + "line": 89, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "address", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "An IPv6 address string", + "lineNumber": 4, + "name": "address", + "title": "param", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 111, + }, + "start": Object { + "column": 0, + "line": 109, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 35, + "line": 2, + "offset": 85, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support for iterator rest inside an +iterator destructure (RestElement)", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 2, + "offset": 85, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 2, + "offset": 85, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 108, + }, + "start": Object { + "column": 0, + "line": 99, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "rotate", + "namespace": "rotate", + "params": Array [ + Object { + "lineNumber": 4, + "name": "input", + "properties": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "head of iterator", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "input.0", + "title": "param", + "type": Object { + "name": "any", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "body of iterator", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 6, + "name": "input.xs", + "title": "param", + "type": Object { + "expression": Object { + "name": "any", + "type": "NameExpression", + }, + "type": "RestType", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Array", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "rotate", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "rotated such that the last element was the first", + }, + ], + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "applications": Array [ + Object { + "name": "any", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 4, + "name": "input", + "title": "param", + "type": Object { + "name": "Array", + "type": "NameExpression", + }, + }, + Object { + "description": "head of iterator", + "lineNumber": 5, + "name": "input.0", + "title": "param", + "type": Object { + "name": "any", + "type": "NameExpression", + }, + }, + Object { + "description": "body of iterator", + "lineNumber": 6, + "name": "input.xs", + "title": "param", + "type": Object { + "expression": Object { + "name": "any", + "type": "NameExpression", + }, + "type": "RestType", + }, + }, + Object { + "description": "rotated such that the last element was the first", + "lineNumber": 8, + "title": "returns", + "type": Object { + "applications": Array [ + Object { + "name": "any", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs params.input.js markdown 1`] = `"[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs params.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "addThem", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "b", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the second param", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "c", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$3", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$3.d", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$3.e", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "$3.f", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "fishesAndFoxes", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method has partially inferred params", + }, + ], + "position": Position { + "end": Object { + "column": 42, + "line": 1, + "offset": 41, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.fishes", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "String", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "number of kinds of fish", + }, + ], + "position": Position { + "end": Object { + "column": 24, + "line": 1, + "offset": 23, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.foxes", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "withDefault", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method has a type in the description and a default in the code", + }, + ], + "position": Position { + "end": Object { + "column": 68, + "line": 1, + "offset": 67, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "2", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This is foo's documentation", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "method", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The method", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Param to method", + }, + ], + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "TraditionalObject", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Traditional object", + }, + ], + "position": Position { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "traditionalMethod", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method should acquire the param x", + }, + ], + "position": Position { + "end": Object { + "column": 39, + "line": 1, + "offset": 38, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Address6", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Represents an IPv6 address", + }, + ], + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 47, + "line": 3, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 28, + }, + }, + "type": "text", + "value": "This tests our support of optional parameters", + }, + ], + "position": Position { + "end": Object { + "column": 47, + "line": 3, + "offset": 74, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 28, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "address", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "groups", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "How many octets to parse", + }, + ], + "position": Position { + "end": Object { + "column": 25, + "line": 1, + "offset": 24, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "8", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "third", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A third argument", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "foo", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "to properly be parsed", + }, + ], + "position": Position { + "end": Object { + "column": 22, + "line": 1, + "offset": 21, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "[1]", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Examples", + }, + ], + "type": "strong", + }, + Object { + "lang": "javascript", + "type": "code", + "value": "var address = new Address6('2001::/32');", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "GeoJSONSource", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Create a GeoJSON data source instance given an options object", + }, + ], + "position": Position { + "end": Object { + "column": 62, + "line": 1, + "offset": 61, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 44, + "line": 3, + "offset": 106, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 63, + }, + }, + "type": "text", + "value": "This tests our support of nested parameters", + }, + ], + "position": Position { + "end": Object { + "column": 44, + "line": 3, + "offset": 106, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 3, + "offset": 63, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "optional options", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.data", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "(", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Object", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", + }, + Object { + "type": "text", + "value": " | ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 57, + "line": 2, + "offset": 92, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "A GeoJSON data object or URL to it. +The latter is preferable in case of large GeoJSON files.", + }, + ], + "position": Position { + "end": Object { + "column": 57, + "line": 2, + "offset": 92, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.maxzoom", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 36, + "line": 1, + "offset": 35, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Maximum zoom to preserve detail at.", + }, + ], + "position": Position { + "end": Object { + "column": 36, + "line": 1, + "offset": 35, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "14", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.buffer", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Tile buffer on each side.", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 1, + "offset": 25, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "options.tolerance", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Simplification tolerance (higher means simpler).", + }, + ], + "position": Position { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "myfunc", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 26, + "line": 2, + "offset": 100, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support for parameters with explicit types but with default +values specified in code.", + }, + ], + "position": Position { + "end": Object { + "column": 26, + "line": 2, + "offset": 100, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "an argument", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": " (optional, default ", + }, + Object { + "type": "inlineCode", + "value": "123", + }, + Object { + "type": "text", + "value": ")", + }, + ], + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 5, + "line": 1, + "offset": 4, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "some", + }, + ], + "position": Position { + "end": Object { + "column": 5, + "line": 1, + "offset": 4, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 57, + "line": 2, + "offset": 125, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support of JSDoc param tags without type information, +or any type information we could infer from annotations.", + }, + ], + "position": Position { + "end": Object { + "column": 57, + "line": 2, + "offset": 125, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "address", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "rotate", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 35, + "line": 2, + "offset": 85, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This tests our support for iterator rest inside an +iterator destructure (RestElement)", + }, + ], + "position": Position { + "end": Object { + "column": 35, + "line": 2, + "offset": 85, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "input", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "input.0", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "any", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "head of iterator", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "input.xs", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "...", + }, + Object { + "type": "text", + "value": "any", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "body of iterator", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "type": "text", + "value": "any", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "rotated such that the last element was the first", + }, + ], + "position": Position { + "end": Object { + "column": 49, + "line": 1, + "offset": 48, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs react-jsx.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "apples", + }, + ], + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "apples", + "namespace": "apples", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "apples", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs react-jsx.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs react-jsx.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "apples", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "apples", + }, + ], + "position": Position { + "end": Object { + "column": 7, + "line": 1, + "offset": 6, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs require-json.input.js JSON 1`] = `Array []`; + +exports[`outputs require-json.input.js markdown 1`] = `""`; + +exports[`outputs require-json.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + +exports[`outputs require-json-no-extension.input.js JSON 1`] = `Array []`; + +exports[`outputs require-json-no-extension.input.js markdown 1`] = `""`; + +exports[`outputs require-json-no-extension.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + +exports[`outputs sections.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function is first", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "first", + "namespace": "first", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "first", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forgot a memberof here... sure hope that doesn't crash anything!", + }, + ], + "position": Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "first", + "namespace": "first", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "first", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "first", + "title": "method", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 18, + }, + "start": Object { + "column": 2, + "line": 18, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 29, + "line": 2, + "offset": 99, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "shares a name with a top level item referenced in the TOC... sure hope +that doesn't crash anything!", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 2, + "offset": 99, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 2, + "offset": 99, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 5, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + "memberof": "AClass", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "second", + "namespace": "AClass#second", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "AClass", + }, + Object { + "kind": "function", + "name": "second", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "AClass", + "namespace": "AClass", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "AClass", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 24, + }, + "start": Object { + "column": 0, + "line": 24, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This class has some members", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 23, + }, + "start": Object { + "column": 0, + "line": 21, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 41, + "line": 29, + }, + "start": Object { + "column": 0, + "line": 29, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "second::foo", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 28, + }, + "start": Object { + "column": 0, + "line": 26, + }, + }, + "memberof": "second", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "second#foo", + "params": Array [ + Object { + "lineNumber": 29, + "name": "pork", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "second", + }, + Object { + "kind": "function", + "name": "foo", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 48, + "line": 34, + }, + "start": Object { + "column": 0, + "line": 34, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "second::bar", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 33, + }, + "start": Object { + "column": 0, + "line": 31, + }, + }, + "memberof": "second", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bar", + "namespace": "second#bar", + "params": Array [ + Object { + "lineNumber": 34, + "name": "beans", + "title": "param", + }, + Object { + "lineNumber": 34, + "name": "rice", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "second", + }, + Object { + "kind": "function", + "name": "bar", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "second", + "namespace": "second", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "second", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 39, + }, + "start": Object { + "column": 0, + "line": 39, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function is third", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 38, + }, + "start": Object { + "column": 0, + "line": 36, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "third", + "namespace": "third", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "third", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs sections.input.js markdown 1`] = `"[object Object],[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs sections.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "first", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function is first", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "first", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "forgot a memberof here... sure hope that doesn't crash anything!", + }, + ], + "position": Position { + "end": Object { + "column": 65, + "line": 1, + "offset": 64, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "AClass", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "second", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 2, + "offset": 99, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "shares a name with a top level item referenced in the TOC... sure hope +that doesn't crash anything!", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 2, + "offset": 99, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "second", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This class has some members", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "second::foo", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "pork", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "bar", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "second::bar", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "beans", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "rice", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "third", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function is third", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs simple.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs simple.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "simple.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-callback.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 8, + "line": 2, + "offset": 81, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This takes a number and a callback and calls the callback with the number +plus 3.", + }, + ], + "position": Object { + "end": Object { + "column": 8, + "line": 2, + "offset": 81, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 8, + "line": 2, + "offset": 81, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "takesSimpleCallback", + "namespace": "takesSimpleCallback", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number.", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "n", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The callback.", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "cb", + "title": "param", + "type": Object { + "name": "simpleCallback", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "takesSimpleCallback", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "The number.", + "lineNumber": 4, + "name": "n", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "The callback.", + "lineNumber": 5, + "name": "cb", + "title": "param", + "type": Object { + "name": "simpleCallback", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This callback takes an error and a number.", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "typedef", + "loc": Object { + "end": Object { + "column": 3, + "line": 18, + }, + "start": Object { + "column": 0, + "line": 12, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simpleCallback", + "namespace": "simpleCallback", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The error.", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 4, + "name": "err", + "title": "param", + "type": Object { + "expression": Object { + "name": "Error", + "type": "NameExpression", + }, + "prefix": true, + "type": "NullableType", + }, + }, + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number.", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 5, + "name": "n", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "typedef", + "name": "simpleCallback", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": "simpleCallback", + "lineNumber": 3, + "title": "callback", + }, + Object { + "description": "The error.", + "lineNumber": 4, + "name": "err", + "title": "param", + "type": Object { + "expression": Object { + "name": "Error", + "type": "NameExpression", + }, + "prefix": true, + "type": "NullableType", + }, + }, + Object { + "description": "The number.", + "lineNumber": 5, + "name": "n", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + "type": Object { + "name": "Function", + "type": "NameExpression", + }, + }, +] +`; + +exports[`outputs simple-callback.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs simple-callback.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "takesSimpleCallback", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 8, + "line": 2, + "offset": 81, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This takes a number and a callback and calls the callback with the number +plus 3.", + }, + ], + "position": Position { + "end": Object { + "column": 8, + "line": 2, + "offset": 81, + }, + "indent": Array [ + 1, + ], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "n", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number.", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "cb", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "simpleCallback", + }, + ], + "href": "#simplecallback", + "type": "link", + "url": "#simplecallback", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The callback.", + }, + ], + "position": Position { + "end": Object { + "column": 14, + "line": 1, + "offset": 13, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "simpleCallback", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This callback takes an error and a number.", + }, + ], + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Type: ", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Function", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", + }, + ], + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "err", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Error", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", + }, + Object { + "type": "text", + "value": "?", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The error.", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "n", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The number.", + }, + ], + "position": Position { + "end": Object { + "column": 12, + "line": 1, + "offset": 11, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-hashbang.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple-hashbang.input", + "namespace": "simple-hashbang.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple-hashbang.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs simple-hashbang.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs simple-hashbang.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "simple-hashbang.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-private.input.js JSON 1`] = `Array []`; + +exports[`outputs simple-private.input.js markdown 1`] = `""`; + +exports[`outputs simple-private.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-singlestar.input.js JSON 1`] = `Array []`; + +exports[`outputs simple-singlestar.input.js markdown 1`] = `""`; + +exports[`outputs simple-singlestar.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-triplestar.input.js JSON 1`] = `Array []`; + +exports[`outputs simple-triplestar.input.js markdown 1`] = `""`; + +exports[`outputs simple-triplestar.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + ], + "type": "root", +} +`; + +exports[`outputs simple-two.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number plus two.", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "description": "var result = returnTwo(4); +// result is 6", + }, + ], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "returnTwo", + "namespace": "returnTwo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the number", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "returnTwo", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numbertwo", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the number", + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "numbertwo", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "var result = returnTwo(4); +// result is 6", + "lineNumber": 5, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs simple-two.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs simple-two.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "returnTwo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number plus two.", + }, + ], + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "a", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the number", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Examples", + }, + ], + "type": "strong", + }, + Object { + "lang": "javascript", + "type": "code", + "value": "var result = returnTwo(4); +// result is 6", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numbertwo", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs sort-order-alpha.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 19, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 6, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 18, + }, + "start": Object { + "column": 2, + "line": 18, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 17, + }, + "start": Object { + "column": 2, + "line": 17, + }, + }, + "memberof": "C", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "A", + "namespace": "C#A", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + Object { + "kind": "function", + "name": "A", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 16, + }, + "start": Object { + "column": 2, + "line": 16, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 15, + }, + "start": Object { + "column": 2, + "line": 15, + }, + }, + "memberof": "C", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "a", + "namespace": "C#a", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + Object { + "kind": "function", + "name": "a", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 14, + }, + "start": Object { + "column": 2, + "line": 14, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 13, + }, + "start": Object { + "column": 2, + "line": 13, + }, + }, + "memberof": "C", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "B", + "namespace": "C#B", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + Object { + "kind": "function", + "name": "B", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "memberof": "C", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "b", + "namespace": "C#b", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + Object { + "kind": "function", + "name": "b", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "C", + "namespace": "C", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "C", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 31, + }, + "start": Object { + "column": 0, + "line": 22, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 6, + "line": 21, + }, + "start": Object { + "column": 0, + "line": 21, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 30, + }, + "start": Object { + "column": 2, + "line": 30, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 29, + }, + "start": Object { + "column": 2, + "line": 29, + }, + }, + "memberof": "D", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "A", + "namespace": "D#A", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "D", + }, + Object { + "kind": "function", + "name": "A", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 28, + }, + "start": Object { + "column": 2, + "line": 28, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 27, + }, + "start": Object { + "column": 2, + "line": 27, + }, + }, + "memberof": "D", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "a", + "namespace": "D#a", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "D", + }, + Object { + "kind": "function", + "name": "a", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 26, + }, + "start": Object { + "column": 2, + "line": 26, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 25, + }, + "start": Object { + "column": 2, + "line": 25, + }, + }, + "memberof": "D", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "B", + "namespace": "D#B", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "D", + }, + Object { + "kind": "function", + "name": "B", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 24, + }, + "start": Object { + "column": 2, + "line": 24, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 8, + "line": 23, + }, + "start": Object { + "column": 2, + "line": 23, + }, + }, + "memberof": "D", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "b", + "namespace": "D#b", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "D", + }, + Object { + "kind": "function", + "name": "b", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "D", + "namespace": "D", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "D", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 7, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 6, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "a", + "namespace": "a", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "a", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 6, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "b", + "namespace": "b", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "b", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs sort-order-alpha.input.js markdown 1`] = `"[object Object],[object Object],[object Object],[object Object]"`; + +exports[`outputs sort-order-alpha.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "C", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "A", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "a", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "B", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "b", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "D", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "A", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "a", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "B", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "b", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "a", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "b", + }, + ], + "depth": 2, + "type": "heading", + }, + ], + "type": "root", +} +`; + +exports[`outputs string-literal-key.input.js JSON 1`] = ` +Array [ + Object { + "alias": "MyContainerObject", + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 11, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "constant", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "MyContainerObject", + "namespace": "MyContainerObject", + "params": Array [], + "path": Array [ + Object { + "kind": "constant", + "name": "MyContainerObject", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 1, + "name": "MyContainerObject", + "title": "alias", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 2, + "line": 8, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The foo property", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [ + Object { + "commentLineNumber": 0, + "message": "@memberof reference to obj not found", + }, + ], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 5, + "line": 7, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "memberof": "obj", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": ".foo", + "params": Array [], + "path": Array [ + Object { + "name": "foo", + "scope": "static", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "static", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs string-literal-key.input.js markdown 1`] = `"[object Object],[object Object]"`; + +exports[`outputs string-literal-key.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "MyContainerObject", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "foo", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The foo property", + }, + ], + "position": Position { + "end": Object { + "column": 17, + "line": 1, + "offset": 16, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs system-import.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 8, + }, + "start": Object { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs system-import.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs system-import.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "simple.input", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs this-class.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "module", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bookshelf", + "namespace": "bookshelf", + "params": Array [], + "path": Array [ + Object { + "kind": "module", + "name": "bookshelf", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 0, + "name": "bookshelf", + "title": "module", + "type": null, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 6, + }, + "start": Object { + "column": 2, + "line": 6, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The title of the book.", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 31, + "line": 5, + }, + "start": Object { + "column": 2, + "line": 5, + }, + }, + "memberof": "Book", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "title", + "namespace": "Book#title", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "Book", + }, + Object { + "name": "title", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "Book", + "namespace": "Book", + "params": Array [ + Object { + "lineNumber": 4, + "name": "title", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Book", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 0, + "name": null, + "title": "class", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 2, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 10, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 13, + "line": 9, + }, + "start": Object { + "column": 0, + "line": 9, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 12, + }, + "start": Object { + "column": 2, + "line": 12, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The title of the bookshelf.", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 11, + }, + "start": Object { + "column": 2, + "line": 11, + }, + }, + "memberof": "BookShelf", + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "title", + "namespace": "BookShelf#title", + "params": Array [], + "path": Array [ + Object { + "kind": "class", + "name": "BookShelf", + }, + Object { + "name": "title", + "scope": "instance", + }, + ], + "properties": Array [], + "returns": Array [], + "scope": "instance", + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + ], + "static": Array [], + }, + "name": "BookShelf", + "namespace": "BookShelf", + "params": Array [ + Object { + "lineNumber": 10, + "name": "title", + "title": "param", + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "BookShelf", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 0, + "name": null, + "title": "class", + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs this-class.input.js markdown 1`] = `"[object Object],[object Object],[object Object]"`; + +exports[`outputs this-class.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "bookshelf", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Book", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "title", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "title", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The title of the book.", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "BookShelf", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "title", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "title", + }, + ], + "depth": 3, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "The title of the bookshelf.", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "root", +} +`; + +exports[`outputs type_application.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Represents an IPv6 address", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "class", + "loc": Object { + "end": Object { + "column": 3, + "line": 5, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "Address6", + "namespace": "Address6", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "address", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + ], + "path": Array [ + Object { + "kind": "class", + "name": "Address6", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "Address6", + "title": "class", + "type": null, + }, + Object { + "description": "An IPv6 address string", + "lineNumber": 3, + "name": "address", + "title": "param", + "type": Object { + "applications": Array [ + Object { + "name": "string", + "type": "NameExpression", + }, + ], + "expression": Object { + "name": "Array", + "type": "NameExpression", + }, + "type": "TypeApplication", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs type_application.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs type_application.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Address6", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Represents an IPv6 address", + }, + ], + "position": Position { + "end": Object { + "column": 27, + "line": 1, + "offset": 26, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "address", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "Array", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", + }, + Object { + "type": "text", + "value": "<", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "string", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", + }, + Object { + "type": "text", + "value": ">", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "An IPv6 address string", + }, + ], + "position": Position { + "end": Object { + "column": 23, + "line": 1, + "offset": 22, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + ], + "type": "root", +} +`; + +exports[`outputs var-function-param-return.input.js JSON 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": Object { + "end": Object { + "column": 40, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + }, + "description": "", + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 6, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "f", + "namespace": "f", + "params": Array [ + Object { + "lineNumber": 2, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "f", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "title": "returns", + "type": Object { + "name": "boolean", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`outputs var-function-param-return.input.js markdown 1`] = `"[object Object]"`; + +exports[`outputs var-function-param-return.input.js markdown AST 1`] = ` +Object { + "children": Array [ + Object { + "type": "html", + "value": "", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "f", + }, + ], + "depth": 2, + "type": "heading", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Parameters", + }, + ], + "type": "strong", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "inlineCode", + "value": "x", + }, + Object { + "type": "text", + "value": " ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "number", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "listItem", + }, + ], + "ordered": false, + "type": "list", + }, + Object { + "children": Array [ + Object { + "type": "text", + "value": "Returns ", + }, + Object { + "children": Array [ + Object { + "children": Array [ + Object { + "type": "text", + "value": "boolean", + }, + ], + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + "type": "link", + "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", + }, + ], + "type": "strong", + }, + Object { + "type": "text", + "value": " ", + }, + ], + "type": "paragraph", + }, + ], + "type": "root", +} +`; diff --git a/__tests__/bin.js b/__tests__/bin.js index b5b8ae5d2..277365442 100644 --- a/__tests__/bin.js +++ b/__tests__/bin.js @@ -123,7 +123,7 @@ test('extension option', function() { return documentation(['build fixture/extension.jsx']); }); -test('invalid arguments', function() { +describe('invalid arguments', function() { test('bad -f option', async function() { try { await documentation( @@ -136,10 +136,10 @@ test('invalid arguments', function() { } }); - test('html with no destination', function() { - return documentation(['build -f html fixture/internal.input.js'], function( - err - ) { + test('html with no destination', async function() { + try { + await documentation(['build -f html fixture/internal.input.js']); + } catch (err) { expect( err .toString() @@ -147,7 +147,7 @@ test('invalid arguments', function() { /The HTML output mode requires a destination directory set with -o/ ) ).toBeTruthy(); - }); + } }); test('bad command', async function() { diff --git a/__tests__/lib/walk.js b/__tests__/lib/walk.js index e63db9b20..bc0f81b7f 100644 --- a/__tests__/lib/walk.js +++ b/__tests__/lib/walk.js @@ -1,7 +1,7 @@ -var walk = require('../../src/walk'); +var walk = require('../../src/walk').walk; -test('walk', function() { - test('flat comments', function(t) { +describe('walk', function() { + test('flat comments', function() { var comments = [{ name: 'Tom' }]; function renamer(comment, options) { @@ -19,7 +19,7 @@ test('walk', function() { ]); }); - test('nested comments', function(t) { + test('nested comments', function() { var comments = [ { name: 'Tom', diff --git a/__tests__/test.js b/__tests__/test.js index 604ae889d..6e4315a9e 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -113,11 +113,12 @@ describe('outputs', function() { glob .sync(path.join(__dirname, 'fixture', '*.input.js')) .forEach(function(file) { - test(path.basename(file), async function() { - const result = await documentation.build( - [file], - readOptionsFromFile(file) - ); + describe(path.basename(file), async function() { + let result = null; + beforeEach(async function() { + result = await documentation.build([file], readOptionsFromFile(file)); + }); + test('markdown', async function() { const md = await outputMarkdown(_.cloneDeep(result), { markdownToc: true diff --git a/package.json b/package.json index 60b1503cc..b0f7b0e8e 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "flow-bin": "^0.53.0", "fs-extra": "^4.0.0", "husky": "^0.14.0", - "jest": "^20.0.4", + "jest": "^21.2.1", "json-schema": "0.2.3", "lint-staged": "^4.0.0", "mock-fs": "^4.2.0", @@ -110,14 +110,8 @@ "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" }, "jest": { - "testPathIgnorePatterns": [ - "/node_modules/", - "utils.js", - "fixture" - ], - "coveragePathIgnorePatterns": [ - "/lib/" - ], + "testPathIgnorePatterns": ["/node_modules/", "utils.js", "fixture"], + "coveragePathIgnorePatterns": ["/lib/"], "collectCoverage": true, "testEnvironment": "node" }, @@ -130,15 +124,9 @@ "node": ">=4" }, "lint-staged": { - "*.js": [ - "prettier --write --single-quote", - "git add" - ] + "*.js": ["prettier --write --single-quote", "git add"] }, "greenkeeper": { - "ignore": [ - "remote-origin-url", - "yargs" - ] + "ignore": ["remote-origin-url", "yargs"] } } From f375b2ba755999eb989ab54cc238b73dd1132a33 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 13:03:23 +0300 Subject: [PATCH 143/555] chore: updated flow js --- __tests__/test.js | 1 + package.json | 2 +- src/sort.js | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/__tests__/test.js b/__tests__/test.js index 6e4315a9e..71a11f121 100644 --- a/__tests__/test.js +++ b/__tests__/test.js @@ -32,6 +32,7 @@ function readOptionsFromFile(file) { if (fs.existsSync(path.join(__dirname, '../.git'))) { test('git option', async function() { + jest.setTimeout(10000); // 10 second timeout. After update flow.js on 0.56 version the test is executed more time. var file = path.join(__dirname, './fixture/simple.input.js'); const result = await documentation.build([file], { github: true }); normalize(result); diff --git a/package.json b/package.json index b0f7b0e8e..5fbbf5dd6 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.1.1", "eslint-config-prettier": "^2.3.0", "eslint-plugin-flowtype": "^2.34.1", - "flow-bin": "^0.53.0", + "flow-bin": "^0.56.0", "fs-extra": "^4.0.0", "husky": "^0.14.0", "jest": "^21.2.1", diff --git a/src/sort.js b/src/sort.js index e87717c58..d0dad9bf5 100644 --- a/src/sort.js +++ b/src/sort.js @@ -19,10 +19,13 @@ module.exports = function sortDocs(comments: Array, options: Object) { return sortComments(comments, options && options.sortOrder); } let i = 0; - const indexes: { [?string]: number } = Object.create(null); - const toBeSorted: { [?string]: boolean } = Object.create(null); + const indexes: { [?string]: number, __proto__: null } = Object.create(null); + const toBeSorted: { [?string]: boolean, __proto__: null } = Object.create( + null + ); const paths: { - [?string]: Array<{ scope: Scope, name: string }> + [?string]: Array<{ scope: Scope, name: string }>, + __proto__: null } = Object.create(null); const fixed = []; const walk = function(tocPath, val) { From 10bbba5402133dae0e46b28f2e7d1dca92480158 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 16:30:06 +0300 Subject: [PATCH 144/555] chore: Updated devDependencies --- package.json | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 5fbbf5dd6..b0ca0275b 100644 --- a/package.json +++ b/package.json @@ -58,30 +58,30 @@ }, "devDependencies": { "are-we-flow-yet": "^1.0.0", - "babel-cli": "^6.24.1", + "babel-cli": "^6.26.0", "babel-eslint": "^7.2.3", - "babel-jest": "^21.0.0", + "babel-jest": "^21.2.0", "babel-plugin-syntax-async-functions": "^6.13.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", "coveralls": "^3.0.0", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", - "eslint": "^4.1.1", - "eslint-config-prettier": "^2.3.0", - "eslint-plugin-flowtype": "^2.34.1", + "eslint": "^4.7.2", + "eslint-config-prettier": "^2.6.0", + "eslint-plugin-flowtype": "^2.37.0", "flow-bin": "^0.56.0", - "fs-extra": "^4.0.0", - "husky": "^0.14.0", + "fs-extra": "^4.0.2", + "husky": "^0.14.3", "jest": "^21.2.1", "json-schema": "0.2.3", - "lint-staged": "^4.0.0", - "mock-fs": "^4.2.0", - "p-event": "^1.0.0", - "prettier": "^1.0.0", + "lint-staged": "^4.2.3", + "mock-fs": "^4.4.1", + "p-event": "^1.3.0", + "prettier": "^1.7.2", "regenerator-runtime": "^0.11.0", - "standard-version": "^4.0.0", + "standard-version": "^4.2.0", "tmp": "^0.0.33" }, "keywords": [ @@ -110,8 +110,14 @@ "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" }, "jest": { - "testPathIgnorePatterns": ["/node_modules/", "utils.js", "fixture"], - "coveragePathIgnorePatterns": ["/lib/"], + "testPathIgnorePatterns": [ + "/node_modules/", + "utils.js", + "fixture" + ], + "coveragePathIgnorePatterns": [ + "/lib/" + ], "collectCoverage": true, "testEnvironment": "node" }, @@ -124,9 +130,15 @@ "node": ">=4" }, "lint-staged": { - "*.js": ["prettier --write --single-quote", "git add"] + "*.js": [ + "prettier --write --single-quote", + "git add" + ] }, "greenkeeper": { - "ignore": ["remote-origin-url", "yargs"] + "ignore": [ + "remote-origin-url", + "yargs" + ] } -} +} \ No newline at end of file From 227db1c9ee493b8fac033714e230ed1c3defe78b Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 18:50:38 +0300 Subject: [PATCH 145/555] chore: updated yargs Fixed #836 --- bin/documentation.js | 6 +++--- package.json | 5 ++--- src/commands/build.js | 4 ++-- src/commands/shared_options.js | 15 +++++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/bin/documentation.js b/bin/documentation.js index 7c8d41ce4..17bd0b14d 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -6,6 +6,7 @@ var yargs = require('yargs'); var commands = require('../lib/commands'); var argv = yargs + .strict() .command(commands.serve) .command(commands.build) .command(commands.lint) @@ -19,9 +20,8 @@ var argv = yargs return yargs.exit(1); } }) - .version(function() { - return require('../package').version; - }) + .example('documentation build foo.js -f md > API.md') + .version() .usage( `Usage: diff --git a/package.json b/package.json index b0ca0275b..5f03ffdac 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "vfile-sort": "^2.0.0", "vinyl": "^2.0.0", "vinyl-fs": "^2.3.1", - "yargs": "^6.0.1" + "yargs": "^9.0.1" }, "devDependencies": { "are-we-flow-yet": "^1.0.0", @@ -137,8 +137,7 @@ }, "greenkeeper": { "ignore": [ - "remote-origin-url", - "yargs" + "remote-origin-url" ] } } \ No newline at end of file diff --git a/src/commands/build.js b/src/commands/build.js index 17b89611b..73bc183ed 100644 --- a/src/commands/build.js +++ b/src/commands/build.js @@ -23,9 +23,9 @@ module.exports.builder = _.assign( sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, { - example: 'documentation build foo.js -f md > API.md', output: { - describe: 'output location. omit for stdout, otherwise is a filename ' + + describe: + 'output location. omit for stdout, otherwise is a filename ' + 'for single-file outputs and a directory name for multi-file outputs like html', default: 'stdout', alias: 'o' diff --git a/src/commands/shared_options.js b/src/commands/shared_options.js index 73b1445b8..39cc9039d 100644 --- a/src/commands/shared_options.js +++ b/src/commands/shared_options.js @@ -4,11 +4,10 @@ * Adds shared options to any command that runs documentation */ module.exports.sharedInputOptions = { - strict: true, shallow: { describe: 'shallow mode turns off dependency resolution, ' + - 'only processing the specified files (or the main script specified in package.json)', + 'only processing the specified files (or the main script specified in package.json)', default: false, type: 'boolean' }, @@ -27,13 +26,13 @@ module.exports.sharedInputOptions = { external: { describe: 'a string / glob match pattern that defines which external ' + - 'modules will be whitelisted and included in the generated documentation.', + 'modules will be whitelisted and included in the generated documentation.', default: null }, 'require-extension': { describe: "additional extensions to include in require() and import's search algorithm." + - 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array coerce: (value: string | Array) => [].concat(value), alias: 're' @@ -53,8 +52,8 @@ module.exports.sharedInputOptions = { access: { describe: 'Include only comments with a given access level, out of private, ' + - 'protected, public, undefined. By default, public, protected, and undefined access ' + - 'levels are included', + 'protected, public, undefined. By default, public, protected, and undefined access ' + + 'levels are included', choices: ['public', 'private', 'protected', 'undefined'], array: true, alias: 'a' @@ -68,13 +67,13 @@ module.exports.sharedInputOptions = { type: 'string', describe: 'Infer private access based on the name. This is a regular expression that ' + - 'is used to match the name' + 'is used to match the name' }, 'document-exported': { type: 'boolean', describe: 'Generate documentation for all exported bindings and members ' + - 'even if there is no JSDoc for them', + 'even if there is no JSDoc for them', default: false }, 'sort-order': { From 8b8e6a2ba09e5e070adcaa274b607fdfb2e8babf Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Fri, 29 Sep 2017 18:56:54 +0300 Subject: [PATCH 146/555] Added ignore mime package. Close #926 New version is required node >= 6, we are still support 4. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5f03ffdac..6e299d9af 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,8 @@ }, "greenkeeper": { "ignore": [ - "remote-origin-url" + "remote-origin-url", + "mime" ] } } \ No newline at end of file From e203df51c0653cf9ccb875cff820d13741ec22dd Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 4 Oct 2017 03:27:58 +0300 Subject: [PATCH 147/555] chore: Replace babel-preset-es2015 on babel-preset-env Fixed #931 (#932) --- .babelrc | 10 +++++++++- package.json | 4 ++-- src/input/dependency.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.babelrc b/.babelrc index dcbdcf171..d4ef2f468 100644 --- a/.babelrc +++ b/.babelrc @@ -1,5 +1,13 @@ { - "presets": ["es2015", "stage-0", "flow"], + "presets": [ + ["env", { + "targets": { + "node": 4 + }, + "include": ["transform-regenerator"] + }], + "flow" + ], "plugins": ["syntax-async-functions"], "ignore": [ "**/default_theme/assets/*" diff --git a/package.json b/package.json index 6e299d9af..67631e6fc 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "babel-generator": "^6.25.0", "babel-plugin-system-import-transformer": "3.1.0", "babel-plugin-transform-decorators-legacy": "^1.3.4", - "babel-preset-es2015": "^6.16.0", + "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", "babel-traverse": "^6.16.0", @@ -141,4 +141,4 @@ "mime" ] } -} \ No newline at end of file +} diff --git a/src/input/dependency.js b/src/input/dependency.js index add94a8f8..7fad0cad9 100644 --- a/src/input/dependency.js +++ b/src/input/dependency.js @@ -38,7 +38,7 @@ function dependencyStream( sourceMap: false, compact: false, presets: [ - require('babel-preset-es2015'), + require('babel-preset-env'), require('babel-preset-stage-0'), require('babel-preset-react') ], From 7a548eb444123fe69743f43eb1f6545dd95d166e Mon Sep 17 00:00:00 2001 From: Michel Simonot Date: Wed, 4 Oct 2017 15:34:39 -0400 Subject: [PATCH 148/555] fix(html): Display all levels of parameter properties. (#933) Fix default_theme to render all parameter properties. - Split the parameter property template portion into its own partial. - Have the new partial recursively call itself if there are sub-properties. --- __tests__/__snapshots__/bin.js.snap | 127 +++++++++++++++++++++++-- __tests__/__snapshots__/test.js.snap | 127 +++++++++++++++++++++++-- __tests__/fixture/html/nested.input.js | 9 ++ src/default_theme/index._ | 3 +- src/default_theme/index.js | 17 ++-- src/default_theme/paramProperty._ | 15 +++ src/default_theme/section._ | 17 ++-- src/default_theme/section_list._ | 3 +- 8 files changed, 284 insertions(+), 34 deletions(-) create mode 100644 src/default_theme/paramProperty._ diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 28d01d242..82bb12bae 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -97,6 +97,12 @@ exports[`--config 1`] = ` #withOptions +
  • + #withDeepOptions +
  • + @@ -773,16 +779,20 @@ k.isArrayOfBuffers(); - options.foo string - - - + options.foo string + + + + + - options.bar number - - - + options.bar number + + + + + @@ -813,6 +823,107 @@ k.isArrayOfBuffers(); + + +
    +
    + +
    +
    +
    + + withDeepOptions(options) +
    +
    +
    +
    + + + +

    A function with a deep options parameter

    + + +
    withDeepOptions(options: Object)
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + options (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    options.foo string +
    options.bar Object +
    options.bar.buz string +
    + +
    + +
    + + + + + + + + + + + + + + +
    diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 995315509..3b6fa1ffd 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -890,6 +890,12 @@ exports[`html nested.input.js 1`] = ` #withOptions +
  • + #withDeepOptions +
  • + @@ -1538,16 +1544,20 @@ k.isArrayOfBuffers(); - options.foo string - - - + options.foo string + + + + + - options.bar number - - - + options.bar number + + + + + @@ -1578,6 +1588,107 @@ k.isArrayOfBuffers(); + + +
    +
    + +
    +
    +
    + + withDeepOptions(options) +
    +
    +
    +
    + + + +

    A function with a deep options parameter

    + + +
    withDeepOptions(options: Object)
    + + + + + + + + + + + +
    Parameters
    +
    + +
    +
    + options (Object) + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    options.foo string +
    options.bar Object +
    options.bar.buz string +
    + +
    + +
    + + + + + + + + + + + + + + +
    diff --git a/__tests__/fixture/html/nested.input.js b/__tests__/fixture/html/nested.input.js index 47c443f52..5af9ef186 100644 --- a/__tests__/fixture/html/nested.input.js +++ b/__tests__/fixture/html/nested.input.js @@ -26,6 +26,15 @@ Klass.prototype.getFoo = function() { */ Klass.prototype.withOptions = function(options, otherOptions) {}; +/** + * A function with a deep options parameter + * @param {Object} options + * @param {string} options.foo + * @param {Object} options.bar + * @param {string} options.bar.buz + */ +Klass.prototype.withDeepOptions = function(options) {}; + /** * @typedef CustomError * @name CustomError diff --git a/src/default_theme/index._ b/src/default_theme/index._ index 24f3a3caf..859c8b78c 100644 --- a/src/default_theme/index._ +++ b/src/default_theme/index._ @@ -97,7 +97,8 @@ <%= renderSection({ section: s, renderSection: renderSection, - renderSectionList: renderSectionList + renderSectionList: renderSectionList, + renderParamProperty: renderParamProperty }) %> <% } else { %>
    <%=renderNote({ note: s })%>
    diff --git a/src/default_theme/index.js b/src/default_theme/index.js index 1cae8fdf7..eb7230fdc 100644 --- a/src/default_theme/index.js +++ b/src/default_theme/index.js @@ -22,12 +22,13 @@ module.exports = function( comments: Array, config: DocumentationConfig ) { - var linkerStack = new LinkerStack( - config - ).namespaceResolver(comments, function(namespace) { - var slugger = new GithubSlugger(); - return '#' + slugger.slug(namespace); - }); + var linkerStack = new LinkerStack(config).namespaceResolver( + comments, + function(namespace) { + var slugger = new GithubSlugger(); + return '#' + slugger.slug(namespace); + } + ); var formatters = createFormatters(linkerStack.link); @@ -98,6 +99,10 @@ module.exports = function( fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'), sharedImports ); + sharedImports.imports.renderParamProperty = _.template( + fs.readFileSync(path.join(__dirname, 'paramProperty._'), 'utf8'), + sharedImports + ); var pageTemplate = _.template( fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), diff --git a/src/default_theme/paramProperty._ b/src/default_theme/paramProperty._ new file mode 100644 index 000000000..5291b2be3 --- /dev/null +++ b/src/default_theme/paramProperty._ @@ -0,0 +1,15 @@ + + <%- property.name %> <%= formatType(property.type) %> + <% if (property.default) { %> + (default <%- property.default %>) + <% } %> + <%= md(property.description, true) %> + +<% if(property.properties && property.properties.length) { %> + <% property.properties.forEach(function(childProperty) { %> + <%= renderParamProperty({ + property: childProperty, + renderParamProperty: renderParamProperty + }) %> + <% }) %> +<% } %> diff --git a/src/default_theme/section._ b/src/default_theme/section._ index 8228331c7..77adc0016 100644 --- a/src/default_theme/section._ +++ b/src/default_theme/section._ @@ -66,13 +66,10 @@ <% param.properties.forEach(function(property) { %> - - <%- property.name %> <%= formatType(property.type) %> - <% if (property.default) { %> - (default <%- property.default %>) - <% } %> - <%= md(property.description, true) %> - + <%= renderParamProperty({ + property: property, + renderParamProperty: renderParamProperty + }) %> <% }) %> @@ -137,16 +134,16 @@ <% if (section.members.static && section.members.static.length) { %>
    Static Members
    - <%= renderSectionList({ members: section.members.static, renderSection: renderSection, noun: 'Static Member' }) %> + <%= renderSectionList({ members: section.members.static, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Static Member' }) %> <% } %> <% if (section.members.instance && section.members.instance.length) { %>
    Instance Members
    - <%= renderSectionList({ members: section.members.instance, renderSection: renderSection, noun: 'Instance Member' }) %> + <%= renderSectionList({ members: section.members.instance, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Instance Member' }) %> <% } %> <% if (section.members.events && section.members.events.length) { %>
    Events
    - <%= renderSectionList({ members: section.members.events, renderSection: renderSection, noun: 'Event' }) %> + <%= renderSectionList({ members: section.members.events, renderSection: renderSection, renderParamProperty: renderParamProperty, noun: 'Event' }) %> <% } %> diff --git a/src/default_theme/section_list._ b/src/default_theme/section_list._ index 7063465fe..60d80ac32 100644 --- a/src/default_theme/section_list._ +++ b/src/default_theme/section_list._ @@ -11,7 +11,8 @@ <%= renderSection({ section: member, renderSection: renderSection, - nested: true + renderParamProperty: renderParamProperty, + nested: true }) %>
    From 303b7929acc230197facd9d89a3521302001cf53 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 4 Oct 2017 12:57:10 -0700 Subject: [PATCH 149/555] chore: Update mime within 1.x range to address regex vuln (#934) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 67631e6fc..54a43d398 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "lodash": "^4.11.1", "mdast-util-inject": "^1.1.0", "micromatch": "^3.0.0", - "mime": "^1.3.4", + "mime": "^1.4.1", "module-deps-sortable": "4.0.6", "parse-filepath": "^1.0.1", "pify": "^3.0.0", From 69ce427f0206a3b8541baca9b57146bee67fe8ff Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Wed, 4 Oct 2017 15:38:17 -0700 Subject: [PATCH 150/555] chore: Update yarn.lock --- yarn.lock | 860 ++++++++++++++++++++++++++---------------------------- 1 file changed, 414 insertions(+), 446 deletions(-) diff --git a/yarn.lock b/yarn.lock index fc330e35a..75592aae5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -73,7 +73,7 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.0.0, ansi-escapes@^1.4.0: +ansi-escapes@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -81,11 +81,15 @@ ansi-escapes@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" + ansi-html@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" -ansi-regex@^2.0.0, ansi-regex@^2.1.1: +ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -97,7 +101,7 @@ ansi-styles@^2.0.1, ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.0.0, ansi-styles@^3.1.0: +ansi-styles@^3.1.0, ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: @@ -211,6 +215,10 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" @@ -241,7 +249,7 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" -babel-cli@^6.24.1: +babel-cli@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" dependencies: @@ -442,20 +450,12 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-jest@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-20.0.3.tgz#e4a03b13dc10389e140fc645d09ffc4ced301671" +babel-jest@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-21.2.0.tgz#2ce059519a9374a2c46f2455b6fbef5ad75d863e" dependencies: - babel-core "^6.0.0" babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^20.0.3" - -babel-jest@^21.0.0: - version "21.0.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-21.0.0.tgz#4f636a7dce105aa5753d5f3dde4422ff50c1d6c5" - dependencies: - babel-plugin-istanbul "^4.0.0" - babel-preset-jest "^21.0.0" + babel-preset-jest "^21.2.0" babel-messages@^6.23.0: version "6.23.0" @@ -477,13 +477,9 @@ babel-plugin-istanbul@^4.0.0: istanbul-lib-instrument "^1.7.2" test-exclude "^4.1.1" -babel-plugin-jest-hoist@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-20.0.3.tgz#afedc853bd3f8dc3548ea671fbe69d03cc2c1767" - -babel-plugin-jest-hoist@^21.0.0: - version "21.0.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.0.0.tgz#aa2dbab7b0d58fa635640efd53aab730be7b3273" +babel-plugin-jest-hoist@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-21.2.0.tgz#2cef637259bd4b628a6cace039de5fcd14dbb006" babel-plugin-syntax-async-functions@^6.13.0, babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" @@ -533,7 +529,7 @@ babel-plugin-syntax-jsx@^6.3.13, babel-plugin-syntax-jsx@^6.8.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz#0af32a9a6e13ca7a3fd5069e62d7b0f58d0d8946" -babel-plugin-syntax-object-rest-spread@^6.8.0: +babel-plugin-syntax-object-rest-spread@^6.13.0, babel-plugin-syntax-object-rest-spread@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" @@ -555,7 +551,7 @@ babel-plugin-transform-async-generator-functions@^6.24.1: babel-plugin-syntax-async-generators "^6.5.0" babel-runtime "^6.22.0" -babel-plugin-transform-async-to-generator@^6.24.1: +babel-plugin-transform-async-to-generator@^6.22.0, babel-plugin-transform-async-to-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" dependencies: @@ -617,7 +613,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-block-scoping@^6.24.1: +babel-plugin-transform-es2015-block-scoping@^6.23.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" dependencies: @@ -627,7 +623,7 @@ babel-plugin-transform-es2015-block-scoping@^6.24.1: babel-types "^6.26.0" lodash "^4.17.4" -babel-plugin-transform-es2015-classes@^6.24.1: +babel-plugin-transform-es2015-classes@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" dependencies: @@ -641,33 +637,33 @@ babel-plugin-transform-es2015-classes@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-computed-properties@^6.24.1: +babel-plugin-transform-es2015-computed-properties@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" dependencies: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-destructuring@^6.22.0: +babel-plugin-transform-es2015-destructuring@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-duplicate-keys@^6.24.1: +babel-plugin-transform-es2015-duplicate-keys@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" dependencies: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-plugin-transform-es2015-for-of@^6.22.0: +babel-plugin-transform-es2015-for-of@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-function-name@^6.24.1: +babel-plugin-transform-es2015-function-name@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" dependencies: @@ -681,7 +677,7 @@ babel-plugin-transform-es2015-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-modules-amd@^6.24.1: +babel-plugin-transform-es2015-modules-amd@^6.22.0, babel-plugin-transform-es2015-modules-amd@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" dependencies: @@ -689,7 +685,7 @@ babel-plugin-transform-es2015-modules-amd@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-commonjs@^6.24.1: +babel-plugin-transform-es2015-modules-commonjs@^6.23.0, babel-plugin-transform-es2015-modules-commonjs@^6.24.1, babel-plugin-transform-es2015-modules-commonjs@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" dependencies: @@ -698,7 +694,7 @@ babel-plugin-transform-es2015-modules-commonjs@^6.24.1: babel-template "^6.26.0" babel-types "^6.26.0" -babel-plugin-transform-es2015-modules-systemjs@^6.24.1: +babel-plugin-transform-es2015-modules-systemjs@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" dependencies: @@ -706,7 +702,7 @@ babel-plugin-transform-es2015-modules-systemjs@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-modules-umd@^6.24.1: +babel-plugin-transform-es2015-modules-umd@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" dependencies: @@ -714,14 +710,14 @@ babel-plugin-transform-es2015-modules-umd@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" -babel-plugin-transform-es2015-object-super@^6.24.1: +babel-plugin-transform-es2015-object-super@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" dependencies: babel-helper-replace-supers "^6.24.1" babel-runtime "^6.22.0" -babel-plugin-transform-es2015-parameters@^6.24.1: +babel-plugin-transform-es2015-parameters@^6.23.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" dependencies: @@ -732,7 +728,7 @@ babel-plugin-transform-es2015-parameters@^6.24.1: babel-traverse "^6.24.1" babel-types "^6.24.1" -babel-plugin-transform-es2015-shorthand-properties@^6.24.1: +babel-plugin-transform-es2015-shorthand-properties@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" dependencies: @@ -745,7 +741,7 @@ babel-plugin-transform-es2015-spread@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-sticky-regex@^6.24.1: +babel-plugin-transform-es2015-sticky-regex@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" dependencies: @@ -759,13 +755,13 @@ babel-plugin-transform-es2015-template-literals@^6.22.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-typeof-symbol@^6.22.0: +babel-plugin-transform-es2015-typeof-symbol@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" dependencies: babel-runtime "^6.22.0" -babel-plugin-transform-es2015-unicode-regex@^6.24.1: +babel-plugin-transform-es2015-unicode-regex@^6.22.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" dependencies: @@ -773,7 +769,7 @@ babel-plugin-transform-es2015-unicode-regex@^6.24.1: babel-runtime "^6.22.0" regexpu-core "^2.0.0" -babel-plugin-transform-exponentiation-operator@^6.24.1: +babel-plugin-transform-exponentiation-operator@^6.22.0, babel-plugin-transform-exponentiation-operator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" dependencies: @@ -837,7 +833,7 @@ babel-plugin-transform-react-jsx@^6.24.1: babel-plugin-syntax-jsx "^6.8.0" babel-runtime "^6.22.0" -babel-plugin-transform-regenerator@^6.24.1: +babel-plugin-transform-regenerator@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" dependencies: @@ -858,34 +854,40 @@ babel-polyfill@^6.26.0: core-js "^2.5.0" regenerator-runtime "^0.10.5" -babel-preset-es2015@^6.16.0: - version "6.24.1" - resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" +babel-preset-env@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.0.tgz#2de1c782a780a0a5d605d199c957596da43c44e4" dependencies: babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.22.0" babel-plugin-transform-es2015-arrow-functions "^6.22.0" babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" - babel-plugin-transform-es2015-block-scoping "^6.24.1" - babel-plugin-transform-es2015-classes "^6.24.1" - babel-plugin-transform-es2015-computed-properties "^6.24.1" - babel-plugin-transform-es2015-destructuring "^6.22.0" - babel-plugin-transform-es2015-duplicate-keys "^6.24.1" - babel-plugin-transform-es2015-for-of "^6.22.0" - babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-block-scoping "^6.23.0" + babel-plugin-transform-es2015-classes "^6.23.0" + babel-plugin-transform-es2015-computed-properties "^6.22.0" + babel-plugin-transform-es2015-destructuring "^6.23.0" + babel-plugin-transform-es2015-duplicate-keys "^6.22.0" + babel-plugin-transform-es2015-for-of "^6.23.0" + babel-plugin-transform-es2015-function-name "^6.22.0" babel-plugin-transform-es2015-literals "^6.22.0" - babel-plugin-transform-es2015-modules-amd "^6.24.1" - babel-plugin-transform-es2015-modules-commonjs "^6.24.1" - babel-plugin-transform-es2015-modules-systemjs "^6.24.1" - babel-plugin-transform-es2015-modules-umd "^6.24.1" - babel-plugin-transform-es2015-object-super "^6.24.1" - babel-plugin-transform-es2015-parameters "^6.24.1" - babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-modules-amd "^6.22.0" + babel-plugin-transform-es2015-modules-commonjs "^6.23.0" + babel-plugin-transform-es2015-modules-systemjs "^6.23.0" + babel-plugin-transform-es2015-modules-umd "^6.23.0" + babel-plugin-transform-es2015-object-super "^6.22.0" + babel-plugin-transform-es2015-parameters "^6.23.0" + babel-plugin-transform-es2015-shorthand-properties "^6.22.0" babel-plugin-transform-es2015-spread "^6.22.0" - babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-sticky-regex "^6.22.0" babel-plugin-transform-es2015-template-literals "^6.22.0" - babel-plugin-transform-es2015-typeof-symbol "^6.22.0" - babel-plugin-transform-es2015-unicode-regex "^6.24.1" - babel-plugin-transform-regenerator "^6.24.1" + babel-plugin-transform-es2015-typeof-symbol "^6.23.0" + babel-plugin-transform-es2015-unicode-regex "^6.22.0" + babel-plugin-transform-exponentiation-operator "^6.22.0" + babel-plugin-transform-regenerator "^6.22.0" + browserslist "^2.1.2" + invariant "^2.2.2" + semver "^5.3.0" babel-preset-flow@^6.23.0: version "6.23.0" @@ -893,17 +895,12 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" -babel-preset-jest@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-20.0.3.tgz#cbacaadecb5d689ca1e1de1360ebfc66862c178a" +babel-preset-jest@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.2.0.tgz#ff9d2bce08abd98e8a36d9a8a5189b9173b85638" dependencies: - babel-plugin-jest-hoist "^20.0.3" - -babel-preset-jest@^21.0.0: - version "21.0.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-21.0.0.tgz#13a8d82e999aa49f8b2dc14d0023d362f2e4ba23" - dependencies: - babel-plugin-jest-hoist "^21.0.0" + babel-plugin-jest-hoist "^21.2.0" + babel-plugin-syntax-object-rest-spread "^6.13.0" babel-preset-react@^6.16.0: version "6.24.1" @@ -1104,11 +1101,12 @@ browser-resolve@^1.11.2, browser-resolve@^1.7.0: dependencies: resolve "1.1.7" -bser@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" +browserslist@^2.1.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.4.0.tgz#693ee93d01e66468a6348da5498e011f578f87f8" dependencies: - node-int64 "^0.4.0" + caniuse-lite "^1.0.30000718" + electron-to-chromium "^1.3.18" bser@^2.0.0: version "2.0.0" @@ -1172,17 +1170,13 @@ camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -caseless@~0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" +caniuse-lite@^1.0.30000718: + version "1.0.30000743" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000743.tgz#f4f5c6750676ff8f6144ea40456c3729d5341769" caseless@~0.12.0: version "0.12.0" @@ -1209,7 +1203,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" dependencies: @@ -1612,15 +1606,15 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" -coveralls@^2.13.1: - version "2.13.1" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.1.tgz#d70bb9acc1835ec4f063ff9dac5423c17b11f178" +coveralls@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.0.tgz#22ef730330538080d29b8c151dc9146afde88a99" dependencies: - js-yaml "3.6.1" - lcov-parse "0.0.10" - log-driver "1.2.5" - minimist "1.2.0" - request "2.79.0" + js-yaml "^3.6.1" + lcov-parse "^0.0.10" + log-driver "^1.2.5" + minimist "^1.2.0" + request "^2.79.0" cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" @@ -1692,6 +1686,12 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8, debug@~2.6.7: dependencies: ms "2.0.0" +debug@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -1825,6 +1825,10 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" +electron-to-chromium@^1.3.18: + version "1.3.24" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.24.tgz#9b7b88bb05ceb9fa016a177833cc2dde388f21b6" + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -1873,15 +1877,15 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -eslint-config-prettier@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.3.0.tgz#b75b1eabea0c8b97b34403647ee25db349b9d8a0" +eslint-config-prettier@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.6.0.tgz#f21db0ebb438ad678fb98946097c4bb198befccc" dependencies: get-stdin "^5.0.1" -eslint-plugin-flowtype@^2.34.1: - version "2.35.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.35.0.tgz#d17494f0ae8b727c632d8b9d4b4a848e7e0c04af" +eslint-plugin-flowtype@^2.37.0: + version "2.37.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.37.0.tgz#2b09694deea6efdd8354eccd328db134b2d8b6d5" dependencies: lodash "^4.15.0" @@ -1892,19 +1896,19 @@ eslint-scope@^3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^4.1.1: - version "4.4.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.4.1.tgz#99cd7eafcffca2ff99a5c8f5f2a474d6364b4bd3" +eslint@^4.7.2: + version "4.8.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.8.0.tgz#229ef0e354e0e61d837c7a80fdfba825e199815e" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" - chalk "^1.1.3" + chalk "^2.1.0" concat-stream "^1.6.0" cross-spawn "^5.1.0" - debug "^2.6.8" + debug "^3.0.1" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.5.0" + espree "^3.5.1" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" @@ -1925,22 +1929,23 @@ eslint@^4.1.1: natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^4.0.0" + pluralize "^7.0.0" progress "^2.0.0" require-uncached "^1.0.3" semver "^5.3.0" + strip-ansi "^4.0.0" strip-json-comments "~2.0.1" table "^4.0.1" text-table "~0.2.0" -espree@^3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" +espree@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.1.tgz#0c988b8ab46db53100a1954ae4ba995ddd27d87e" dependencies: acorn "^5.1.1" acorn-jsx "^3.0.0" -esprima@^2.6.0, esprima@^2.7.1: +esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -2031,6 +2036,17 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expect@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-21.2.1.tgz#003ac2ac7005c3c29e73b38a272d4afadd6d1d7b" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^21.2.1" + jest-get-type "^21.2.0" + jest-matcher-utils "^21.2.1" + jest-message-util "^21.2.1" + jest-regex-util "^21.2.0" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -2086,12 +2102,6 @@ faye-websocket@~0.10.0: dependencies: websocket-driver ">=0.5.1" -fb-watchman@^1.8.0: - version "1.9.2" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" - dependencies: - bser "1.0.2" - fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" @@ -2174,9 +2184,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.53.0: - version "0.53.1" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.53.1.tgz#9b22b63a23c99763ae533ebbab07f88c88c97d84" +flow-bin@^0.56.0: + version "0.56.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.56.0.tgz#ce43092203a344ba9bf63c0cabe95d95145f6cad" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" @@ -2212,12 +2222,12 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-extra@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880" +fs-extra@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.2.tgz#f91704c53d1b461f893452b0c307d9997647ab6b" dependencies: graceful-fs "^4.1.2" - jsonfile "^3.0.0" + jsonfile "^4.0.0" universalify "^0.1.0" fs-readdir-recursive@^1.0.0: @@ -2228,7 +2238,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.0.0, fsevents@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" dependencies: @@ -2269,20 +2279,14 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" +get-own-enumerable-property-symbols@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" + get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" @@ -2362,7 +2366,13 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@1.1.3, github-slugger@^1.0.0, github-slugger@^1.1.1: +github-slugger@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.0.tgz#8ada3286fd046d8951c3c952a8d7854cfd90fd9a" + dependencies: + emoji-regex ">=6.0.0 <=6.1.1" + +github-slugger@^1.0.0, github-slugger@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.1.3.tgz#314a6e759a18c2b0cc5760d512ccbab549c549a7" dependencies: @@ -2487,15 +2497,6 @@ har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" -har-validator@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" - dependencies: - chalk "^1.1.1" - commander "^2.9.0" - is-my-json-valid "^2.12.4" - pinkie-promise "^2.0.0" - har-validator@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" @@ -2609,7 +2610,7 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -husky@^0.14.0: +husky@^0.14.3: version "0.14.3" resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" dependencies: @@ -2821,19 +2822,16 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + is-hexadecimal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" -is-my-json-valid@^2.12.4: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -2846,7 +2844,7 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" -is-obj@^1.0.0: +is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -2894,9 +2892,9 @@ is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" is-relative@^0.2.1: version "0.2.1" @@ -3049,228 +3047,235 @@ istanbul-reports@^1.1.1: dependencies: handlebars "^4.0.3" -jest-changed-files@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-20.0.3.tgz#9394d5cc65c438406149bef1bf4d52b68e03e3f8" +jest-changed-files@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-21.2.0.tgz#5dbeecad42f5d88b482334902ce1cba6d9798d29" + dependencies: + throat "^4.0.0" -jest-cli@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-20.0.4.tgz#e532b19d88ae5bc6c417e8b0593a6fe954b1dc93" +jest-cli@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-21.2.1.tgz#9c528b6629d651911138d228bdb033c157ec8c00" dependencies: - ansi-escapes "^1.4.0" - callsites "^2.0.0" - chalk "^1.1.3" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + glob "^7.1.2" graceful-fs "^4.1.11" is-ci "^1.0.10" istanbul-api "^1.1.1" istanbul-lib-coverage "^1.0.1" istanbul-lib-instrument "^1.4.2" istanbul-lib-source-maps "^1.1.0" - jest-changed-files "^20.0.3" - jest-config "^20.0.4" - jest-docblock "^20.0.3" - jest-environment-jsdom "^20.0.3" - jest-haste-map "^20.0.4" - jest-jasmine2 "^20.0.4" - jest-message-util "^20.0.3" - jest-regex-util "^20.0.3" - jest-resolve-dependencies "^20.0.3" - jest-runtime "^20.0.4" - jest-snapshot "^20.0.3" - jest-util "^20.0.3" + jest-changed-files "^21.2.0" + jest-config "^21.2.1" + jest-environment-jsdom "^21.2.1" + jest-haste-map "^21.2.0" + jest-message-util "^21.2.1" + jest-regex-util "^21.2.0" + jest-resolve-dependencies "^21.2.0" + jest-runner "^21.2.1" + jest-runtime "^21.2.1" + jest-snapshot "^21.2.1" + jest-util "^21.2.1" micromatch "^2.3.11" node-notifier "^5.0.2" - pify "^2.3.0" + pify "^3.0.0" slash "^1.0.0" - string-length "^1.0.1" - throat "^3.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" which "^1.2.12" worker-farm "^1.3.1" - yargs "^7.0.2" + yargs "^9.0.0" -jest-config@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-20.0.4.tgz#e37930ab2217c913605eff13e7bd763ec48faeea" +jest-config@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-21.2.1.tgz#c7586c79ead0bcc1f38c401e55f964f13bf2a480" dependencies: - chalk "^1.1.3" + chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^20.0.3" - jest-environment-node "^20.0.3" - jest-jasmine2 "^20.0.4" - jest-matcher-utils "^20.0.3" - jest-regex-util "^20.0.3" - jest-resolve "^20.0.4" - jest-validate "^20.0.3" - pretty-format "^20.0.3" - -jest-diff@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-20.0.3.tgz#81f288fd9e675f0fb23c75f1c2b19445fe586617" - dependencies: - chalk "^1.1.3" + jest-environment-jsdom "^21.2.1" + jest-environment-node "^21.2.1" + jest-get-type "^21.2.0" + jest-jasmine2 "^21.2.1" + jest-regex-util "^21.2.0" + jest-resolve "^21.2.0" + jest-util "^21.2.1" + jest-validate "^21.2.1" + pretty-format "^21.2.1" + +jest-diff@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-21.2.1.tgz#46cccb6cab2d02ce98bc314011764bb95b065b4f" + dependencies: + chalk "^2.0.1" diff "^3.2.0" - jest-matcher-utils "^20.0.3" - pretty-format "^20.0.3" + jest-get-type "^21.2.0" + pretty-format "^21.2.1" -jest-docblock@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" +jest-docblock@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" -jest-environment-jsdom@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-20.0.3.tgz#048a8ac12ee225f7190417713834bb999787de99" +jest-environment-jsdom@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-21.2.1.tgz#38d9980c8259b2a608ec232deee6289a60d9d5b4" dependencies: - jest-mock "^20.0.3" - jest-util "^20.0.3" + jest-mock "^21.2.0" + jest-util "^21.2.1" jsdom "^9.12.0" -jest-environment-node@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-20.0.3.tgz#d488bc4612af2c246e986e8ae7671a099163d403" +jest-environment-node@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-21.2.1.tgz#98c67df5663c7fbe20f6e792ac2272c740d3b8c8" dependencies: - jest-mock "^20.0.3" - jest-util "^20.0.3" + jest-mock "^21.2.0" + jest-util "^21.2.1" -jest-haste-map@^20.0.4: - version "20.0.5" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-20.0.5.tgz#abad74efb1a005974a7b6517e11010709cab9112" +jest-get-type@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" + +jest-haste-map@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-21.2.0.tgz#1363f0a8bb4338f24f001806571eff7a4b2ff3d8" dependencies: fb-watchman "^2.0.0" graceful-fs "^4.1.11" - jest-docblock "^20.0.3" + jest-docblock "^21.2.0" micromatch "^2.3.11" - sane "~1.6.0" + sane "^2.0.0" worker-farm "^1.3.1" -jest-jasmine2@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-20.0.4.tgz#fcc5b1411780d911d042902ef1859e852e60d5e1" +jest-jasmine2@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-21.2.1.tgz#9cc6fc108accfa97efebce10c4308548a4ea7592" dependencies: - chalk "^1.1.3" + chalk "^2.0.1" + expect "^21.2.1" graceful-fs "^4.1.11" - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-matchers "^20.0.3" - jest-message-util "^20.0.3" - jest-snapshot "^20.0.3" - once "^1.4.0" - p-map "^1.1.1" + jest-diff "^21.2.1" + jest-matcher-utils "^21.2.1" + jest-message-util "^21.2.1" + jest-snapshot "^21.2.1" + p-cancelable "^0.3.0" -jest-matcher-utils@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-20.0.3.tgz#b3a6b8e37ca577803b0832a98b164f44b7815612" +jest-matcher-utils@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-21.2.1.tgz#72c826eaba41a093ac2b4565f865eb8475de0f64" dependencies: - chalk "^1.1.3" - pretty-format "^20.0.3" + chalk "^2.0.1" + jest-get-type "^21.2.0" + pretty-format "^21.2.1" -jest-matchers@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-20.0.3.tgz#ca69db1c32db5a6f707fa5e0401abb55700dfd60" +jest-message-util@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-21.2.1.tgz#bfe5d4692c84c827d1dcf41823795558f0a1acbe" dependencies: - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-message-util "^20.0.3" - jest-regex-util "^20.0.3" - -jest-message-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-20.0.3.tgz#6aec2844306fcb0e6e74d5796c1006d96fdd831c" - dependencies: - chalk "^1.1.3" + chalk "^2.0.1" micromatch "^2.3.11" slash "^1.0.0" -jest-mock@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-20.0.3.tgz#8bc070e90414aa155c11a8d64c869a0d5c71da59" +jest-mock@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-21.2.0.tgz#7eb0770e7317968165f61ea2a7281131534b3c0f" -jest-regex-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-20.0.3.tgz#85bbab5d133e44625b19faf8c6aa5122d085d762" +jest-regex-util@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-21.2.0.tgz#1b1e33e63143babc3e0f2e6c9b5ba1eb34b2d530" -jest-resolve-dependencies@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-20.0.3.tgz#6e14a7b717af0f2cb3667c549de40af017b1723a" +jest-resolve-dependencies@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-21.2.0.tgz#9e231e371e1a736a1ad4e4b9a843bc72bfe03d09" dependencies: - jest-regex-util "^20.0.3" + jest-regex-util "^21.2.0" -jest-resolve@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-20.0.4.tgz#9448b3e8b6bafc15479444c6499045b7ffe597a5" +jest-resolve@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-21.2.0.tgz#068913ad2ba6a20218e5fd32471f3874005de3a6" dependencies: browser-resolve "^1.11.2" + chalk "^2.0.1" is-builtin-module "^1.0.0" - resolve "^1.3.2" -jest-runtime@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-20.0.4.tgz#a2c802219c4203f754df1404e490186169d124d8" +jest-runner@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-21.2.1.tgz#194732e3e518bfb3d7cbfc0fd5871246c7e1a467" + dependencies: + jest-config "^21.2.1" + jest-docblock "^21.2.0" + jest-haste-map "^21.2.0" + jest-jasmine2 "^21.2.1" + jest-message-util "^21.2.1" + jest-runtime "^21.2.1" + jest-util "^21.2.1" + pify "^3.0.0" + throat "^4.0.0" + worker-farm "^1.3.1" + +jest-runtime@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-21.2.1.tgz#99dce15309c670442eee2ebe1ff53a3cbdbbb73e" dependencies: babel-core "^6.0.0" - babel-jest "^20.0.3" + babel-jest "^21.2.0" babel-plugin-istanbul "^4.0.0" - chalk "^1.1.3" + chalk "^2.0.1" convert-source-map "^1.4.0" graceful-fs "^4.1.11" - jest-config "^20.0.4" - jest-haste-map "^20.0.4" - jest-regex-util "^20.0.3" - jest-resolve "^20.0.4" - jest-util "^20.0.3" + jest-config "^21.2.1" + jest-haste-map "^21.2.0" + jest-regex-util "^21.2.0" + jest-resolve "^21.2.0" + jest-util "^21.2.1" json-stable-stringify "^1.0.1" micromatch "^2.3.11" + slash "^1.0.0" strip-bom "3.0.0" - yargs "^7.0.2" + write-file-atomic "^2.1.0" + yargs "^9.0.0" -jest-snapshot@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-20.0.3.tgz#5b847e1adb1a4d90852a7f9f125086e187c76566" +jest-snapshot@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-21.2.1.tgz#29e49f16202416e47343e757e5eff948c07fd7b0" dependencies: - chalk "^1.1.3" - jest-diff "^20.0.3" - jest-matcher-utils "^20.0.3" - jest-util "^20.0.3" + chalk "^2.0.1" + jest-diff "^21.2.1" + jest-matcher-utils "^21.2.1" + mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^20.0.3" + pretty-format "^21.2.1" -jest-util@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-20.0.3.tgz#0c07f7d80d82f4e5a67c6f8b9c3fe7f65cfd32ad" +jest-util@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-21.2.1.tgz#a274b2f726b0897494d694a6c3d6a61ab819bb78" dependencies: - chalk "^1.1.3" + callsites "^2.0.0" + chalk "^2.0.1" graceful-fs "^4.1.11" - jest-message-util "^20.0.3" - jest-mock "^20.0.3" - jest-validate "^20.0.3" - leven "^2.1.0" + jest-message-util "^21.2.1" + jest-mock "^21.2.0" + jest-validate "^21.2.1" mkdirp "^0.5.1" -jest-validate@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-20.0.3.tgz#d0cfd1de4f579f298484925c280f8f1d94ec3cab" +jest-validate@^21.1.0, jest-validate@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" dependencies: - chalk "^1.1.3" - jest-matcher-utils "^20.0.3" + chalk "^2.0.1" + jest-get-type "^21.2.0" leven "^2.1.0" - pretty-format "^20.0.3" + pretty-format "^21.2.1" -jest@^20.0.4: - version "20.0.4" - resolved "https://registry.yarnpkg.com/jest/-/jest-20.0.4.tgz#3dd260c2989d6dad678b1e9cc4d91944f6d602ac" +jest@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-21.2.1.tgz#c964e0b47383768a1438e3ccf3c3d470327604e1" dependencies: - jest-cli "^20.0.4" + jest-cli "^21.2.1" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" - dependencies: - argparse "^1.0.7" - esprima "^2.6.0" - js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4, js-yaml@^3.9.1: version "3.9.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" @@ -3278,6 +3283,13 @@ js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4, js-yaml@^3.9.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.6.1: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -3340,9 +3352,9 @@ json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" -jsonfile@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" optionalDependencies: graceful-fs "^4.1.6" @@ -3354,10 +3366,6 @@ jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -3409,7 +3417,7 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -lcov-parse@0.0.10: +lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" @@ -3424,19 +3432,24 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.3.tgz#1ce55591bc2c83a781a90b69a0a0c8aa0fc6370b" +lint-staged@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.2.3.tgz#5a1f12256af06110b96225f109dbf215009a37a9" dependencies: app-root-path "^2.0.0" + chalk "^2.1.0" cosmiconfig "^1.1.0" execa "^0.8.0" + is-glob "^4.0.0" + jest-validate "^21.1.0" listr "^0.12.0" - lodash.chunk "^4.2.0" + lodash "^4.17.4" + log-symbols "^2.0.0" minimatch "^3.0.0" npm-which "^3.0.1" p-map "^1.1.1" staged-git-files "0.0.4" + stringify-object "^3.2.0" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -3519,10 +3532,6 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" -lodash.chunk@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" - lodash.isequal@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" @@ -3548,7 +3557,7 @@ lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, l version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" -log-driver@1.2.5: +log-driver@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.5.tgz#7ae4ec257302fd790d557cb10c97100d857b0056" @@ -3558,6 +3567,12 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" +log-symbols@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.1.0.tgz#f35fa60e278832b538dc4dddcbb478a45d3e3be6" + dependencies: + chalk "^2.0.1" + log-update@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" @@ -3746,9 +3761,9 @@ mime-types@^2.1.12, mime-types@~2.1.7: dependencies: mime-db "~1.29.0" -mime@^1.3.4: - version "1.3.6" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0" +mime@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" mimic-fn@^1.0.0: version "1.1.0" @@ -3764,7 +3779,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: +minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3785,7 +3800,7 @@ mixin-deep@^1.1.3: dependencies: minimist "0.0.8" -mock-fs@^4.2.0: +mock-fs@^4.4.1: version "4.4.1" resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.4.1.tgz#f285fa025b42a4031faf75b66f632b21e7056683" @@ -4032,12 +4047,6 @@ os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - dependencies: - lcid "^1.0.0" - os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" @@ -4065,7 +4074,11 @@ output-file-sync@^1.1.2: mkdirp "^0.5.1" object-assign "^4.1.0" -p-event@^1.0.0: +p-cancelable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-0.3.0.tgz#b9e123800bcebb7ac13a479be195b507b98d30fa" + +p-event@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.3.0.tgz#8e6b4f4f65c72bc5b6fe28b75eda874f96a4a085" dependencies: @@ -4246,9 +4259,9 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pluralize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" posix-character-classes@^0.1.0: version "0.1.1" @@ -4262,16 +4275,16 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^1.0.0: - version "1.5.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.5.3.tgz#59dadc683345ec6b88f88b94ed4ae7e1da394bfe" +prettier@^1.7.2: + version "1.7.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.4.tgz#5e8624ae9363c80f95ec644584ecdf55d74f93fa" -pretty-format@^20.0.3: - version "20.0.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-20.0.3.tgz#020e350a560a1fe1a98dc3beb6ccffb386de8b14" +pretty-format@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" dependencies: - ansi-regex "^2.1.1" - ansi-styles "^3.0.0" + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" private@^0.1.6, private@^0.1.7: version "0.1.7" @@ -4313,10 +4326,6 @@ qs@^6.4.0: version "6.5.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.0.tgz#8d04954d364def3efc55b5a0793e1e2c8b1e6e49" -qs@~6.3.0: - version "6.3.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" - qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" @@ -4598,31 +4607,6 @@ replace-ext@1.0.0, replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" -request@2.79.0: - version "2.79.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de" - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~2.1.1" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - oauth-sign "~0.8.1" - qs "~6.3.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - uuid "^3.0.0" - request@^2.79.0, request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -4681,7 +4665,7 @@ resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.3, resolve@^1.1.6, resolve@^1.3.2: +resolve@^1.1.3, resolve@^1.1.6: version "1.4.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" dependencies: @@ -4747,17 +4731,19 @@ safe-json-parse@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" -sane@~1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" +sane@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.2.0.tgz#d6d2e2fcab00e3d283c93b912b7c3a20846f1d56" dependencies: anymatch "^1.3.0" exec-sh "^0.2.0" - fb-watchman "^1.8.0" + fb-watchman "^2.0.0" minimatch "^3.0.2" minimist "^1.1.1" walker "~1.0.5" - watch "~0.10.0" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.1.1" sax@^1.2.1: version "1.2.4" @@ -4952,7 +4938,7 @@ staged-git-files@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" -standard-version@^4.0.0: +standard-version@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-4.2.0.tgz#3017e8c5ced2a92db7501790255c3ba85157375d" dependencies: @@ -4996,11 +4982,12 @@ stream-to-observable@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" -string-length@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" dependencies: - strip-ansi "^3.0.0" + astral-regex "^1.0.0" + strip-ansi "^4.0.0" string-template@~0.2.1: version "0.2.1" @@ -5040,6 +5027,14 @@ stringify-entities@^1.0.1: is-alphanumerical "^1.0.0" is-hexadecimal "^1.0.0" +stringify-object@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.1.tgz#2720c2eff940854c819f6ee252aaeb581f30624d" + dependencies: + get-own-enumerable-property-symbols "^2.0.1" + is-obj "^1.0.1" + is-regexp "^1.0.0" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -5171,9 +5166,9 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" -throat@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" through2-filter@^2.0.0: version "2.0.0" @@ -5314,10 +5309,6 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" -tunnel-agent@~0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" - tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" @@ -5563,9 +5554,12 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" -watch@~0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" webidl-conversions@^3.0.0: version "3.0.1" @@ -5598,10 +5592,6 @@ whatwg-url@^4.3.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -5656,6 +5646,14 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +write-file-atomic@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -5686,63 +5684,33 @@ yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yargs-parser@^4.2.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" - dependencies: - camelcase "^3.0.0" - -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - dependencies: - camelcase "^3.0.0" - yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" dependencies: camelcase "^4.1.0" -yargs@^6.0.1: - version "6.6.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^4.2.0" - -yargs@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" +yargs@^8.0.1: + version "8.0.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" dependencies: - camelcase "^3.0.0" + camelcase "^4.1.0" cliui "^3.2.0" decamelize "^1.1.1" get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" + os-locale "^2.0.0" + read-pkg-up "^2.0.0" require-directory "^2.1.1" require-main-filename "^1.0.1" set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" + string-width "^2.0.0" + which-module "^2.0.0" y18n "^3.2.1" - yargs-parser "^5.0.0" + yargs-parser "^7.0.0" -yargs@^8.0.1: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" +yargs@^9.0.0, yargs@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-9.0.1.tgz#52acc23feecac34042078ee78c0c007f5085db4c" dependencies: camelcase "^4.1.0" cliui "^3.2.0" From c43701b6723f868b6d14ce31c21f21db57ecbb77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Glind=C3=A5s?= Date: Thu, 5 Oct 2017 18:30:04 +0200 Subject: [PATCH 151/555] docs: Fix grammar in getting started Grammar fix. --- docs/GETTING_STARTED.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index 5f9d9515d..e1b1dbd75 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -1,6 +1,6 @@ # Getting Started -`documentation` is a **documentation generator**. It's used to generates documentation from +`documentation` is a **documentation generator**. It's used to generate documentation from comments _within your code_. `documentation` processes JavaScript comments in the JSDoc format. From e4781ebf548bcaff9541fe4248e60e6237ec938f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 12 Oct 2017 16:26:22 -0700 Subject: [PATCH 152/555] fix: Fix the split in HTML at 33/67% instead of calculating percentages (#939) Previously this was calculated so that the left page would expand to its natural size. That's not really what we want, because the natural size could be as high as 100%. Fixes #927 --- src/default_theme/assets/site.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/default_theme/assets/site.js b/src/default_theme/assets/site.js index 0c4a32fca..f86584f2f 100644 --- a/src/default_theme/assets/site.js +++ b/src/default_theme/assets/site.js @@ -113,15 +113,6 @@ split_left.style.overflow = 'hidden'; var cw_without_sb = split_left.clientWidth; split_left.style.overflow = ''; -// Need to add: -// - Half of gutterSize (i.e. 10) because gutter will take that much from each. -// - Scrollbar width (cw_with_sb - cw_without_sb), if it takes up existing -// space (Firefox) rather than adding the scrollbar to the side (Chrome) -var percent_left = - (split_left.getBoundingClientRect().width + 10 + cw_without_sb - cw_with_sb) / - split_parent.getBoundingClientRect().width * - 100; - Split(['#split-left', '#split-right'], { elementStyle: function(dimension, size, gutterSize) { return { @@ -134,7 +125,7 @@ Split(['#split-left', '#split-right'], { }; }, gutterSize: 20, - sizes: [percent_left, 100 - percent_left] + sizes: [33, 67] }); // Chrome doesn't remember scroll position properly so do it ourselves. From 55307ce13e962f168008c7313e90f06d02a4ed73 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 12 Oct 2017 16:32:46 -0700 Subject: [PATCH 153/555] chore(release): 5.3.3 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d8926874..d2186e4ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.3.3](https://github.com/documentationjs/documentation/compare/v5.3.2...v5.3.3) (2017-10-12) + + +### Bug Fixes + +* **html:** Display all levels of parameter properties. ([#933](https://github.com/documentationjs/documentation/issues/933)) ([7a548eb](https://github.com/documentationjs/documentation/commit/7a548eb)) +* **package:** update github-slugger to version 1.2.0 ([2b74956](https://github.com/documentationjs/documentation/commit/2b74956)) +* Fix the split in HTML at 33/67% instead of calculating percentages ([#939](https://github.com/documentationjs/documentation/issues/939)) ([e4781eb](https://github.com/documentationjs/documentation/commit/e4781eb)), closes [#927](https://github.com/documentationjs/documentation/issues/927) + + + ## [5.3.2](https://github.com/documentationjs/documentation/compare/v5.3.1...v5.3.2) (2017-09-15) diff --git a/package.json b/package.json index 54a43d398..538ff29b3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.3.2", + "version": "5.3.3", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From 2128e42ffb39eb47159fbeefdf9e435b7179d2bd Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 12 Oct 2017 16:34:51 -0700 Subject: [PATCH 154/555] Update for tag --- __tests__/__snapshots__/bin.js.snap | 4 ++-- __tests__/__snapshots__/test.js.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 82bb12bae..f08664070 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.3.2 | Documentation + documentation 5.3.3 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.3.2
    +
    5.3.3
    - documentation 5.3.2 | Documentation + documentation 5.3.3 | Documentation @@ -820,7 +820,7 @@ exports[`html nested.input.js 1`] = `

    documentation

    -
    5.3.2
    +
    5.3.3
    Date: Mon, 16 Oct 2017 09:37:44 +0300 Subject: [PATCH 155/555] chore(package): update flow-bin to version 0.57.1 (#940) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 538ff29b3..2317ebb4e 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", "eslint-plugin-flowtype": "^2.37.0", - "flow-bin": "^0.56.0", + "flow-bin": "^0.57.1", "fs-extra": "^4.0.2", "husky": "^0.14.3", "jest": "^21.2.1", From 10dff6f536d1aed12ff042606f4f6fe55605ed55 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 24 Oct 2017 15:10:22 +0000 Subject: [PATCH 156/555] fix(package): update babelify to version 8.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2317ebb4e..9963e3cc7 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "babel-preset-stage-0": "^6.16.0", "babel-traverse": "^6.16.0", "babel-types": "^6.16.0", - "babelify": "^7.3.0", + "babelify": "^8.0.0", "babylon": "^6.17.2", "chalk": "^2.0.0", "chokidar": "^1.2.0", From bdbec7e9635b12be5f67e48e43e9c3fee1ef756f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 27 Oct 2017 10:37:33 -0700 Subject: [PATCH 157/555] chore(package): update cz-conventional-changelog to version 2.1.0 (#944) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9963e3cc7..dbb13318c 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", "coveralls": "^3.0.0", - "cz-conventional-changelog": "2.0.0", + "cz-conventional-changelog": "2.1.0", "documentation-schema": "0.0.1", "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", From 68000e6422651d4772ee6b8cac88c5fc9db2080f Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 2 Nov 2017 01:20:43 +0000 Subject: [PATCH 158/555] chore(package): update flow-bin to version 0.58.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dbb13318c..87ab9bb89 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", "eslint-plugin-flowtype": "^2.37.0", - "flow-bin": "^0.57.1", + "flow-bin": "^0.58.0", "fs-extra": "^4.0.2", "husky": "^0.14.3", "jest": "^21.2.1", From d8fbf2c427b37208fe7dca606e22ce2ab1bb57ae Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 4 Nov 2017 08:12:42 +0000 Subject: [PATCH 159/555] fix(package): update read-pkg-up to version 3.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 87ab9bb89..e61a693d7 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "module-deps-sortable": "4.0.6", "parse-filepath": "^1.0.1", "pify": "^3.0.0", - "read-pkg-up": "^2.0.0", + "read-pkg-up": "^3.0.0", "remark": "^8.0.0", "remark-html": "6.0.1", "remark-toc": "^4.0.0", From 84f383db59c6d5389392c79ba42834d3adaf36ea Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 9 Nov 2017 01:08:08 +0000 Subject: [PATCH 160/555] chore(package): update flow-bin to version 0.59.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e61a693d7..0bded14b2 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", "eslint-plugin-flowtype": "^2.37.0", - "flow-bin": "^0.58.0", + "flow-bin": "^0.59.0", "fs-extra": "^4.0.2", "husky": "^0.14.3", "jest": "^21.2.1", From 436bfcb953d5b88c46a82fcccca606082a2e0019 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sat, 11 Nov 2017 08:36:18 +0000 Subject: [PATCH 161/555] chore(package): update lint-staged to version 5.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bded14b2..4954d2bcd 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "husky": "^0.14.3", "jest": "^21.2.1", "json-schema": "0.2.3", - "lint-staged": "^4.2.3", + "lint-staged": "^5.0.0", "mock-fs": "^4.4.1", "p-event": "^1.3.0", "prettier": "^1.7.2", From f42cbe7b548c247ae0545ad782b9e5ffba72a88c Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 1 Dec 2017 14:55:04 +0000 Subject: [PATCH 162/555] chore(package): update flow-bin to version 0.60.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4954d2bcd..6ab12c2ad 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", "eslint-plugin-flowtype": "^2.37.0", - "flow-bin": "^0.59.0", + "flow-bin": "^0.60.0", "fs-extra": "^4.0.2", "husky": "^0.14.3", "jest": "^21.2.1", From 98428144bca129ee22da5f11a6f31a73f9ff3535 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 4 Dec 2017 20:21:08 +0000 Subject: [PATCH 163/555] fix(package): update remark-html to version 7.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ab12c2ad..17fda7a49 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "pify": "^3.0.0", "read-pkg-up": "^3.0.0", "remark": "^8.0.0", - "remark-html": "6.0.1", + "remark-html": "7.0.0", "remark-toc": "^4.0.0", "remote-origin-url": "0.4.0", "shelljs": "^0.7.5", From 1d6fe8084100d971f5c3a66f09dc7be975595566 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 5 Dec 2017 15:57:51 -0800 Subject: [PATCH 164/555] fix(package): update vinyl-fs to version 3.0.0 (#966) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17fda7a49..c858295e1 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vfile-reporter": "^4.0.0", "vfile-sort": "^2.0.0", "vinyl": "^2.0.0", - "vinyl-fs": "^2.3.1", + "vinyl-fs": "^3.0.0", "yargs": "^9.0.1" }, "devDependencies": { From 359ba92fa97b708b9415333f6053254993720508 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 8 Dec 2017 22:51:01 +0000 Subject: [PATCH 165/555] chore(package): update flow-bin to version 0.61.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c858295e1..6a7a9dcd8 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "eslint": "^4.7.2", "eslint-config-prettier": "^2.6.0", "eslint-plugin-flowtype": "^2.37.0", - "flow-bin": "^0.60.0", + "flow-bin": "^0.61.0", "fs-extra": "^4.0.2", "husky": "^0.14.3", "jest": "^21.2.1", From b6e7e7d3f528bf830a79277ab993181abdaed929 Mon Sep 17 00:00:00 2001 From: Anton Shchekota Date: Sat, 9 Dec 2017 16:03:28 +0300 Subject: [PATCH 166/555] chore - update lint-staged --verbose options is deprecated --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6a7a9dcd8..f57a3e767 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "husky": "^0.14.3", "jest": "^21.2.1", "json-schema": "0.2.3", - "lint-staged": "^5.0.0", + "lint-staged": "^6.0.0", "mock-fs": "^4.4.1", "p-event": "^1.3.0", "prettier": "^1.7.2", @@ -101,7 +101,7 @@ "scripts": { "build": "rm -rf lib && babel -D src -d lib && npm run doc", "release": "standard-version", - "precommit": "lint-staged --verbose", + "precommit": "lint-staged", "prepublish": "npm run build", "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "node ./bin/documentation.js build src/index.js -f md --access=public > docs/NODE_API.md", From 7e0127819af71cb27a92a51e91d6e70d7c4c3be5 Mon Sep 17 00:00:00 2001 From: Hugo Josefson Date: Sun, 10 Dec 2017 13:04:32 +0100 Subject: [PATCH 167/555] Fix args regression: readme --shallow --format (Invalid second argument) (#968) * Add shared_options to readme command. This makes --shallow and --format work again. * Update yarn.lock based on package.json. * Move readme example to where it works, remove superfluous usage string. yargs@>=7 throws exceptions on incorrectly structured builder objects. * Update expected readme test fixture. * Update bin-readme snapshot. * s/_.assign/Object.assign/g thanks to node@>=4. * Update yarn.lock based on package.json (lint-staged@6) * Override flow error message. --- __tests__/__snapshots__/bin-readme.js.snap | 10 + __tests__/fixture/readme/README.output.md | 5 + bin/documentation.js | 1 + src/commands/build.js | 2 +- src/commands/readme.js | 57 +-- src/commands/serve.js | 2 +- src/infer/params.js | 22 +- src/nest.js | 6 +- yarn.lock | 531 +++++++++++++-------- 9 files changed, 387 insertions(+), 249 deletions(-) diff --git a/__tests__/__snapshots__/bin-readme.js.snap b/__tests__/__snapshots__/bin-readme.js.snap index efa5e3a23..51a2612a5 100644 --- a/__tests__/__snapshots__/bin-readme.js.snap +++ b/__tests__/__snapshots__/bin-readme.js.snap @@ -7,6 +7,11 @@ exports[`readme command --readme-file 1`] = ` +### Table of Contents + +- [foo](#foo) +- [bar](#bar) + ## foo A function with documentation. @@ -36,6 +41,11 @@ exports[`readme command updates README.md 1`] = ` +### Table of Contents + +- [foo](#foo) +- [bar](#bar) + ## foo A function with documentation. diff --git a/__tests__/fixture/readme/README.output.md b/__tests__/fixture/readme/README.output.md index 54991d56e..88b395ed1 100644 --- a/__tests__/fixture/readme/README.output.md +++ b/__tests__/fixture/readme/README.output.md @@ -4,6 +4,11 @@ +### Table of Contents + +- [foo](#foo) +- [bar](#bar) + ## foo A function with documentation. diff --git a/bin/documentation.js b/bin/documentation.js index 17bd0b14d..0afb4a175 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -21,6 +21,7 @@ var argv = yargs } }) .example('documentation build foo.js -f md > API.md') + .example('documentation readme index.js -s "API Docs" --github') .version() .usage( `Usage: diff --git a/src/commands/build.js b/src/commands/build.js index 73bc183ed..75f1931fa 100644 --- a/src/commands/build.js +++ b/src/commands/build.js @@ -18,7 +18,7 @@ module.exports.describe = 'build documentation'; * @returns {Object} yargs with options * @private */ -module.exports.builder = _.assign( +module.exports.builder = Object.assign( {}, sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, diff --git a/src/commands/readme.js b/src/commands/readme.js index a5d113aef..4cc3df073 100644 --- a/src/commands/readme.js +++ b/src/commands/readme.js @@ -4,46 +4,49 @@ var fs = require('fs'); var remark = require('remark'); var path = require('path'); var documentation = require('../'); +var sharedOptions = require('./shared_options'); var inject = require('mdast-util-inject'); var chalk = require('chalk'); var disparity = require('disparity'); module.exports.command = 'readme [input..]'; module.exports.description = 'inject documentation into your README.md'; + /** * Add yargs parsing for the readme command * @param {Object} yargs module instance * @returns {Object} yargs with options * @private */ -module.exports.builder = { - usage: - 'Usage: documentation readme [--readme-file=README.md] --section "API"' + - ' [--compare-only] [other documentationjs options]', - example: 'documentation readme index.js -s "API Docs" --github', - 'readme-file': { - describe: 'The markdown file into which to inject documentation', - default: 'README.md' - }, - section: { - alias: 's', - describe: - 'The section heading after which to inject generated documentation', - required: true - }, - 'diff-only': { - alias: 'd', - describe: - 'Instead of updating the given README with the generated documentation,' + - ' just check if its contents match, exiting nonzero if not.', - default: false - }, - quiet: { - alias: 'q', - describe: 'Quiet mode: do not print messages or README diff to stdout.', - default: false +module.exports.builder = Object.assign( + {}, + sharedOptions.sharedOutputOptions, + sharedOptions.sharedInputOptions, + { + 'readme-file': { + describe: 'The markdown file into which to inject documentation', + default: 'README.md' + }, + section: { + alias: 's', + describe: + 'The section heading after which to inject generated documentation', + required: true + }, + 'diff-only': { + alias: 'd', + describe: + 'Instead of updating the given README with the generated documentation,' + + ' just check if its contents match, exiting nonzero if not.', + default: false + }, + quiet: { + alias: 'q', + describe: 'Quiet mode: do not print messages or README diff to stdout.', + default: false + } } -}; +); /** * Insert API documentation into a Markdown readme diff --git a/src/commands/serve.js b/src/commands/serve.js index b83c8488f..1097b63ab 100644 --- a/src/commands/serve.js +++ b/src/commands/serve.js @@ -18,7 +18,7 @@ module.exports.description = 'generate, update, and display HTML documentation'; * @returns {Object} yargs with options * @private */ -module.exports.builder = _.assign( +module.exports.builder = Object.assign( {}, sharedOptions.sharedOutputOptions, sharedOptions.sharedInputOptions, diff --git a/src/infer/params.js b/src/infer/params.js index ba99d707f..4c8751c83 100644 --- a/src/infer/params.js +++ b/src/infer/params.js @@ -55,7 +55,7 @@ function inferAndCombineParams(params, comment) { var mergedParamsAndErrors = mergeTrees(inferredParams, comment.params); // Then merge the trees. This is the hard part. - return _.assign(comment, { + return Object.assign(comment, { params: mergedParamsAndErrors.mergedParams, errors: comment.errors.concat(mergedParamsAndErrors.errors) }); @@ -114,7 +114,7 @@ function paramToDoc( throw new Error('Encountered an unexpected parameter type'); } - return _.assign(newAssignmentParam, { + return Object.assign(newAssignmentParam, { default: generate(param.right, { compact: true }).code, @@ -181,7 +181,7 @@ function paramToDoc( // instead we're going to (immutably) rename the parameters to their // indices properties: _.flatMap(param.elements, (element, idx) => { - var indexedElement = _.assign({}, element, { + var indexedElement = Object.assign({}, element, { name: String(idx), indexed: true }); @@ -190,16 +190,22 @@ function paramToDoc( }; } return _.flatMap(param.elements, (element, idx) => { - var indexedElement = _.assign({}, element, { + var indexedElement = Object.assign({}, element, { name: String(idx) }); return paramToDoc(indexedElement, prefix); }); } case 'ObjectProperty': { - return _.assign(paramToDoc(param.value, prefix + '.' + param.key.name || param.key.value), { - name: prefix + '.' + param.key.name || param.key.value - }); + return Object.assign( + ((paramToDoc( + param.value, + prefix + '.' + param.key.name || param.key.value + ): any): CommentTag), + { + name: prefix + '.' + param.key.name || param.key.value + } + ); } case 'RestProperty': // (a, ...b) case 'RestElement': { @@ -342,7 +348,7 @@ function combineTags(inferredTag, explicitTag) { (inferredTag.properties && inferredTag.properties.length) || (explicitTag.properties && explicitTag.properties.length); - return _.assign( + return Object.assign( explicitTag, hasProperties ? { diff --git a/src/nest.js b/src/nest.js index 91a3cce6f..a2869d237 100644 --- a/src/nest.js +++ b/src/nest.js @@ -46,7 +46,7 @@ var nestTag = ( // get to this case because the recursive method // is always passed parts.slice(1) if (parts.length === 1) { - _.assign(node, { + Object.assign(node, { properties: (node.properties || []).concat(tag) }); } else { @@ -62,7 +62,9 @@ var nestTag = ( if (tag.name.match(/^(\$\d+)/)) { errors.push({ message: - `Parent of ${tag.name} not found. To document a destructuring\n` + + `Parent of ${ + tag.name + } not found. To document a destructuring\n` + `type, add a @param tag in its position to specify the name of the\n` + `destructured parameter`, commentLineNumber: tag.lineNumber diff --git a/yarn.lock b/yarn.lock index 75592aae5..8397899a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -107,6 +107,10 @@ ansi-styles@^3.1.0, ansi-styles@^3.2.0: dependencies: color-convert "^1.9.0" +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -118,6 +122,12 @@ app-root-path@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" +append-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + dependencies: + buffer-equal "^1.0.0" + append-transform@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" @@ -278,7 +288,7 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.26.0: +babel-core@^6.0.0, babel-core@^6.17.0, babel-core@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" dependencies: @@ -1000,12 +1010,9 @@ babel-types@^6.16.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.23 lodash "^4.17.4" to-fast-properties "^1.0.3" -babelify@^7.3.0: - version "7.3.0" - resolved "https://registry.yarnpkg.com/babelify/-/babelify-7.3.0.tgz#aa56aede7067fd7bd549666ee16dc285087e88e5" - dependencies: - babel-core "^6.0.14" - object-assign "^4.0.0" +babelify@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/babelify/-/babelify-8.0.0.tgz#6f60f5f062bfe7695754ef2403b842014a580ed3" babylon@^6.17.0, babylon@^6.17.2, babylon@^6.17.4, babylon@^6.18.0: version "6.18.0" @@ -1114,6 +1121,10 @@ bser@^2.0.0: dependencies: node-int64 "^0.4.0" +buffer-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" @@ -1311,18 +1322,10 @@ clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" -clone-stats@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - clone-stats@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" -clone@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" - clone@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" @@ -1577,7 +1580,7 @@ conventional-recommended-bump@^1.0.0: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.1, convert-source-map@^1.4.0, convert-source-map@^1.5.0: +convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -1593,18 +1596,14 @@ core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cosmiconfig@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-1.1.0.tgz#0dea0f9804efdfb929fbb1b188e25553ea053d37" +cosmiconfig@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-3.1.0.tgz#640a94bf9847f321800403cd273af60665c73397" dependencies: - graceful-fs "^4.1.2" - js-yaml "^3.4.3" - minimist "^1.2.0" - object-assign "^4.0.1" - os-homedir "^1.0.1" - parse-json "^2.2.0" - pinkie-promise "^2.0.0" - require-from-string "^1.1.0" + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^3.0.0" + require-from-string "^2.0.1" coveralls@^3.0.0: version "3.0.0" @@ -1646,14 +1645,13 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -cz-conventional-changelog@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.0.0.tgz#55a979afdfe95e7024879d2a0f5924630170b533" +cz-conventional-changelog@2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cz-conventional-changelog/-/cz-conventional-changelog-2.1.0.tgz#2f4bc7390e3244e4df293e6ba351e4c740a7c764" dependencies: conventional-commit-types "^2.0.0" lodash.map "^4.5.1" longest "^1.0.1" - pad-right "^0.2.2" right-pad "^1.0.1" word-wrap "^1.0.3" @@ -1686,7 +1684,7 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.3, debug@^2.6.8, debug@~2.6.7: dependencies: ms "2.0.0" -debug@^3.0.1: +debug@^3.0.1, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -1696,6 +1694,10 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1710,6 +1712,13 @@ default-require-extensions@^1.0.0: dependencies: strip-bom "^2.0.0" +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" @@ -1810,7 +1819,7 @@ duplexer2@^0.1.2, duplexer2@~0.1.0: dependencies: readable-stream "^2.0.2" -duplexify@^3.2.0: +duplexify@^3.1.2: version "3.5.1" resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.1.tgz#4e1516be68838bc90a49994f0b39a6e5960befcd" dependencies: @@ -1837,7 +1846,7 @@ elegant-spinner@^1.0.1: version "6.1.1" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" -end-of-stream@^1.0.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.0.tgz#7a90d833efda6cfa6eac0f4949dbb0fad3a63206" dependencies: @@ -1849,7 +1858,7 @@ errno@^0.1.4: dependencies: prr "~0.0.0" -error-ex@^1.2.0: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: @@ -2158,6 +2167,10 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -2171,10 +2184,6 @@ find-up@^2.0.0, find-up@^2.1.0: dependencies: locate-path "^2.0.0" -first-chunk-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" - flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -2184,9 +2193,16 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.56.0: - version "0.56.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.56.0.tgz#ce43092203a344ba9bf63c0cabe95d95145f6cad" +flow-bin@^0.61.0: + version "0.61.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.61.0.tgz#d0473a8c35dbbf4de573823f4932124397d32d35" + +flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417" + dependencies: + inherits "^2.0.1" + readable-stream "^2.0.4" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" @@ -2198,6 +2214,10 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -2230,6 +2250,13 @@ fs-extra@^4.0.2: jsonfile "^4.0.0" universalify "^0.1.0" +fs-mkdirp-stream@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + dependencies: + graceful-fs "^4.1.11" + through2 "^2.0.3" + fs-readdir-recursive@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" @@ -2262,6 +2289,10 @@ fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: mkdirp ">=0.5 0" rimraf "2" +function-bind@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -2395,36 +2426,28 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob-parent@^3.0.0: +glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-stream@^5.3.2: - version "5.3.5" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22" +glob-stream@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" dependencies: extend "^3.0.0" - glob "^5.0.3" - glob-parent "^3.0.0" - micromatch "^2.3.7" - ordered-read-streams "^0.3.0" - through2 "^0.6.0" - to-absolute-glob "^0.1.1" + glob "^7.1.1" + glob-parent "^3.1.0" + is-negated-glob "^1.0.0" + ordered-read-streams "^1.0.0" + pumpify "^1.3.5" + readable-stream "^2.1.5" + remove-trailing-separator "^1.0.1" + to-absolute-glob "^2.0.0" unique-stream "^2.0.2" -glob@^5.0.3: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^6.0.1: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -2473,16 +2496,6 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -gulp-sourcemaps@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" - dependencies: - convert-source-map "^1.1.1" - graceful-fs "^4.1.2" - strip-bom "^2.0.0" - through2 "^2.0.0" - vinyl "^1.0.0" - handlebars@^4.0.2, handlebars@^4.0.3: version "4.0.10" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" @@ -2692,7 +2705,7 @@ invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" -is-absolute@^0.2.3: +is-absolute@^0.2.3, is-absolute@^0.2.5: version "0.2.6" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-0.2.6.tgz#20de69f3db942ef2d87b9c2da36f172235b1b5eb" dependencies: @@ -2772,6 +2785,10 @@ is-descriptor@^1.0.0: is-data-descriptor "^0.1.4" kind-of "^5.0.0" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" @@ -2832,6 +2849,10 @@ is-hexadecimal@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.1.tgz#6e084bbc92061fbb0971ec58b6ce6d404e24da69" +is-negated-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -2848,6 +2869,12 @@ is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + is-odd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" @@ -2914,7 +2941,7 @@ is-ssh@^1.3.0: dependencies: protocols "^1.1.0" -is-stream@^1.0.1, is-stream@^1.1.0: +is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2938,13 +2965,13 @@ is-unc-path@^0.1.1: dependencies: unc-path-regex "^0.1.0" -is-utf8@^0.2.0: +is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -is-valid-glob@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-0.3.0.tgz#d4b55c69f51886f9b65c70d6c2622d37e29f48fe" +is-valid-glob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" is-whitespace-character@^1.0.0: version "1.0.1" @@ -2958,10 +2985,6 @@ is-word-character@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.1.tgz#5a03fa1ea91ace8a6eb0c7cd770eb86d65c8befb" -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -3276,16 +3299,16 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.4.3, js-yaml@^3.7.0, js-yaml@^3.8.4, js-yaml@^3.9.1: - version "3.9.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" +js-yaml@^3.6.1, js-yaml@^3.9.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.6.1: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" +js-yaml@^3.7.0, js-yaml@^3.8.4, js-yaml@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -3330,6 +3353,10 @@ jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" +json-parse-better-errors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -3421,6 +3448,12 @@ lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" +lead@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + dependencies: + flush-write-stream "^1.0.2" + leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -3432,22 +3465,28 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.2.3.tgz#5a1f12256af06110b96225f109dbf215009a37a9" +lint-staged@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.0.tgz#7ab7d345f2fe302ff196f1de6a005594ace03210" dependencies: app-root-path "^2.0.0" chalk "^2.1.0" - cosmiconfig "^1.1.0" + commander "^2.11.0" + cosmiconfig "^3.1.0" + debug "^3.1.0" + dedent "^0.7.0" execa "^0.8.0" + find-parent-dir "^0.3.0" is-glob "^4.0.0" jest-validate "^21.1.0" - listr "^0.12.0" + listr "^0.13.0" lodash "^4.17.4" log-symbols "^2.0.0" minimatch "^3.0.0" npm-which "^3.0.1" p-map "^1.1.1" + path-is-inside "^1.0.2" + pify "^3.0.0" staged-git-files "0.0.4" stringify-object "^3.2.0" @@ -3455,9 +3494,9 @@ listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" -listr-update-renderer@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9" +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -3477,25 +3516,26 @@ listr-verbose-renderer@^0.4.0: date-fns "^1.27.2" figures "^1.7.0" -listr@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" figures "^1.7.0" indent-string "^2.1.0" + is-observable "^0.2.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.2.0" + listr-update-renderer "^0.4.0" listr-verbose-renderer "^0.4.0" log-symbols "^1.0.2" log-update "^1.0.2" ora "^0.2.3" p-map "^1.1.1" - rxjs "^5.0.0-beta.11" - stream-to-observable "^0.1.0" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" strip-ansi "^3.0.1" livereload-js@^2.2.2: @@ -3521,6 +3561,15 @@ load-json-file@^2.0.0: pify "^2.0.0" strip-bom "^3.0.0" +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -3532,10 +3581,6 @@ lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" -lodash.isequal@^4.0.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - lodash.map@^4.5.1: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" @@ -3656,14 +3701,14 @@ mdast-util-inject@^1.1.0: dependencies: mdast-util-to-string "^1.0.0" -mdast-util-to-hast@^2.1.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-2.4.2.tgz#f116e8bf3da772ba5a397a92dab090f5ba91caa0" +mdast-util-to-hast@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-3.0.0.tgz#69e367fb2a9eb02474dfc017733b8fd272d55d3a" dependencies: collapse-white-space "^1.0.0" detab "^2.0.0" mdast-util-definitions "^1.2.0" - normalize-uri "^1.0.0" + mdurl "^1.0.1" trim "0.0.1" trim-lines "^1.0.0" unist-builder "^1.0.1" @@ -3684,6 +3729,10 @@ mdast-util-toc@^2.0.0: mdast-util-to-string "^1.0.2" unist-util-visit "^1.1.0" +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" @@ -3705,17 +3754,11 @@ meow@^3.3.0: redent "^1.0.0" trim-newlines "^1.0.0" -merge-stream@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - dependencies: - readable-stream "^2.0.1" - merge@^1.1.3: version "1.2.0" resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" -micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7: +micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -3794,7 +3837,7 @@ mixin-deep@^1.1.3: for-in "^1.0.2" is-extendable "^0.1.1" -"mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1: +"mkdirp@>=0.5 0", mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -3907,15 +3950,17 @@ normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" -normalize-path@^2.0.0, normalize-path@^2.0.1: +normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" dependencies: remove-trailing-separator "^1.0.1" -normalize-uri@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/normalize-uri/-/normalize-uri-1.1.0.tgz#01fb440c7fd059b9d9be8645aac14341efd059dd" +now-and-later@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.0.tgz#bc61cbb456d79cb32207ce47ca05136ff2e7d6ee" + dependencies: + once "^1.3.2" npm-path@^2.0.2: version "2.0.3" @@ -3962,7 +4007,7 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3974,12 +4019,24 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" +object-keys@^1.0.10, object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + object-visit@^0.3.4: version "0.3.4" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-0.3.4.tgz#ae15cf86f0b2fdd551771636448452c54c3da829" dependencies: isobject "^2.0.0" +object.assign@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.0" + object-keys "^1.0.10" + object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -3993,7 +4050,7 @@ object.pick@^1.2.0: dependencies: isobject "^2.1.0" -once@^1.3.0, once@^1.3.3, once@^1.4.0: +once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -4036,14 +4093,13 @@ ora@^0.2.3: cli-spinners "^0.1.2" object-assign "^4.0.1" -ordered-read-streams@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" +ordered-read-streams@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" dependencies: - is-stream "^1.0.1" readable-stream "^2.0.1" -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -4108,12 +4164,6 @@ p-timeout@^1.1.1: dependencies: p-finally "^1.0.0" -pad-right@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" - dependencies: - repeat-string "^1.5.2" - parents@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" @@ -4164,6 +4214,19 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-json@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-3.0.0.tgz#fa6f47b18e23826ead32f263e744d0e1e847fb13" + dependencies: + error-ex "^1.3.1" + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + parse-url@^1.3.0: version "1.3.11" resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-1.3.11.tgz#57c15428ab8a892b1f43869645c711d0e144b554" @@ -4237,6 +4300,12 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" @@ -4314,6 +4383,21 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +pumpify@^1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.5.tgz#1b671c619940abcaeac0ad0e3a3c164be760993b" + dependencies: + duplexify "^3.1.2" + inherits "^2.0.1" + pump "^1.0.0" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -4367,6 +4451,13 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^2.0.0" +read-pkg-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -4383,14 +4474,13 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -"readable-stream@>=1.0.33-1 <1.1.0-0": - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.3.3" @@ -4504,13 +4594,13 @@ regjsparser@^0.1.4: dependencies: jsesc "~0.5.0" -remark-html@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-6.0.1.tgz#5094d2c71f7941fdb2ae865bac76627757ce09c1" +remark-html@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-7.0.0.tgz#d13dc1ba9352e257fce8800c42c7690d9e3690c8" dependencies: hast-util-sanitize "^1.0.0" hast-util-to-html "^3.0.0" - mdast-util-to-hast "^2.1.1" + mdast-util-to-hast "^3.0.0" xtend "^4.0.1" remark-parse@^4.0.0: @@ -4581,6 +4671,21 @@ remote-origin-url@0.4.0: dependencies: parse-git-config "^0.2.0" +remove-bom-buffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" + dependencies: + is-buffer "^1.1.5" + is-utf8 "^0.2.1" + +remove-bom-stream@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + dependencies: + remove-bom-buffer "^3.0.0" + safe-buffer "^5.1.0" + through2 "^2.0.3" + remove-trailing-separator@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" @@ -4599,10 +4704,6 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - replace-ext@1.0.0, replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" @@ -4638,9 +4739,9 @@ require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" -require-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" +require-from-string@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" require-main-filename@^1.0.1: version "1.0.1" @@ -4657,6 +4758,12 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-options@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + dependencies: + value-or-function "^3.0.0" + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -4717,13 +4824,13 @@ rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" -rxjs@^5.0.0-beta.11: - version "5.4.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.3.tgz#0758cddee6033d68e0fd53676f0f3596ce3d483f" +rxjs@^5.4.2: + version "5.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.5.tgz#e164f11d38eaf29f56f08c3447f74ff02dd84e97" dependencies: - symbol-observable "^1.0.1" + symbol-observable "1.0.1" -safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -4978,9 +5085,11 @@ stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" -stream-to-observable@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" string-length@^2.0.0: version "2.0.0" @@ -5051,13 +5160,6 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" -strip-bom-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" - dependencies: - first-chunk-stream "^1.0.0" - strip-bom "^2.0.0" - strip-bom@3.0.0, strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -5108,9 +5210,13 @@ supports-color@^4.0.0, supports-color@^4.1.0: dependencies: has-flag "^2.0.0" -symbol-observable@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" symbol-tree@^3.2.1: version "3.2.2" @@ -5177,14 +5283,7 @@ through2-filter@^2.0.0: through2 "~2.0.0" xtend "~4.0.0" -through2@^0.6.0: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - -through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@~2.0.0: +through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@^2.0.3, through2@~2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -5222,11 +5321,13 @@ tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" -to-absolute-glob@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" +to-absolute-glob@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.1.tgz#70c375805b9e3105e899ee8dbdd6a9aa108f407b" dependencies: extend-shallow "^2.0.1" + is-absolute "^0.2.5" + is-negated-glob "^1.0.0" to-fast-properties@^1.0.3: version "1.0.3" @@ -5261,6 +5362,12 @@ to-regex@^3.0.1: extend-shallow "^2.0.1" regex-not "^1.0.0" +to-through@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + dependencies: + through2 "^2.0.3" + tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" @@ -5458,10 +5565,6 @@ v8flags@^2.1.1: dependencies: user-home "^1.1.1" -vali-date@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" @@ -5469,6 +5572,10 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" +value-or-function@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -5507,35 +5614,39 @@ vfile@^2.0.0: replace-ext "1.0.0" unist-util-stringify-position "^1.0.0" -vinyl-fs@^2.3.1: - version "2.4.4" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239" +vinyl-fs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.0.tgz#ce34592b90c0338bda2d5c121566973651f90c23" dependencies: - duplexify "^3.2.0" - glob-stream "^5.3.2" + flush-write-stream "^1.0.0" + fs-mkdirp-stream "^1.0.0" + glob-stream "^6.1.0" graceful-fs "^4.0.0" - gulp-sourcemaps "1.6.0" - is-valid-glob "^0.3.0" + is-valid-glob "^1.0.0" lazystream "^1.0.0" - lodash.isequal "^4.0.0" - merge-stream "^1.0.0" - mkdirp "^0.5.0" - object-assign "^4.0.0" - readable-stream "^2.0.4" - strip-bom "^2.0.0" - strip-bom-stream "^1.0.0" + lead "^1.0.0" + object.assign "^4.0.4" + pumpify "^1.3.5" + remove-bom-buffer "^3.0.0" + remove-bom-stream "^1.2.0" + resolve-options "^1.1.0" through2 "^2.0.0" - through2-filter "^2.0.0" - vali-date "^1.0.0" - vinyl "^1.0.0" + to-through "^2.0.0" + value-or-function "^3.0.0" + vinyl "^2.0.0" + vinyl-sourcemap "^1.1.0" -vinyl@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" +vinyl-sourcemap@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" + append-buffer "^1.0.2" + convert-source-map "^1.5.0" + graceful-fs "^4.1.6" + normalize-path "^2.1.1" + now-and-later "^2.0.0" + remove-bom-buffer "^3.0.0" + vinyl "^2.0.0" vinyl@^2.0.0: version "2.1.0" @@ -5672,7 +5783,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 74bbbf72ae2ade513dfb2bcad5771eb0b6e6c05d Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 11 Dec 2017 16:47:55 -0800 Subject: [PATCH 168/555] chore(release): 5.3.4 --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2186e4ff..6ce6d78ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [5.3.4](https://github.com/documentationjs/documentation/compare/v5.3.3...v5.3.4) (2017-12-12) + + +### Bug Fixes + +* **package:** update babelify to version 8.0.0 ([10dff6f](https://github.com/documentationjs/documentation/commit/10dff6f)) +* **package:** update read-pkg-up to version 3.0.0 ([d8fbf2c](https://github.com/documentationjs/documentation/commit/d8fbf2c)) +* **package:** update remark-html to version 7.0.0 ([9842814](https://github.com/documentationjs/documentation/commit/9842814)) +* **package:** update vinyl-fs to version 3.0.0 ([#966](https://github.com/documentationjs/documentation/issues/966)) ([1d6fe80](https://github.com/documentationjs/documentation/commit/1d6fe80)) + + + ## [5.3.3](https://github.com/documentationjs/documentation/compare/v5.3.2...v5.3.3) (2017-10-12) diff --git a/package.json b/package.json index f57a3e767..791244c22 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "documentation", "description": "a documentation generator", - "version": "5.3.3", + "version": "5.3.4", "author": "Tom MacWright", "bin": { "documentation": "./bin/documentation.js" From aa661ffcbf0692ea2cb58a6c731e21d72957796f Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Mon, 11 Dec 2017 17:04:28 -0800 Subject: [PATCH 169/555] fix(globals-docs): Remove en-US from MDN links. (#973) This allows the Mozilla Developer Network to infer the user language. Fix #964 --- __tests__/__snapshots__/bin-readme.js.snap | 4 +- __tests__/__snapshots__/bin.js.snap | 82 +-- __tests__/__snapshots__/test.js.snap | 548 ++++++++++----------- __tests__/format_type.js | 28 +- __tests__/linker.js | 2 +- docs/NODE_API.md | 56 +-- package.json | 2 +- yarn.lock | 6 +- 8 files changed, 364 insertions(+), 364 deletions(-) diff --git a/__tests__/__snapshots__/bin-readme.js.snap b/__tests__/__snapshots__/bin-readme.js.snap index 51a2612a5..2398500d2 100644 --- a/__tests__/__snapshots__/bin-readme.js.snap +++ b/__tests__/__snapshots__/bin-readme.js.snap @@ -20,7 +20,7 @@ A function with documentation. - \`a\` {string} blah -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer ## bar @@ -54,7 +54,7 @@ A function with documentation. - \`a\` {string} blah -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer ## bar diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index f08664070..df2e03a29 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -5,7 +5,7 @@ exports[`--config 1`] = ` - documentation 5.3.3 | Documentation + documentation 5.3.4 | Documentation @@ -17,7 +17,7 @@ exports[`--config 1`] = `

    documentation

    -
    5.3.3
    +
    5.3.4
    Klass This is a [link to something that does not exist]DoesNot

    -
    isClass(other: Object, also: any): boolean
    +
    isClass(other: Object, also: any): boolean
    @@ -351,7 +351,7 @@ This is a [link to something that does not exist]DoesNot @@ -373,7 +373,7 @@ This is a [link to something that does not exist]DoesNotReturns
    - boolean: + boolean: whether the other thing is a Klass @@ -410,7 +410,7 @@ This is a [link to something that does not exist]DoesNot - +
    isWeird(other: Weird): boolean
    @@ -441,7 +441,7 @@ the referenced class type

    Returns
    - boolean: + boolean: whether the other thing is a Klass @@ -477,7 +477,7 @@ the referenced class type

    This method takes a Buffer object that will be linked to nodejs.org

    -
    isBuffer(buf: (Buffer | string), size: number): boolean
    +
    isBuffer(buf: (Buffer | string), size: number): boolean
    @@ -494,7 +494,7 @@ the referenced class type

    - buf ((Buffer | string)) + buf ((Buffer | string))
    @@ -502,7 +502,7 @@ the referenced class type

    - size (number + size (number = 0) size @@ -518,7 +518,7 @@ the referenced class type

    Returns
    - boolean: + boolean: whether the other thing is a Klass @@ -554,7 +554,7 @@ the referenced class type

    This method takes an array of buffers and counts them

    -
    isArrayOfBuffers(buffers: Array<Buffer>): number
    +
    isArrayOfBuffers(buffers: Array<Buffer>): number
    @@ -571,7 +571,7 @@ the referenced class type

    - buffers (Array<Buffer>) + buffers (Array<Buffer>) some buffers
    @@ -586,7 +586,7 @@ the referenced class type

    Returns
    - number: + number: how many @@ -683,7 +683,7 @@ k.isArrayOfBuffers();

    Get this Klass's foo

    -
    getFoo(): Number
    +
    getFoo(): Number
    @@ -701,7 +701,7 @@ k.isArrayOfBuffers();
    Returns
    - Number: + Number: foo @@ -744,7 +744,7 @@ k.isArrayOfBuffers();

    A function with an options parameter

    -
    withOptions(options: Object, otherOptions: number?)
    +
    withOptions(options: Object, otherOptions: number?)
    @@ -761,7 +761,7 @@ k.isArrayOfBuffers();
    - options (Object) + options (Object)
    @@ -779,7 +779,7 @@ k.isArrayOfBuffers(); - options.foo string + options.foo string @@ -787,7 +787,7 @@ k.isArrayOfBuffers(); - options.bar number + options.bar number @@ -801,7 +801,7 @@ k.isArrayOfBuffers();
    - otherOptions (number?) + otherOptions (number?)
    @@ -843,7 +843,7 @@ k.isArrayOfBuffers();

    A function with a deep options parameter

    -
    withDeepOptions(options: Object)
    +
    withDeepOptions(options: Object)
    @@ -860,7 +860,7 @@ k.isArrayOfBuffers();
    - options (Object) + options (Object)
    @@ -878,7 +878,7 @@ k.isArrayOfBuffers(); - options.foo string + options.foo string @@ -886,14 +886,14 @@ k.isArrayOfBuffers(); - options.bar Object + options.bar Object - options.bar.buz string + options.bar.buz string @@ -1025,18 +1025,18 @@ k.isArrayOfBuffers();
    - error (object) + error (object) : An error