pnpm 10.34.1 → 10.34.2

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.
Files changed (36) hide show
  1. package/dist/node_modules/.modules.yaml +97 -97
  2. package/dist/node_modules/.pnpm/lock.yaml +16 -14
  3. package/dist/node_modules/.pnpm-workspace-state-v1.json +3 -1
  4. package/dist/node_modules/semver/classes/range.js +2 -2
  5. package/dist/node_modules/semver/classes/semver.js +19 -2
  6. package/dist/node_modules/semver/package.json +2 -2
  7. package/dist/node_modules/tar/dist/commonjs/header.d.ts.map +1 -1
  8. package/dist/node_modules/tar/dist/commonjs/header.js +51 -16
  9. package/dist/node_modules/tar/dist/commonjs/header.js.map +1 -1
  10. package/dist/node_modules/tar/dist/commonjs/index.min.js +3 -3
  11. package/dist/node_modules/tar/dist/commonjs/index.min.js.map +3 -3
  12. package/dist/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -1
  13. package/dist/node_modules/tar/dist/commonjs/pack.js +4 -5
  14. package/dist/node_modules/tar/dist/commonjs/pack.js.map +1 -1
  15. package/dist/node_modules/tar/dist/commonjs/types.d.ts.map +1 -1
  16. package/dist/node_modules/tar/dist/commonjs/types.js +21 -1
  17. package/dist/node_modules/tar/dist/commonjs/types.js.map +1 -1
  18. package/dist/node_modules/tar/dist/esm/header.d.ts.map +1 -1
  19. package/dist/node_modules/tar/dist/esm/header.js +51 -16
  20. package/dist/node_modules/tar/dist/esm/header.js.map +1 -1
  21. package/dist/node_modules/tar/dist/esm/index.min.js +3 -3
  22. package/dist/node_modules/tar/dist/esm/index.min.js.map +3 -3
  23. package/dist/node_modules/tar/dist/esm/pack.d.ts.map +1 -1
  24. package/dist/node_modules/tar/dist/esm/pack.js +4 -5
  25. package/dist/node_modules/tar/dist/esm/pack.js.map +1 -1
  26. package/dist/node_modules/tar/dist/esm/types.d.ts.map +1 -1
  27. package/dist/node_modules/tar/dist/esm/types.js +20 -0
  28. package/dist/node_modules/tar/dist/esm/types.js.map +1 -1
  29. package/dist/node_modules/tar/package.json +11 -10
  30. package/dist/node_modules/tinyglobby/dist/index.cjs +19 -18
  31. package/dist/node_modules/tinyglobby/dist/index.d.cts +1 -1
  32. package/dist/node_modules/tinyglobby/dist/index.d.mts +1 -1
  33. package/dist/node_modules/tinyglobby/dist/index.mjs +9 -8
  34. package/dist/node_modules/tinyglobby/package.json +9 -12
  35. package/dist/pnpm.cjs +11053 -762
  36. package/package.json +1 -1
@@ -19,60 +19,69 @@
19
19
  "nopt@8.1.0": [
20
20
  "node_modules/nopt"
21
21
  ],
22
- "env-paths@2.2.1": [
23
- "node_modules/env-paths"
24
- ],
25
- "proc-log@5.0.0": [
26
- "node_modules/proc-log"
27
- ],
28
- "tinyglobby@0.2.16": [
29
- "node_modules/tinyglobby"
22
+ "exponential-backoff@3.1.3": [
23
+ "node_modules/exponential-backoff"
30
24
  ],
31
25
  "which@5.0.0": [
32
26
  "node_modules/which"
33
27
  ],
34
- "exponential-backoff@3.1.3": [
35
- "node_modules/exponential-backoff"
28
+ "tinyglobby@0.2.17": [
29
+ "node_modules/tinyglobby"
36
30
  ],
37
- "graceful-fs@4.2.11": [
38
- "node_modules/graceful-fs"
31
+ "env-paths@2.2.1": [
32
+ "node_modules/env-paths"
33
+ ],
34
+ "proc-log@5.0.0": [
35
+ "node_modules/proc-log"
39
36
  ],
40
- "tar@7.5.15": [
37
+ "tar@7.5.16": [
41
38
  "node_modules/tar"
42
39
  ],
43
- "semver@7.8.1": [
40
+ "semver@7.8.3": [
44
41
  "node_modules/semver"
45
42
  ],
46
43
  "make-fetch-happen@14.0.3": [
47
44
  "node_modules/make-fetch-happen"
48
45
  ],
46
+ "graceful-fs@4.2.11": [
47
+ "node_modules/graceful-fs"
48
+ ],
49
49
  "abbrev@3.0.1": [
50
50
  "node_modules/abbrev"
51
51
  ],
52
- "picomatch@4.0.4": [
53
- "node_modules/picomatch"
52
+ "isexe@3.1.1": [
53
+ "node_modules/isexe"
54
54
  ],
55
55
  "fdir@6.5.0(picomatch@4.0.4)": [
56
56
  "node_modules/fdir"
57
57
  ],
58
- "isexe@3.1.1": [
59
- "node_modules/isexe"
60
- ],
61
- "yallist@5.0.0": [
62
- "node_modules/yallist"
58
+ "picomatch@4.0.4": [
59
+ "node_modules/picomatch"
63
60
  ],
64
61
  "chownr@3.0.0": [
65
62
  "node_modules/chownr"
66
63
  ],
67
- "minizlib@3.1.0": [
68
- "node_modules/minizlib"
64
+ "yallist@5.0.0": [
65
+ "node_modules/yallist"
69
66
  ],
70
67
  "@isaacs/fs-minipass@4.0.1": [
71
68
  "node_modules/@isaacs/fs-minipass"
72
69
  ],
70
+ "minizlib@3.1.0": [
71
+ "node_modules/minizlib"
72
+ ],
73
73
  "minipass@7.1.3": [
74
74
  "node_modules/minipass"
75
75
  ],
76
+ "ssri@12.0.0": [
77
+ "node_modules/ssri"
78
+ ],
79
+ "negotiator@1.0.0": [
80
+ "node_modules/negotiator"
81
+ ],
82
+ "promise-retry@2.0.1": [
83
+ "node_modules/promise-retry"
84
+ ],
76
85
  "minipass@3.3.6": [
77
86
  "node_modules/minipass-flush/node_modules/minipass",
78
87
  "node_modules/minipass-pipeline/node_modules/minipass",
@@ -83,68 +92,77 @@
83
92
  "node_modules/minipass-pipeline/node_modules/yallist",
84
93
  "node_modules/minipass-sized/node_modules/yallist"
85
94
  ],
86
- "negotiator@1.0.0": [
87
- "node_modules/negotiator"
95
+ "cacache@19.0.1": [
96
+ "node_modules/cacache"
88
97
  ],
89
- "promise-retry@2.0.1": [
90
- "node_modules/promise-retry"
98
+ "http-cache-semantics@4.2.0": [
99
+ "node_modules/http-cache-semantics"
91
100
  ],
92
101
  "@npmcli/agent@3.0.0": [
93
102
  "node_modules/@npmcli/agent"
94
103
  ],
95
- "ssri@12.0.0": [
96
- "node_modules/ssri"
97
- ],
98
- "http-cache-semantics@4.2.0": [
99
- "node_modules/http-cache-semantics"
100
- ],
101
104
  "minipass-fetch@4.0.1": [
102
105
  "node_modules/minipass-fetch"
103
106
  ],
104
- "cacache@19.0.1": [
105
- "node_modules/cacache"
107
+ "retry@0.12.0": [
108
+ "node_modules/retry"
106
109
  ],
107
110
  "err-code@2.0.3": [
108
111
  "node_modules/err-code"
109
112
  ],
110
- "retry@0.12.0": [
111
- "node_modules/retry"
113
+ "minipass-collect@2.0.1": [
114
+ "node_modules/minipass-collect"
112
115
  ],
113
- "http-proxy-agent@7.0.2": [
114
- "node_modules/http-proxy-agent"
116
+ "p-map@7.0.4": [
117
+ "node_modules/p-map"
118
+ ],
119
+ "fs-minipass@3.0.3": [
120
+ "node_modules/fs-minipass"
121
+ ],
122
+ "unique-filename@4.0.0": [
123
+ "node_modules/unique-filename"
124
+ ],
125
+ "lru-cache@10.4.3": [
126
+ "node_modules/lru-cache"
127
+ ],
128
+ "@npmcli/fs@4.0.0": [
129
+ "node_modules/@npmcli/fs"
130
+ ],
131
+ "glob@10.5.0": [
132
+ "node_modules/glob"
115
133
  ],
116
134
  "agent-base@7.1.4": [
117
135
  "node_modules/agent-base"
118
136
  ],
119
- "https-proxy-agent@7.0.6": [
120
- "node_modules/https-proxy-agent"
137
+ "http-proxy-agent@7.0.2": [
138
+ "node_modules/http-proxy-agent"
121
139
  ],
122
140
  "socks-proxy-agent@8.0.5": [
123
141
  "node_modules/socks-proxy-agent"
124
142
  ],
125
- "lru-cache@10.4.3": [
126
- "node_modules/lru-cache"
143
+ "https-proxy-agent@7.0.6": [
144
+ "node_modules/https-proxy-agent"
127
145
  ],
128
146
  "encoding@0.1.13": [
129
147
  "node_modules/encoding"
130
148
  ],
131
- "unique-filename@4.0.0": [
132
- "node_modules/unique-filename"
149
+ "unique-slug@5.0.0": [
150
+ "node_modules/unique-slug"
133
151
  ],
134
- "fs-minipass@3.0.3": [
135
- "node_modules/fs-minipass"
152
+ "package-json-from-dist@1.0.1": [
153
+ "node_modules/package-json-from-dist"
136
154
  ],
137
- "minipass-collect@2.0.1": [
138
- "node_modules/minipass-collect"
155
+ "foreground-child@3.3.1": [
156
+ "node_modules/foreground-child"
139
157
  ],
140
- "p-map@7.0.4": [
141
- "node_modules/p-map"
158
+ "jackspeak@3.4.3": [
159
+ "node_modules/jackspeak"
142
160
  ],
143
- "@npmcli/fs@4.0.0": [
144
- "node_modules/@npmcli/fs"
161
+ "path-scurry@1.11.1": [
162
+ "node_modules/path-scurry"
145
163
  ],
146
- "glob@10.5.0": [
147
- "node_modules/glob"
164
+ "minimatch@9.0.9": [
165
+ "node_modules/minimatch"
148
166
  ],
149
167
  "debug@4.4.3": [
150
168
  "node_modules/debug"
@@ -155,23 +173,26 @@
155
173
  "iconv-lite@0.6.3": [
156
174
  "node_modules/iconv-lite"
157
175
  ],
158
- "unique-slug@5.0.0": [
159
- "node_modules/unique-slug"
176
+ "imurmurhash@0.1.4": [
177
+ "node_modules/imurmurhash"
160
178
  ],
161
- "package-json-from-dist@1.0.1": [
162
- "node_modules/package-json-from-dist"
179
+ "signal-exit@4.1.0": [
180
+ "node_modules/signal-exit"
163
181
  ],
164
- "path-scurry@1.11.1": [
165
- "node_modules/path-scurry"
182
+ "which@2.0.2": [
183
+ "node_modules/cross-spawn/node_modules/which"
166
184
  ],
167
- "jackspeak@3.4.3": [
168
- "node_modules/jackspeak"
185
+ "isexe@2.0.0": [
186
+ "node_modules/cross-spawn/node_modules/isexe"
169
187
  ],
170
- "minimatch@9.0.9": [
171
- "node_modules/minimatch"
188
+ "@isaacs/cliui@8.0.2": [
189
+ "node_modules/@isaacs/cliui"
172
190
  ],
173
- "foreground-child@3.3.1": [
174
- "node_modules/foreground-child"
191
+ "@pkgjs/parseargs@0.11.0": [
192
+ "node_modules/@pkgjs/parseargs"
193
+ ],
194
+ "brace-expansion@2.1.1": [
195
+ "node_modules/brace-expansion"
175
196
  ],
176
197
  "ms@2.1.3": [
177
198
  "node_modules/ms"
@@ -185,26 +206,11 @@
185
206
  "safer-buffer@2.1.2": [
186
207
  "node_modules/safer-buffer"
187
208
  ],
188
- "imurmurhash@0.1.4": [
189
- "node_modules/imurmurhash"
190
- ],
191
- "@isaacs/cliui@8.0.2": [
192
- "node_modules/@isaacs/cliui"
193
- ],
194
- "@pkgjs/parseargs@0.11.0": [
195
- "node_modules/@pkgjs/parseargs"
196
- ],
197
- "brace-expansion@2.1.1": [
198
- "node_modules/brace-expansion"
199
- ],
200
- "signal-exit@4.1.0": [
201
- "node_modules/signal-exit"
202
- ],
203
- "which@2.0.2": [
204
- "node_modules/cross-spawn/node_modules/which"
209
+ "path-key@3.1.1": [
210
+ "node_modules/path-key"
205
211
  ],
206
- "isexe@2.0.0": [
207
- "node_modules/cross-spawn/node_modules/isexe"
212
+ "shebang-command@2.0.0": [
213
+ "node_modules/shebang-command"
208
214
  ],
209
215
  "strip-ansi@7.2.0": [
210
216
  "node_modules/strip-ansi"
@@ -239,11 +245,8 @@
239
245
  "balanced-match@1.0.2": [
240
246
  "node_modules/balanced-match"
241
247
  ],
242
- "shebang-command@2.0.0": [
243
- "node_modules/shebang-command"
244
- ],
245
- "path-key@3.1.1": [
246
- "node_modules/path-key"
248
+ "shebang-regex@3.0.0": [
249
+ "node_modules/shebang-regex"
247
250
  ],
248
251
  "ansi-regex@6.2.2": [
249
252
  "node_modules/ansi-regex"
@@ -257,14 +260,11 @@
257
260
  "color-convert@2.0.1": [
258
261
  "node_modules/color-convert"
259
262
  ],
260
- "eastasianwidth@0.2.0": [
261
- "node_modules/eastasianwidth"
262
- ],
263
263
  "emoji-regex@9.2.2": [
264
264
  "node_modules/emoji-regex"
265
265
  ],
266
- "shebang-regex@3.0.0": [
267
- "node_modules/shebang-regex"
266
+ "eastasianwidth@0.2.0": [
267
+ "node_modules/eastasianwidth"
268
268
  ],
269
269
  "color-name@1.1.4": [
270
270
  "node_modules/color-name"
@@ -289,7 +289,7 @@
289
289
  "packageManager": "pnpm@10.33.1",
290
290
  "pendingBuilds": [],
291
291
  "publicHoistPattern": [],
292
- "prunedAt": "Wed, 27 May 2026 23:03:26 GMT",
292
+ "prunedAt": "Wed, 10 Jun 2026 13:59:47 GMT",
293
293
  "registries": {
294
294
  "default": "https://registry.npmjs.org/",
295
295
  "@jsr": "https://npm.jsr.io/"
@@ -42,6 +42,8 @@ overrides:
42
42
  semver@<7.5.2: ^7.7.4
43
43
  send@<0.19.0: ^0.19.0
44
44
  serve-static@<1.16.0: ^1.16.0
45
+ shell-quote@<1.8.4: '>=1.8.4'
46
+ shell-quote: 1.8.4
45
47
  socks@2: ^2.8.1
46
48
  tar@<=7.5.10: '>=7.5.11'
47
49
  tmp@<0.2.6: '>=0.2.6'
@@ -319,8 +321,8 @@ packages:
319
321
  safer-buffer@2.1.2:
320
322
  resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
321
323
 
322
- semver@7.8.1:
323
- resolution: {integrity: sha512-rkVq3IXh+4FDGch+KwzX3aV9W3kO54GyEgpvBzSyctDA6Xtd7RJQV1xmXbeQp5v7+VzLOfVqiutSE6GICgPFvg==}
324
+ semver@7.8.3:
325
+ resolution: {integrity: sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==}
324
326
  engines: {node: '>=10'}
325
327
  hasBin: true
326
328
 
@@ -368,12 +370,12 @@ packages:
368
370
  resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==}
369
371
  engines: {node: '>=12'}
370
372
 
371
- tar@7.5.15:
372
- resolution: {integrity: sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==}
373
+ tar@7.5.16:
374
+ resolution: {integrity: sha512-56adEpPMouktRlBLXiaYFFzZ/3+JXa8P9n7WbR+ibIjtviN55mEaOkiysCnPnWm+7kkui1Dn8J9l+g6zV8731w==}
373
375
  engines: {node: '>=18'}
374
376
 
375
- tinyglobby@0.2.16:
376
- resolution: {integrity: sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==}
377
+ tinyglobby@0.2.17:
378
+ resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
377
379
  engines: {node: '>=12.0.0'}
378
380
 
379
381
  unique-filename@4.0.0:
@@ -442,7 +444,7 @@ snapshots:
442
444
 
443
445
  '@npmcli/fs@4.0.0':
444
446
  dependencies:
445
- semver: 7.8.1
447
+ semver: 7.8.3
446
448
  optional: true
447
449
 
448
450
  '@pkgjs/parseargs@0.11.0':
@@ -488,7 +490,7 @@ snapshots:
488
490
  minipass-pipeline: 1.2.4
489
491
  p-map: 7.0.4
490
492
  ssri: 12.0.0
491
- tar: 7.5.15
493
+ tar: 7.5.16
492
494
  unique-filename: 4.0.0
493
495
  optional: true
494
496
 
@@ -694,9 +696,9 @@ snapshots:
694
696
  make-fetch-happen: 14.0.3
695
697
  nopt: 8.1.0
696
698
  proc-log: 5.0.0
697
- semver: 7.8.1
698
- tar: 7.5.15
699
- tinyglobby: 0.2.16
699
+ semver: 7.8.3
700
+ tar: 7.5.16
701
+ tinyglobby: 0.2.17
700
702
  which: 5.0.0
701
703
  transitivePeerDependencies:
702
704
  - supports-color
@@ -740,7 +742,7 @@ snapshots:
740
742
  safer-buffer@2.1.2:
741
743
  optional: true
742
744
 
743
- semver@7.8.1:
745
+ semver@7.8.3:
744
746
  optional: true
745
747
 
746
748
  shebang-command@2.0.0:
@@ -801,7 +803,7 @@ snapshots:
801
803
  ansi-regex: 6.2.2
802
804
  optional: true
803
805
 
804
- tar@7.5.15:
806
+ tar@7.5.16:
805
807
  dependencies:
806
808
  '@isaacs/fs-minipass': 4.0.1
807
809
  chownr: 3.0.0
@@ -810,7 +812,7 @@ snapshots:
810
812
  yallist: 5.0.0
811
813
  optional: true
812
814
 
813
- tinyglobby@0.2.16:
815
+ tinyglobby@0.2.17:
814
816
  dependencies:
815
817
  fdir: 6.5.0(picomatch@4.0.4)
816
818
  picomatch: 4.0.4
@@ -1,5 +1,5 @@
1
1
  {
2
- "lastValidatedTimestamp": 1779923006425,
2
+ "lastValidatedTimestamp": 1781099987600,
3
3
  "projects": {},
4
4
  "pnpmfiles": [],
5
5
  "settings": {
@@ -56,6 +56,8 @@
56
56
  "semver@<7.5.2": "^7.7.4",
57
57
  "send@<0.19.0": "^0.19.0",
58
58
  "serve-static@<1.16.0": "^1.16.0",
59
+ "shell-quote@<1.8.4": ">=1.8.4",
60
+ "shell-quote": "1.8.4",
59
61
  "socks@2": "^2.8.1",
60
62
  "tar@<=7.5.10": ">=7.5.11",
61
63
  "tmp@<0.2.6": ">=0.2.6",
@@ -373,10 +373,10 @@ const replaceCaret = (comp, options) => {
373
373
  if (M === '0') {
374
374
  if (m === '0') {
375
375
  ret = `>=${M}.${m}.${p
376
- }${z} <${M}.${m}.${+p + 1}-0`
376
+ } <${M}.${m}.${+p + 1}-0`
377
377
  } else {
378
378
  ret = `>=${M}.${m}.${p
379
- }${z} <${M}.${+m + 1}.0-0`
379
+ } <${M}.${+m + 1}.0-0`
380
380
  }
381
381
  } else {
382
382
  ret = `>=${M}.${m}.${p
@@ -6,6 +6,22 @@ const { safeRe: re, t } = require('../internal/re')
6
6
 
7
7
  const parseOptions = require('../internal/parse-options')
8
8
  const { compareIdentifiers } = require('../internal/identifiers')
9
+
10
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
11
+ const identifiers = identifier.split('.')
12
+ if (identifiers.length > prerelease.length) {
13
+ return false
14
+ }
15
+
16
+ for (let i = 0; i < identifiers.length; i++) {
17
+ if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
18
+ return false
19
+ }
20
+ }
21
+
22
+ return true
23
+ }
24
+
9
25
  class SemVer {
10
26
  constructor (version, options) {
11
27
  options = parseOptions(options)
@@ -309,8 +325,9 @@ class SemVer {
309
325
  if (identifierBase === false) {
310
326
  prerelease = [identifier]
311
327
  }
312
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
313
- if (isNaN(this.prerelease[1])) {
328
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
329
+ const prereleaseBase = this.prerelease[identifier.split('.').length]
330
+ if (isNaN(prereleaseBase)) {
314
331
  this.prerelease = prerelease
315
332
  }
316
333
  } else {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.1",
3
+ "version": "7.8.3",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
15
15
  },
16
16
  "devDependencies": {
17
- "@npmcli/eslint-config": "^6.0.0",
17
+ "@npmcli/eslint-config": "^7.0.0",
18
18
  "@npmcli/template-oss": "5.0.0",
19
19
  "benchmark": "^2.1.4",
20
20
  "tap": "^16.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/header.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,CAA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AAC,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,aAAa,EAS3D;CACF"}
@@ -78,22 +78,45 @@ class Header {
78
78
  if (!buf || !(buf.length >= off + 512)) {
79
79
  throw new Error('need 512 bytes for header');
80
80
  }
81
- this.path = ex?.path ?? decString(buf, off, 100);
82
- this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8);
83
- this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8);
84
- this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8);
85
- this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12);
86
- this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12);
81
+ // Decode the typeflag (independent of any pending PAX/GNU extended header)
82
+ // up front so we can tell whether THIS block is itself an intermediary
83
+ // extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
84
+ // Per POSIX pax, a PAX extended header describes the *next file entry*, not
85
+ // the extension headers that may sit between it and that file. Applying the
86
+ // pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
87
+ // header desynchronizes the stream relative to other tar implementations
88
+ // and enables tar interpretation-conflict / file-smuggling attacks.
89
+ const t = decString(buf, off + 156, 1);
90
+ const isNormalFS = types.normalFsTypes.has(t);
91
+ const exForFields = isNormalFS ? ex : undefined;
92
+ const gexForFields = isNormalFS ? gex : undefined;
93
+ this.path = exForFields?.path ?? decString(buf, off, 100);
94
+ this.mode =
95
+ exForFields?.mode ??
96
+ gexForFields?.mode ??
97
+ decNumber(buf, off + 100, 8);
98
+ this.uid =
99
+ exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
100
+ this.gid =
101
+ exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
102
+ this.size =
103
+ exForFields?.size ??
104
+ gexForFields?.size ??
105
+ decNumber(buf, off + 124, 12);
106
+ this.mtime =
107
+ exForFields?.mtime ??
108
+ gexForFields?.mtime ??
109
+ decDate(buf, off + 136, 12);
87
110
  this.cksum = decNumber(buf, off + 148, 12);
88
111
  // if we have extended or global extended headers, apply them now
89
112
  // See https://github.com/npm/node-tar/pull/187
90
- // Apply global before local, so it overrides
91
- if (gex)
92
- this.#slurp(gex, true);
93
- if (ex)
94
- this.#slurp(ex);
113
+ // Apply global before local, so it overrides. Never slurp the pending
114
+ // extended-header fields onto an intermediary extension header.
115
+ if (gexForFields)
116
+ this.#slurp(gexForFields, true);
117
+ if (exForFields)
118
+ this.#slurp(exForFields);
95
119
  // old tar versions marked dirs as a file with a trailing /
96
- const t = decString(buf, off + 156, 1);
97
120
  if (types.isCode(t)) {
98
121
  this.#type = t || '0';
99
122
  }
@@ -111,12 +134,24 @@ class Header {
111
134
  this.linkpath = decString(buf, off + 157, 100);
112
135
  if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
113
136
  /* c8 ignore start */
114
- this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32);
115
- this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32);
137
+ this.uname =
138
+ exForFields?.uname ??
139
+ gexForFields?.uname ??
140
+ decString(buf, off + 265, 32);
141
+ this.gname =
142
+ exForFields?.gname ??
143
+ gexForFields?.gname ??
144
+ decString(buf, off + 297, 32);
116
145
  this.devmaj =
117
- ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0;
146
+ exForFields?.devmaj ??
147
+ gexForFields?.devmaj ??
148
+ decNumber(buf, off + 329, 8) ??
149
+ 0;
118
150
  this.devmin =
119
- ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0;
151
+ exForFields?.devmin ??
152
+ gexForFields?.devmin ??
153
+ decNumber(buf, off + 337, 8) ??
154
+ 0;
120
155
  /* c8 ignore stop */
121
156
  if (buf[off + 475] !== 0) {
122
157
  // definitely a prefix, definitely >130 chars.