Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}, async report => {
// Not an error if --tolerate-republish is set
if (this.tolerateRepublish) {
try {
const registryData = await npmHttpUtils.get(npmHttpUtils.getIdentUrl(ident), {
configuration,
registry,
ident,
json: true,
});
if (!Object.prototype.hasOwnProperty.call(registryData, `versions`))
throw new ReportError(MessageName.REMOTE_INVALID, `Registry returned invalid data for - missing "versions" field`);
if (Object.prototype.hasOwnProperty.call(registryData.versions, version)) {
report.reportWarning(MessageName.UNNAMED, `Registry already knows about version ${version}; skipping.`);
return;
}
} catch (error) {
if (error.name !== `HTTPError`) {
throw error;