@pnpm/dependency-path
Advanced tools
Comparing version 3.0.0 to 4.0.0
@@ -20,3 +20,3 @@ import { type Registries } from '@pnpm/types'; | ||
export declare function parse(dependencyPath: string): DependencyPath; | ||
export declare function depPathToFilename(depPath: string): string; | ||
export declare function depPathToFilename(depPath: string, maxLengthWithoutHash: number): string; | ||
export type PeerId = { | ||
@@ -23,0 +23,0 @@ name: string; |
@@ -126,4 +126,3 @@ "use strict"; | ||
exports.parse = parse; | ||
const MAX_LENGTH_WITHOUT_HASH = 120 - 26 - 1; | ||
function depPathToFilename(depPath) { | ||
function depPathToFilename(depPath, maxLengthWithoutHash) { | ||
let filename = depPathToFilenameUnescaped(depPath).replace(/[\\/:*?"<>|]/g, '+'); | ||
@@ -135,4 +134,4 @@ if (filename.includes('(')) { | ||
} | ||
if (filename.length > 120 || filename !== filename.toLowerCase() && !filename.startsWith('file+')) { | ||
return `${filename.substring(0, MAX_LENGTH_WITHOUT_HASH)}_${(0, crypto_base32_hash_1.createBase32Hash)(filename)}`; | ||
if (filename.length > maxLengthWithoutHash || filename !== filename.toLowerCase() && !filename.startsWith('file+')) { | ||
return `${filename.substring(0, maxLengthWithoutHash - 27)}_${(0, crypto_base32_hash_1.createBase32Hash)(filename)}`; | ||
} | ||
@@ -139,0 +138,0 @@ return filename; |
{ | ||
"name": "@pnpm/dependency-path", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Utilities for working with symlinked node_modules", | ||
@@ -33,3 +33,3 @@ "main": "lib/index.js", | ||
"@types/semver": "7.5.3", | ||
"@pnpm/dependency-path": "3.0.0" | ||
"@pnpm/dependency-path": "4.0.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "funding": "https://opencollective.com/pnpm", |
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
15826
188