How to use the veui/components.json.find function in veui

To help you get started, we’ve selected a few veui 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 ecomfe / veui / packages / veui-loader / src / index.js View on Github external
function getComponentName (componentPath) {
  if (!componentPath) {
    return null
  }
  let component = COMPONENTS.find(({ path }) => {
    path = normalize(path)
    return path === componentPath || path.split('.')[0] === componentPath
  })

  return component ? component.name : null
}
github ecomfe / veui / packages / babel-plugin-veui / src / index.js View on Github external
function getComponentPath (componentName) {
  let entry = COMPONENTS.find(({ name }) => name === componentName)
  if (!entry) {
    return null
  }
  return `veui/${COMPONENTS_DIRNAME}/${entry.path}`
}