Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-registry-fetch

Package Overview
Dependencies
Maintainers
2
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-fetch - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="3.5.0"></a>
# [3.5.0](https://github.com/npm/registry-fetch/compare/v3.4.0...v3.5.0) (2018-08-22)
### Features
* **pkgid:** heuristic pkgid calculation for errors ([2e789a5](https://github.com/npm/registry-fetch/commit/2e789a5))
<a name="3.4.0"></a>

@@ -7,0 +17,0 @@ # [3.4.0](https://github.com/npm/registry-fetch/compare/v3.3.0...v3.4.0) (2018-08-22)

'use strict'
const url = require('url')
function packageName (href) {
try {
let basePath = url.parse(href).pathname.substr(1)
if (!basePath.match(/^-/)) {
basePath = basePath.split('/')
var index = basePath.indexOf('_rewrite')
if (index === -1) {
index = basePath.length - 1
} else {
index++
}
return decodeURIComponent(basePath[index])
}
} catch (_) {
// this is ok
}
}
class HttpErrorBase extends Error {

@@ -12,2 +32,3 @@ constructor (method, res, body, spec) {

this.body = body
this.pkgid = spec ? spec.toString() : packageName(res.url)
}

@@ -14,0 +35,0 @@ }

2

package.json
{
"name": "npm-registry-fetch",
"version": "3.4.0",
"version": "3.5.0",
"description": "Fetch-based http client for use with npm registry APIs",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc