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

@pnpm/pkgid-to-filename

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/pkgid-to-filename - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

2

lib/index.d.ts

@@ -1,1 +0,1 @@

export default function pkgIdToFilename(pkgId: string): string;
export default function pkgIdToFilename(pkgId: string, prefix: string): string;

@@ -5,8 +5,9 @@ "use strict";

const path = require("path");
function pkgIdToFilename(pkgId) {
function pkgIdToFilename(pkgId, prefix) {
if (pkgId.indexOf('file:') !== 0)
return pkgId;
return `local/${encodeURIComponent(normalize(path.resolve(pkgId.slice(5))))}`;
const absolutePath = path.join(prefix, pkgId.slice(5));
return `local/${encodeURIComponent(normalize(absolutePath))}`;
}
exports.default = pkgIdToFilename;
//# sourceMappingURL=index.js.map
{
"name": "@pnpm/pkgid-to-filename",
"version": "1.0.1",
"version": "2.0.0",
"description": "Converts a package ID to a valid file name",

@@ -11,3 +11,3 @@ "main": "lib/index.js",

"engines": {
"node": ">=4"
"node": ">=6"
},

@@ -41,2 +41,3 @@ "scripts": {

"devDependencies": {
"@types/node": "^10.9.4",
"@types/tape": "^4.2.31",

@@ -48,5 +49,5 @@ "mos": "^2.0.0-alpha.3",

"tape": "^4.8.0",
"ts-node": "^6.0.0",
"ts-node": "^7.0.0",
"tslint": "^5.8.0",
"typescript": "^2.6.1"
"typescript": "^3.0.0"
},

@@ -53,0 +54,0 @@ "mos": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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