Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentReadmes.forEach(async path => {
const scope = path.match(/\/packages\/([a-z]+)\//)[1]
const name = path.match(/\/([a-z\-]+)\/readme.md/)[1]
if (!Array.isArray(sidebar[scope])) sidebar[scope] = []
sidebar[scope].push(name)
await fs.copy(path, `components/${scope}/${name}.md`)
})