(name, requireScope)
| 178 | } |
| 179 | |
| 180 | async #getPackage (name, requireScope) { |
| 181 | if (!name) { |
| 182 | try { |
| 183 | const { content } = await pkgJson.normalize(this.npm.prefix) |
| 184 | name = content.name |
| 185 | } catch (err) { |
| 186 | if (err.code === 'ENOENT') { |
| 187 | throw Object.assign(new Error('no package name given and no package.json found'), { |
| 188 | code: 'ENOENT', |
| 189 | }) |
| 190 | } else { |
| 191 | throw err |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | const spec = npa(name) |
| 197 | if (requireScope && !spec.scope) { |
| 198 | throw this.usageError('This command is only available for scoped packages.') |
| 199 | } |
| 200 | return name |
| 201 | } |
| 202 | |
| 203 | #output (items, limiter) { |
| 204 | const outputs = {} |
no test coverage detected