chore(doclint): exclude constructors by default (#938)

Our API does not expose any classes; thus all the constructors
should be excluded from the API.
This commit is contained in:
Andrey Lushnikov 2017-10-02 14:28:51 -07:00 committed by GitHub
parent 6c9a99477b
commit 017429eef1

View File

@ -35,22 +35,8 @@ const EXCLUDE_CLASSES = new Set([
]);
const EXCLUDE_METHODS = new Set([
'Body.constructor',
'Browser.constructor',
'ConsoleMessage.constructor',
'Dialog.constructor',
'ElementHandle.constructor',
'Frame.constructor',
'Headers.constructor',
'Headers.fromPayload',
'Keyboard.constructor',
'Mouse.constructor',
'Touchscreen.constructor',
'Tracing.constructor',
'Page.constructor',
'Page.create',
'Request.constructor',
'Response.constructor',
]);
/**
@ -145,6 +131,9 @@ function filterJSDocumentation(jsDocumentation) {
const members = cls.membersArray.filter(member => {
if (member.name.startsWith('_'))
return false;
// Exclude all constructors by default.
if (member.name === 'constructor' && member.type === 'method')
return false;
return !EXCLUDE_METHODS.has(`${cls.name}.${member.name}`);
});
classes.push(new Documentation.Class(cls.name, members));