diff --git a/src/components/FunctionDefinition.js b/src/components/FunctionDefinition.js index 395b866e2..e6dcc6cac 100644 --- a/src/components/FunctionDefinition.js +++ b/src/components/FunctionDefinition.js @@ -4,7 +4,12 @@ import CodeDef from './CodeDef'; import { graphql } from 'gatsby'; const FunctionDefinition = ({ className, arguments: params, returnValue }) => { - if (!params.length && !returnValue && !returnValue.length) { + const hasParams = params.length; + const isReturnArray = Array.isArray(returnValue); + const hasReturn = + (isReturnArray && returnValue.length) || (!isReturnArray && returnValue); + + if (!hasParams && !hasReturn) { return null; }