diff --git a/__tests__/__snapshots__/bin-readme.js.snap b/__tests__/__snapshots__/bin-readme.js.snap index f82e9545f..db4a10de3 100644 --- a/__tests__/__snapshots__/bin-readme.js.snap +++ b/__tests__/__snapshots__/bin-readme.js.snap @@ -36,6 +36,42 @@ A second function with docs " `; +exports[`readme command --diff-only: changes needed 1`] = ` +"# A title + +# API + + + +### Table of Contents + +- [foo](#foo) + - [Parameters](#parameters) +- [bar](#bar) + - [Parameters](#parameters-1) + +## foo + +A function with documentation. + +### Parameters + +- \`a\` {string} blah + +Returns **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer + +## bar + +A second function with docs + +### Parameters + +- \`b\` + +# Another section +" +`; + exports[`readme command --readme-file 1`] = ` "# A title diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap index 66be7220d..fb38152ea 100644 --- a/__tests__/__snapshots__/test.js.snap +++ b/__tests__/__snapshots__/test.js.snap @@ -22680,7 +22680,7 @@ Array [ "static": Array [], }, "name": "getFoo", - "namespace": "MyClass#getFoo", + "namespace": ".MyClass#getFoo", "params": Array [ Object { "description": Object { @@ -22748,6 +22748,7 @@ Array [ Object { "kind": "class", "name": "MyClass", + "scope": "static", }, Object { "kind": "function", @@ -22933,12 +22934,13 @@ Array [ "static": Array [], }, "name": "getUndefined", - "namespace": "MyClass.getUndefined", + "namespace": ".MyClass.getUndefined", "params": Array [], "path": Array [ Object { "kind": "class", "name": "MyClass", + "scope": "static", }, Object { "kind": "function", @@ -23025,12 +23027,13 @@ Array [ ], }, "name": "MyClass", - "namespace": "MyClass", + "namespace": ".MyClass", "params": Array [], "path": Array [ Object { "kind": "class", "name": "MyClass", + "scope": "static", }, ], "properties": Array [], diff --git a/__tests__/lib/hierarchy.js b/__tests__/lib/hierarchy.js index de763e929..33b99291e 100644 --- a/__tests__/lib/hierarchy.js +++ b/__tests__/lib/hierarchy.js @@ -184,3 +184,19 @@ test('hierarchy - object prototype member names', function() { 'otherMethod' ]); }); + +test('hierarchy - member namespace defaults to static', function() { + const comments = evaluate(function() { + /** + * @namespace fooNamespace + */ + /** + * @class BarClass + * @memberof fooNamespace + */ + }); + + expect(comments[0].members.static[0].namespace).toEqual( + 'fooNamespace.BarClass' + ); +}); diff --git a/src/hierarchy.js b/src/hierarchy.js index ab94adf8e..dd0cbd8ec 100644 --- a/src/hierarchy.js +++ b/src/hierarchy.js @@ -39,6 +39,8 @@ function pick(comment) { if (comment.scope) { item.scope = comment.scope; + } else if (comment.memberof) { + item.scope = 'static'; } return item; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy