@wordpress/docgen 1.23.0 → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -1
- package/lib/is-symbol-ignore.js +17 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const { last } = require( 'lodash' );
|
|
|
11
11
|
const engine = require( './engine' );
|
|
12
12
|
const defaultMarkdownFormatter = require( './markdown' );
|
|
13
13
|
const isSymbolPrivate = require( './is-symbol-private' );
|
|
14
|
+
const isSymbolIgnore = require( './is-symbol-ignore' );
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Helpers functions.
|
|
@@ -119,7 +120,7 @@ module.exports = ( sourceFile, options ) => {
|
|
|
119
120
|
// Process.
|
|
120
121
|
const result = processFile( processDir, sourceFile );
|
|
121
122
|
const filteredIR = result.ir.filter( ( symbol ) => {
|
|
122
|
-
if ( isSymbolPrivate( symbol ) ) {
|
|
123
|
+
if ( isSymbolPrivate( symbol ) || isSymbolIgnore( symbol ) ) {
|
|
123
124
|
return false;
|
|
124
125
|
}
|
|
125
126
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
const getSymbolTagsByName = require( './get-symbol-tags-by-name' );
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns true if, given a symbol object, it contains a @ignore tag, or false
|
|
8
|
+
* otherwise.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} symbol Symbol object.
|
|
11
|
+
*
|
|
12
|
+
* @return {boolean} Whether symbol is private.
|
|
13
|
+
*/
|
|
14
|
+
const isSymbolIgnore = ( symbol ) =>
|
|
15
|
+
getSymbolTagsByName( symbol, 'ignore' ).length > 0;
|
|
16
|
+
|
|
17
|
+
module.exports = isSymbolIgnore;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/docgen",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Autogenerate public API documentation from exports and JSDoc comments.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "9d9d33bbdf317a4381b8ca1713e43bb50df653b3"
|
|
43
43
|
}
|