@pnpm/pkgid-to-filename
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4376
12
10