(importPath: string)
| 1682 | } |
| 1683 | |
| 1684 | export function getNpmPackageName(importPath: string): string | null { |
| 1685 | const parts = importPath.split('/') |
| 1686 | if (parts[0][0] === '@') { |
| 1687 | if (!parts[1]) return null |
| 1688 | return `${parts[0]}/${parts[1]}` |
| 1689 | } else { |
| 1690 | return parts[0] |
| 1691 | } |
| 1692 | } |
| 1693 | |
| 1694 | export function getPkgName(name: string): string | undefined { |
| 1695 | return name[0] === '@' ? name.split('/')[1] : name |
no outgoing calls
no test coverage detected