17 lines
331 B
JavaScript
17 lines
331 B
JavaScript
const exceptions = ( hookDoc ) => {
|
|
const tags = hookDoc.tags || [];
|
|
const throwsDoc =
|
|
tags.filter( ( { name: tagName } ) => tagName === 'throws' )[ 0 ] ||
|
|
undefined;
|
|
|
|
return throwsDoc
|
|
? {
|
|
p: `\`${ throwsDoc.types.join( ', ' ) }\` ${
|
|
throwsDoc.content
|
|
}`,
|
|
}
|
|
: null;
|
|
};
|
|
|
|
module.exports = { exceptions };
|