scripts/build-rpc-markdown.js
function hasExample ({ optional, example, details } = {}) {
  if (optional || example !== undefined) {
    return true;
  }

  if (details !== undefined) {
    const values = Object.keys(details).map((key) => details[key]);

    return values.every(hasExample);
  }

  return false;
}
function hasExample ({ optional, example, details } = {}) {
  if (optional || example !== undefined) {
    return true;
  }

  if (details !== undefined) {
    const values = Object.keys(details).map((key) => details[key]);

    return values.every(hasExample);
  }

  return false;
}
function hasExample ( { optional , example , details } = { } ) { if ( optional || example !== undefined ) { return true ; } if ( details !== undefined ) { const values = Object . keys ( details ) . map ( ( key ) => details [ key ] ) ; return values . every ( hasExample ) ; } return false ; }
Checks if a field definition has an example, or describes an object with fields that recursively have examples of their own, or is optional.
Checks if a field definition has an example or describes an object with fields that recursively have examples of their own or is optional .