How to use the gatsby-transformer-react-docgen/Doclets.cleanDoclets function in gatsby-transformer-react-docgen

To help you get started, we’ve selected a few gatsby-transformer-react-docgen examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jquense / react-widgets / www / gatsby-config.js View on Github external
let typeName = type && type.raw &&
  type.raw.replace('CustomPropTypes.', '');

  if (type && type.name === 'shape' && type.value) {
    Object.keys(type.value).forEach((key) => {
      type.value[key] = setDefaults({ type: type.value[key] }, key, widgetName).type
    })
  }

  if (defaultTypes[typeName]) {
    desc.type = Object.assign({}, type, defaultTypes[typeName]);
  }

  if (defaultDescriptions[name]) {
    let dft = defaultDescriptions[name]
    if (!cleanDoclets(desc.description)) {
      desc.description = dft({ name: widgetName }) + '\n' + desc.description || '';
    }
  }

  return desc
}

gatsby-transformer-react-docgen

Expose React component metadata and prop information as GraphQL types

MIT
Latest version published 15 days ago

Package Health Score

84 / 100
Full package analysis