@pnpm/lockfile.utils 1100.0.10 → 1100.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/toLockfileResolution.js +8 -3
- package/package.json +11 -8
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export { packageIdFromSnapshot } from './packageIdFromSnapshot.js';
|
|
|
4
4
|
export { packageIsIndependent } from './packageIsIndependent.js';
|
|
5
5
|
export { pkgSnapshotToResolution } from './pkgSnapshotToResolution.js';
|
|
6
6
|
export { refIsLocalDirectory, refIsLocalTarball } from './refIsLocalTarball.js';
|
|
7
|
-
export { toLockfileResolution } from './toLockfileResolution.js';
|
|
7
|
+
export { isGitHostedTarballUrl, toLockfileResolution } from './toLockfileResolution.js';
|
|
8
8
|
export * from '@pnpm/lockfile.types';
|
|
9
9
|
export declare const getPkgShortId: typeof refToRelative;
|
package/lib/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { packageIdFromSnapshot } from './packageIdFromSnapshot.js';
|
|
|
4
4
|
export { packageIsIndependent } from './packageIsIndependent.js';
|
|
5
5
|
export { pkgSnapshotToResolution } from './pkgSnapshotToResolution.js';
|
|
6
6
|
export { refIsLocalDirectory, refIsLocalTarball } from './refIsLocalTarball.js';
|
|
7
|
-
export { toLockfileResolution } from './toLockfileResolution.js';
|
|
7
|
+
export { isGitHostedTarballUrl, toLockfileResolution } from './toLockfileResolution.js';
|
|
8
8
|
export * from '@pnpm/lockfile.types';
|
|
9
9
|
// for backward compatibility
|
|
10
10
|
export const getPkgShortId = refToRelative;
|
|
@@ -59,9 +59,14 @@ function preservingGitHosted(resolution, gitHosted) {
|
|
|
59
59
|
// dep graph. Used as a fallback when callers haven't pre-set the
|
|
60
60
|
// `gitHosted` field on TarballResolution.
|
|
61
61
|
export function isGitHostedTarballUrl(url) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
// Schemes and hostnames are case-insensitive, so match against a lowercased
|
|
63
|
+
// copy: a tampered `https://CODELOAD.GITHUB.COM/...` must not slip past as a
|
|
64
|
+
// non-git-hosted (and therefore registry-trusted) tarball. Only the
|
|
65
|
+
// lowercased copy is inspected; the original URL is never rewritten.
|
|
66
|
+
const lowerUrl = url.toLowerCase();
|
|
67
|
+
return (lowerUrl.startsWith('https://codeload.github.com/') ||
|
|
68
|
+
lowerUrl.startsWith('https://bitbucket.org/') ||
|
|
69
|
+
lowerUrl.startsWith('https://gitlab.com/')) && lowerUrl.includes('tar.gz');
|
|
65
70
|
}
|
|
66
71
|
function removeProtocol(url) {
|
|
67
72
|
return url.split('://')[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/lockfile.utils",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.12",
|
|
4
4
|
"description": "Utils for dealing with pnpm-lock.yaml",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"funding": "https://opencollective.com/pnpm",
|
|
13
|
-
"repository":
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/pnpm/pnpm/tree/main/lockfile/utils"
|
|
16
|
+
},
|
|
14
17
|
"homepage": "https://github.com/pnpm/pnpm/tree/main/lockfile/utils#readme",
|
|
15
18
|
"bugs": {
|
|
16
19
|
"url": "https://github.com/pnpm/pnpm/issues"
|
|
@@ -28,11 +31,11 @@
|
|
|
28
31
|
"dependencies": {
|
|
29
32
|
"get-npm-tarball-url": "^2.1.0",
|
|
30
33
|
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
31
|
-
"@pnpm/deps.path": "1100.0.
|
|
32
|
-
"@pnpm/lockfile.types": "1100.0.
|
|
33
|
-
"@pnpm/
|
|
34
|
-
"@pnpm/types": "1101.
|
|
35
|
-
"@pnpm/
|
|
34
|
+
"@pnpm/deps.path": "1100.0.7",
|
|
35
|
+
"@pnpm/lockfile.types": "1100.0.10",
|
|
36
|
+
"@pnpm/resolving.resolver-base": "1100.4.1",
|
|
37
|
+
"@pnpm/types": "1101.3.1",
|
|
38
|
+
"@pnpm/hooks.types": "1100.0.11",
|
|
36
39
|
"@pnpm/error": "1100.0.0"
|
|
37
40
|
},
|
|
38
41
|
"devDependencies": {
|
|
@@ -41,7 +44,7 @@
|
|
|
41
44
|
"tempy": "3.0.0",
|
|
42
45
|
"write-yaml-file": "^6.0.0",
|
|
43
46
|
"yaml-tag": "1.1.0",
|
|
44
|
-
"@pnpm/lockfile.utils": "1100.0.
|
|
47
|
+
"@pnpm/lockfile.utils": "1100.0.12"
|
|
45
48
|
},
|
|
46
49
|
"engines": {
|
|
47
50
|
"node": ">=22.13"
|