(pkg, status)
| 166 | } |
| 167 | |
| 168 | async #setStatus (pkg, status) { |
| 169 | // only scoped packages can have their access changed |
| 170 | const pkgName = await this.#getPackage(pkg, true) |
| 171 | if (status === 'private') { |
| 172 | status = 'restricted' |
| 173 | } |
| 174 | await otplease(this.npm, this.npm.flatOptions, (opts) => { |
| 175 | return libnpmaccess.setAccess(pkgName, status, opts) |
| 176 | }) |
| 177 | return this.#getStatus(pkgName) |
| 178 | } |
| 179 | |
| 180 | async #getPackage (name, requireScope) { |
| 181 | if (!name) { |
no test coverage detected