Socket
Book a DemoSign in
Socket

custompatch

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

custompatch - npm Package Compare versions

Comparing version
1.0.21
to
1.0.22
+34
-1
index.js

@@ -156,2 +156,32 @@ #!/usr/bin/env node

// build a tarball URL for the given package version
function npmTarballURL(pkgName, pkgVersion, registryURL)
{
let registry;
if (registryURL)
{
registry = registryURL.endsWith('/') ? registryURL : registryURL + '/';
}
else
{
registry = 'https://registry.npmjs.org/';
}
const scopelessName = getScopelessName(pkgName);
return `${registry}${pkgName}/-/${scopelessName}-${removeBuildMetadataFromVersion(pkgVersion)}.tgz`;
}
function removeBuildMetadataFromVersion (version)
{
const plusPos = version.indexOf('+');
if (plusPos === -1) return version;
return version.substring(0, plusPos);
}
function getScopelessName (name)
{
if (name[0] !== '@') return name;
return name.split('/')[1];
}
// build a patch for the given package

@@ -162,3 +192,6 @@ function makePatch(pkgName)

const cfg = getConfig(pkgName);
if(cfg && cfg._resolved !== '') fetchPackage(pkgName, cfg._resolved, cfg.version, comparePackages);
if(cfg)
{
fetchPackage(pkgName, npmTarballURL(pkgName, cfg.version), cfg.version, comparePackages);
}
else

@@ -165,0 +198,0 @@ {

+1
-1
{
"name": "custompatch",
"version": "1.0.21",
"version": "1.0.22",
"description": "Tool for patching buggy NPM packages instead of forking them",

@@ -5,0 +5,0 @@ "author": "IVO GELOV",