woocommerce/plugins/woocommerce-blocks/bin/hook-docs/format-hook-doc/exceptions.js

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 };