pnpm 7.13.1 → 7.13.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 (65) hide show
  1. package/dist/node_modules/.modules.yaml +3 -3
  2. package/dist/node_modules/.pnpm/lock.yaml +46 -44
  3. package/dist/node_modules/@npmcli/fs/lib/common/owner-sync.js +8 -4
  4. package/dist/node_modules/@npmcli/fs/lib/common/owner.js +8 -4
  5. package/dist/node_modules/@npmcli/fs/lib/index.js +1 -1
  6. package/dist/node_modules/@npmcli/fs/lib/mkdir.js +19 -0
  7. package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +4 -2
  8. package/dist/node_modules/@npmcli/fs/package.json +4 -4
  9. package/dist/node_modules/@npmcli/move-file/lib/index.js +16 -6
  10. package/dist/node_modules/@npmcli/move-file/package.json +3 -3
  11. package/dist/node_modules/are-we-there-yet/lib/tracker-group.js +1 -1
  12. package/dist/node_modules/are-we-there-yet/package.json +12 -13
  13. package/dist/node_modules/cacache/lib/content/read.js +1 -1
  14. package/dist/node_modules/cacache/lib/content/write.js +2 -0
  15. package/dist/node_modules/cacache/lib/entry-index.js +1 -0
  16. package/dist/node_modules/cacache/lib/get.js +1 -0
  17. package/dist/node_modules/cacache/package.json +2 -2
  18. package/dist/node_modules/ip/lib/ip.js +54 -59
  19. package/dist/node_modules/ip/package.json +1 -1
  20. package/dist/node_modules/lru-cache/index.js +21 -8
  21. package/dist/node_modules/lru-cache/package.json +3 -2
  22. package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +2 -0
  23. package/dist/node_modules/make-fetch-happen/package.json +1 -1
  24. package/dist/node_modules/minipass-fetch/lib/body.js +13 -11
  25. package/dist/node_modules/minipass-fetch/package.json +4 -3
  26. package/dist/node_modules/node-gyp/addon.gypi +5 -0
  27. package/dist/node_modules/node-gyp/gyp/.github/workflows/Python_tests.yml +3 -3
  28. package/dist/node_modules/node-gyp/gyp/.github/workflows/node-gyp.yml +5 -5
  29. package/dist/node_modules/node-gyp/gyp/.github/workflows/nodejs-windows.yml +2 -2
  30. package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +12 -0
  31. package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +9 -3
  32. package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +1 -1
  33. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +191 -26
  34. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +7 -4
  35. package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2 -2
  36. package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +7 -14
  37. package/dist/node_modules/node-gyp/gyp/setup.py +1 -1
  38. package/dist/node_modules/node-gyp/gyp/test_gyp.py +1 -0
  39. package/dist/node_modules/node-gyp/gyp/tools/pretty_gyp.py +1 -1
  40. package/dist/node_modules/node-gyp/lib/build.js +2 -0
  41. package/dist/node_modules/node-gyp/lib/configure.js +45 -4
  42. package/dist/node_modules/node-gyp/package.json +2 -2
  43. package/dist/node_modules/node-gyp/update-gyp.py +19 -1
  44. package/dist/node_modules/nopt/bin/nopt.js +41 -39
  45. package/dist/node_modules/nopt/lib/nopt.js +222 -148
  46. package/dist/node_modules/nopt/package.json +27 -8
  47. package/dist/node_modules/socks/.eslintrc.cjs +11 -0
  48. package/dist/node_modules/socks/build/client/socksclient.js +8 -6
  49. package/dist/node_modules/socks/build/client/socksclient.js.map +1 -1
  50. package/dist/node_modules/socks/build/common/receivebuffer.js.map +1 -1
  51. package/dist/node_modules/socks/build/common/util.js +0 -1
  52. package/dist/node_modules/socks/build/common/util.js.map +1 -1
  53. package/dist/node_modules/socks/build/index.js +5 -1
  54. package/dist/node_modules/socks/build/index.js.map +1 -1
  55. package/dist/node_modules/socks/package.json +12 -37
  56. package/dist/node_modules/unique-filename/{index.js → lib/index.js} +0 -1
  57. package/dist/node_modules/unique-filename/package.json +29 -8
  58. package/dist/node_modules/unique-slug/{index.js → lib/index.js} +2 -2
  59. package/dist/node_modules/unique-slug/package.json +28 -7
  60. package/dist/pnpm.cjs +687 -625
  61. package/package.json +5 -5
  62. package/dist/node_modules/@npmcli/fs/lib/common/file-url-to-path/index.js +0 -17
  63. package/dist/node_modules/@npmcli/fs/lib/common/file-url-to-path/polyfill.js +0 -121
  64. package/dist/node_modules/@npmcli/fs/lib/mkdir/index.js +0 -29
  65. package/dist/node_modules/@npmcli/fs/lib/mkdir/polyfill.js +0 -81
@@ -1,24 +1,24 @@
1
- var ip = exports;
2
- var { Buffer } = require('buffer');
3
- var os = require('os');
1
+ const ip = exports;
2
+ const { Buffer } = require('buffer');
3
+ const os = require('os');
4
4
 
5
5
  ip.toBuffer = function (ip, buff, offset) {
6
6
  offset = ~~offset;
7
7
 
8
- var result;
8
+ let result;
9
9
 
10
10
  if (this.isV4Format(ip)) {
11
- result = buff || new Buffer(offset + 4);
11
+ result = buff || Buffer.alloc(offset + 4);
12
12
  ip.split(/\./g).map((byte) => {
13
13
  result[offset++] = parseInt(byte, 10) & 0xff;
14
14
  });
15
15
  } else if (this.isV6Format(ip)) {
16
- var sections = ip.split(':', 8);
16
+ const sections = ip.split(':', 8);
17
17
 
18
- var i;
18
+ let i;
19
19
  for (i = 0; i < sections.length; i++) {
20
- var isv4 = this.isV4Format(sections[i]);
21
- var v4Buffer;
20
+ const isv4 = this.isV4Format(sections[i]);
21
+ let v4Buffer;
22
22
 
23
23
  if (isv4) {
24
24
  v4Buffer = this.toBuffer(sections[i]);
@@ -36,16 +36,16 @@ ip.toBuffer = function (ip, buff, offset) {
36
36
  while (sections.length < 8) sections.push('0');
37
37
  } else if (sections.length < 8) {
38
38
  for (i = 0; i < sections.length && sections[i] !== ''; i++);
39
- var argv = [i, 1];
39
+ const argv = [i, 1];
40
40
  for (i = 9 - sections.length; i > 0; i--) {
41
41
  argv.push('0');
42
42
  }
43
- sections.splice.apply(sections, argv);
43
+ sections.splice(...argv);
44
44
  }
45
45
 
46
- result = buff || new Buffer(offset + 16);
46
+ result = buff || Buffer.alloc(offset + 16);
47
47
  for (i = 0; i < sections.length; i++) {
48
- var word = parseInt(sections[i], 16);
48
+ const word = parseInt(sections[i], 16);
49
49
  result[offset++] = (word >> 8) & 0xff;
50
50
  result[offset++] = word & 0xff;
51
51
  }
@@ -62,17 +62,16 @@ ip.toString = function (buff, offset, length) {
62
62
  offset = ~~offset;
63
63
  length = length || (buff.length - offset);
64
64
 
65
- var result = [];
66
- var i;
65
+ let result = [];
67
66
  if (length === 4) {
68
67
  // IPv4
69
- for (i = 0; i < length; i++) {
68
+ for (let i = 0; i < length; i++) {
70
69
  result.push(buff[offset + i]);
71
70
  }
72
71
  result = result.join('.');
73
72
  } else if (length === 16) {
74
73
  // IPv6
75
- for (i = 0; i < length; i += 2) {
74
+ for (let i = 0; i < length; i += 2) {
76
75
  result.push(buff.readUInt16BE(offset + i).toString(16));
77
76
  }
78
77
  result = result.join(':');
@@ -83,8 +82,8 @@ ip.toString = function (buff, offset, length) {
83
82
  return result;
84
83
  };
85
84
 
86
- var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/;
87
- var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;
85
+ const ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/;
86
+ const ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;
88
87
 
89
88
  ip.isV4Format = function (ip) {
90
89
  return ipv4Regex.test(ip);
@@ -111,14 +110,14 @@ ip.fromPrefixLen = function (prefixlen, family) {
111
110
  family = _normalizeFamily(family);
112
111
  }
113
112
 
114
- var len = 4;
113
+ let len = 4;
115
114
  if (family === 'ipv6') {
116
115
  len = 16;
117
116
  }
118
- var buff = new Buffer(len);
117
+ const buff = Buffer.alloc(len);
119
118
 
120
- for (var i = 0, n = buff.length; i < n; ++i) {
121
- var bits = 8;
119
+ for (let i = 0, n = buff.length; i < n; ++i) {
120
+ let bits = 8;
122
121
  if (prefixlen < 8) {
123
122
  bits = prefixlen;
124
123
  }
@@ -134,10 +133,10 @@ ip.mask = function (addr, mask) {
134
133
  addr = ip.toBuffer(addr);
135
134
  mask = ip.toBuffer(mask);
136
135
 
137
- var result = new Buffer(Math.max(addr.length, mask.length));
136
+ const result = Buffer.alloc(Math.max(addr.length, mask.length));
138
137
 
139
138
  // Same protocol - do bitwise and
140
- var i;
139
+ let i;
141
140
  if (addr.length === mask.length) {
142
141
  for (i = 0; i < addr.length; i++) {
143
142
  result[i] = addr[i] & mask[i];
@@ -170,30 +169,30 @@ ip.mask = function (addr, mask) {
170
169
  };
171
170
 
172
171
  ip.cidr = function (cidrString) {
173
- var cidrParts = cidrString.split('/');
172
+ const cidrParts = cidrString.split('/');
174
173
 
175
- var addr = cidrParts[0];
174
+ const addr = cidrParts[0];
176
175
  if (cidrParts.length !== 2) {
177
176
  throw new Error(`invalid CIDR subnet: ${addr}`);
178
177
  }
179
178
 
180
- var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
179
+ const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
181
180
 
182
181
  return ip.mask(addr, mask);
183
182
  };
184
183
 
185
184
  ip.subnet = function (addr, mask) {
186
- var networkAddress = ip.toLong(ip.mask(addr, mask));
185
+ const networkAddress = ip.toLong(ip.mask(addr, mask));
187
186
 
188
187
  // Calculate the mask's length.
189
- var maskBuffer = ip.toBuffer(mask);
190
- var maskLength = 0;
188
+ const maskBuffer = ip.toBuffer(mask);
189
+ let maskLength = 0;
191
190
 
192
- for (var i = 0; i < maskBuffer.length; i++) {
191
+ for (let i = 0; i < maskBuffer.length; i++) {
193
192
  if (maskBuffer[i] === 0xff) {
194
193
  maskLength += 8;
195
194
  } else {
196
- var octet = maskBuffer[i] & 0xff;
195
+ let octet = maskBuffer[i] & 0xff;
197
196
  while (octet) {
198
197
  octet = (octet << 1) & 0xff;
199
198
  maskLength++;
@@ -201,7 +200,7 @@ ip.subnet = function (addr, mask) {
201
200
  }
202
201
  }
203
202
 
204
- var numberOfAddresses = Math.pow(2, 32 - maskLength);
203
+ const numberOfAddresses = 2 ** (32 - maskLength);
205
204
 
206
205
  return {
207
206
  networkAddress: ip.fromLong(networkAddress),
@@ -224,50 +223,48 @@ ip.subnet = function (addr, mask) {
224
223
  };
225
224
 
226
225
  ip.cidrSubnet = function (cidrString) {
227
- var cidrParts = cidrString.split('/');
226
+ const cidrParts = cidrString.split('/');
228
227
 
229
- var addr = cidrParts[0];
228
+ const addr = cidrParts[0];
230
229
  if (cidrParts.length !== 2) {
231
230
  throw new Error(`invalid CIDR subnet: ${addr}`);
232
231
  }
233
232
 
234
- var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
233
+ const mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
235
234
 
236
235
  return ip.subnet(addr, mask);
237
236
  };
238
237
 
239
238
  ip.not = function (addr) {
240
- var buff = ip.toBuffer(addr);
241
- for (var i = 0; i < buff.length; i++) {
239
+ const buff = ip.toBuffer(addr);
240
+ for (let i = 0; i < buff.length; i++) {
242
241
  buff[i] = 0xff ^ buff[i];
243
242
  }
244
243
  return ip.toString(buff);
245
244
  };
246
245
 
247
246
  ip.or = function (a, b) {
248
- var i;
249
-
250
247
  a = ip.toBuffer(a);
251
248
  b = ip.toBuffer(b);
252
249
 
253
250
  // same protocol
254
251
  if (a.length === b.length) {
255
- for (i = 0; i < a.length; ++i) {
252
+ for (let i = 0; i < a.length; ++i) {
256
253
  a[i] |= b[i];
257
254
  }
258
255
  return ip.toString(a);
259
256
 
260
257
  // mixed protocols
261
258
  }
262
- var buff = a;
263
- var other = b;
259
+ let buff = a;
260
+ let other = b;
264
261
  if (b.length > a.length) {
265
262
  buff = b;
266
263
  other = a;
267
264
  }
268
265
 
269
- var offset = buff.length - other.length;
270
- for (i = offset; i < buff.length; ++i) {
266
+ const offset = buff.length - other.length;
267
+ for (let i = offset; i < buff.length; ++i) {
271
268
  buff[i] |= other[i - offset];
272
269
  }
273
270
 
@@ -275,14 +272,12 @@ ip.or = function (a, b) {
275
272
  };
276
273
 
277
274
  ip.isEqual = function (a, b) {
278
- var i;
279
-
280
275
  a = ip.toBuffer(a);
281
276
  b = ip.toBuffer(b);
282
277
 
283
278
  // Same protocol
284
279
  if (a.length === b.length) {
285
- for (i = 0; i < a.length; i++) {
280
+ for (let i = 0; i < a.length; i++) {
286
281
  if (a[i] !== b[i]) return false;
287
282
  }
288
283
  return true;
@@ -290,20 +285,20 @@ ip.isEqual = function (a, b) {
290
285
 
291
286
  // Swap
292
287
  if (b.length === 4) {
293
- var t = b;
288
+ const t = b;
294
289
  b = a;
295
290
  a = t;
296
291
  }
297
292
 
298
293
  // a - IPv4, b - IPv6
299
- for (i = 0; i < 10; i++) {
294
+ for (let i = 0; i < 10; i++) {
300
295
  if (b[i] !== 0) return false;
301
296
  }
302
297
 
303
- var word = b.readUInt16BE(10);
298
+ const word = b.readUInt16BE(10);
304
299
  if (word !== 0 && word !== 0xffff) return false;
305
300
 
306
- for (i = 0; i < 4; i++) {
301
+ for (let i = 0; i < 4; i++) {
307
302
  if (a[i] !== b[i + 12]) return false;
308
303
  }
309
304
 
@@ -365,7 +360,7 @@ ip.loopback = function (family) {
365
360
  // * undefined: First address with `ipv4` or loopback address `127.0.0.1`.
366
361
  //
367
362
  ip.address = function (name, family) {
368
- var interfaces = os.networkInterfaces();
363
+ const interfaces = os.networkInterfaces();
369
364
 
370
365
  //
371
366
  // Default to `ipv4`
@@ -377,8 +372,8 @@ ip.address = function (name, family) {
377
372
  // return the address.
378
373
  //
379
374
  if (name && name !== 'private' && name !== 'public') {
380
- var res = interfaces[name].filter((details) => {
381
- var itemFamily = _normalizeFamily(details.family);
375
+ const res = interfaces[name].filter((details) => {
376
+ const itemFamily = _normalizeFamily(details.family);
382
377
  return itemFamily === family;
383
378
  });
384
379
  if (res.length === 0) {
@@ -387,12 +382,12 @@ ip.address = function (name, family) {
387
382
  return res[0].address;
388
383
  }
389
384
 
390
- var all = Object.keys(interfaces).map((nic) => {
385
+ const all = Object.keys(interfaces).map((nic) => {
391
386
  //
392
387
  // Note: name will only be `public` or `private`
393
388
  // when this is called.
394
389
  //
395
- var addresses = interfaces[nic].filter((details) => {
390
+ const addresses = interfaces[nic].filter((details) => {
396
391
  details.family = _normalizeFamily(details.family);
397
392
  if (details.family !== family || ip.isLoopback(details.address)) {
398
393
  return false;
@@ -411,7 +406,7 @@ ip.address = function (name, family) {
411
406
  };
412
407
 
413
408
  ip.toLong = function (ip) {
414
- var ipl = 0;
409
+ let ipl = 0;
415
410
  ip.split('.').forEach((octet) => {
416
411
  ipl <<= 8;
417
412
  ipl += parseInt(octet);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ip",
3
- "version": "1.1.8",
3
+ "version": "2.0.0",
4
4
  "author": "Fedor Indutny <fedor@indutny.com>",
5
5
  "homepage": "https://github.com/indutny/node-ip",
6
6
  "repository": {
@@ -157,6 +157,7 @@ class LRUCache {
157
157
  noDisposeOnSet,
158
158
  noUpdateTTL,
159
159
  maxSize = 0,
160
+ maxEntrySize = 0,
160
161
  sizeCalculation,
161
162
  fetchMethod,
162
163
  fetchContext,
@@ -180,11 +181,12 @@ class LRUCache {
180
181
 
181
182
  this.max = max
182
183
  this.maxSize = maxSize
184
+ this.maxEntrySize = maxEntrySize || this.maxSize
183
185
  this.sizeCalculation = sizeCalculation || length
184
186
  if (this.sizeCalculation) {
185
- if (!this.maxSize) {
187
+ if (!this.maxSize && !this.maxEntrySize) {
186
188
  throw new TypeError(
187
- 'cannot set sizeCalculation without setting maxSize'
189
+ 'cannot set sizeCalculation without setting maxSize or maxEntrySize'
188
190
  )
189
191
  }
190
192
  if (typeof this.sizeCalculation !== 'function') {
@@ -231,10 +233,18 @@ class LRUCache {
231
233
  this.noUpdateTTL = !!noUpdateTTL
232
234
  this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection
233
235
 
234
- if (this.maxSize !== 0) {
235
- if (!isPosInt(this.maxSize)) {
236
+ // NB: maxEntrySize is set to maxSize if it's set
237
+ if (this.maxEntrySize !== 0) {
238
+ if (this.maxSize !== 0) {
239
+ if (!isPosInt(this.maxSize)) {
240
+ throw new TypeError(
241
+ 'maxSize must be a positive integer if specified'
242
+ )
243
+ }
244
+ }
245
+ if (!isPosInt(this.maxEntrySize)) {
236
246
  throw new TypeError(
237
- 'maxSize must be a positive integer if specified'
247
+ 'maxEntrySize must be a positive integer if specified'
238
248
  )
239
249
  }
240
250
  this.initializeSizeTracking()
@@ -402,7 +412,7 @@ class LRUCache {
402
412
  requireSize(k, v, size, sizeCalculation) {
403
413
  if (size || sizeCalculation) {
404
414
  throw new TypeError(
405
- 'cannot set size without setting maxSize on cache'
415
+ 'cannot set size without setting maxSize or maxEntrySize on cache'
406
416
  )
407
417
  }
408
418
  }
@@ -574,7 +584,8 @@ class LRUCache {
574
584
  ) {
575
585
  size = this.requireSize(k, v, size, sizeCalculation)
576
586
  // if the item doesn't fit, don't do anything
577
- if (this.maxSize && size > this.maxSize) {
587
+ // NB: maxEntrySize set to maxSize by default
588
+ if (this.maxEntrySize && size > this.maxEntrySize) {
578
589
  return this
579
590
  }
580
591
  let index = this.size === 0 ? undefined : this.keyMap.get(k)
@@ -688,7 +699,9 @@ class LRUCache {
688
699
  peek(k, { allowStale = this.allowStale } = {}) {
689
700
  const index = this.keyMap.get(k)
690
701
  if (index !== undefined && (allowStale || !this.isStale(index))) {
691
- return this.valList[index]
702
+ const v = this.valList[index]
703
+ // either stale and allowed, or forcing a refresh of non-stale value
704
+ return this.isBackgroundFetch(v) ? v.__staleWhileFetching : v
692
705
  }
693
706
  }
694
707
 
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "lru-cache",
3
3
  "description": "A cache object that deletes the least-recently-used items.",
4
- "version": "7.13.0",
4
+ "version": "7.14.0",
5
5
  "author": "Isaac Z. Schlueter <i@izs.me>",
6
6
  "keywords": [
7
7
  "mru",
8
8
  "lru",
9
9
  "cache"
10
10
  ],
11
+ "sideEffects": false,
11
12
  "scripts": {
12
13
  "build": "",
13
14
  "size": "size-limit",
@@ -26,7 +27,7 @@
26
27
  "@types/tap": "^15.0.6",
27
28
  "benchmark": "^2.1.4",
28
29
  "c8": "^7.11.2",
29
- "clock-mock": "^1.0.4",
30
+ "clock-mock": "^1.0.6",
30
31
  "eslint-config-prettier": "^8.5.0",
31
32
  "prettier": "^2.6.2",
32
33
  "size-limit": "^7.0.8",
@@ -35,6 +35,7 @@ const KEEP_RESPONSE_HEADERS = [
35
35
  'etag',
36
36
  'expires',
37
37
  'last-modified',
38
+ 'link',
38
39
  'location',
39
40
  'pragma',
40
41
  'vary',
@@ -287,6 +288,7 @@ class CacheEntry {
287
288
  // stick a flag on here so downstream users will know if they can expect integrity events
288
289
  tee.pipe(cacheStream)
289
290
  // TODO if the cache write fails, log a warning but return the response anyway
291
+ // eslint-disable-next-line promise/catch-or-return
290
292
  cacheStream.promise().then(cacheWriteResolve, cacheWriteReject)
291
293
  body.unshift(tee)
292
294
  body.unshift(this.response.body)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-fetch-happen",
3
- "version": "10.1.8",
3
+ "version": "10.2.1",
4
4
  "description": "Opinionated, caching, retrying fetch client",
5
5
  "main": "lib/index.js",
6
6
  "files": [
@@ -10,7 +10,9 @@ const FetchError = require('./fetch-error.js')
10
10
  let convert
11
11
  try {
12
12
  convert = require('encoding').convert
13
- } catch (e) {}
13
+ } catch (e) {
14
+ // defer error until textConverted is called
15
+ }
14
16
 
15
17
  const INTERNALS = Symbol('Body internals')
16
18
  const CONSUME_BODY = Symbol('consumeBody')
@@ -69,16 +71,16 @@ class Body {
69
71
  ))
70
72
  }
71
73
 
72
- json () {
73
- return this[CONSUME_BODY]().then(buf => {
74
- try {
75
- return JSON.parse(buf.toString())
76
- } catch (er) {
77
- return Promise.reject(new FetchError(
78
- `invalid json response body at ${
79
- this.url} reason: ${er.message}`, 'invalid-json'))
80
- }
81
- })
74
+ async json () {
75
+ const buf = await this[CONSUME_BODY]()
76
+ try {
77
+ return JSON.parse(buf.toString())
78
+ } catch (er) {
79
+ throw new FetchError(
80
+ `invalid json response body at ${this.url} reason: ${er.message}`,
81
+ 'invalid-json'
82
+ )
83
+ }
82
84
  }
83
85
 
84
86
  text () {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minipass-fetch",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "An implementation of window.fetch in Node.js using Minipass streams",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -23,10 +23,11 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@npmcli/eslint-config": "^3.0.1",
26
- "@npmcli/template-oss": "3.1.2",
26
+ "@npmcli/template-oss": "3.5.0",
27
27
  "@ungap/url-search-params": "^0.2.2",
28
28
  "abort-controller": "^3.0.0",
29
29
  "abortcontroller-polyfill": "~1.7.3",
30
+ "encoding": "^0.1.13",
30
31
  "form-data": "^4.0.0",
31
32
  "nock": "^13.2.4",
32
33
  "parted": "^0.1.1",
@@ -61,6 +62,6 @@
61
62
  "author": "GitHub Inc.",
62
63
  "templateOSS": {
63
64
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
64
- "version": "3.1.2"
65
+ "version": "3.5.0"
65
66
  }
66
67
  }
@@ -103,6 +103,11 @@
103
103
  '-Wl,-bimport:<(node_exp_file)'
104
104
  ],
105
105
  }],
106
+ [ 'OS=="os400"', {
107
+ 'ldflags': [
108
+ '-Wl,-bimport:<(node_exp_file)'
109
+ ],
110
+ }],
106
111
  [ 'OS=="zos"', {
107
112
  'cflags': [
108
113
  '-q64',
@@ -11,11 +11,11 @@ jobs:
11
11
  max-parallel: 8
12
12
  matrix:
13
13
  os: [macos-latest, ubuntu-latest] # , windows-latest]
14
- python-version: [3.6, 3.7, 3.8, 3.9]
14
+ python-version: ["3.7", "3.8", "3.9", "3.10"]
15
15
  steps:
16
- - uses: actions/checkout@v2
16
+ - uses: actions/checkout@v3
17
17
  - name: Set up Python ${{ matrix.python-version }}
18
- uses: actions/setup-python@v2
18
+ uses: actions/setup-python@v3
19
19
  with:
20
20
  python-version: ${{ matrix.python-version }}
21
21
  - name: Install dependencies
@@ -8,23 +8,23 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  os: [macos-latest, ubuntu-latest, windows-latest]
11
- python: [3.6, 3.9]
11
+ python: ["3.7", "3.10"]
12
12
 
13
13
  runs-on: ${{ matrix.os }}
14
14
  steps:
15
15
  - name: Clone gyp-next
16
- uses: actions/checkout@v2
16
+ uses: actions/checkout@v3
17
17
  with:
18
18
  path: gyp-next
19
19
  - name: Clone nodejs/node-gyp
20
- uses: actions/checkout@v2
20
+ uses: actions/checkout@v3
21
21
  with:
22
22
  repository: nodejs/node-gyp
23
23
  path: node-gyp
24
- - uses: actions/setup-node@v2
24
+ - uses: actions/setup-node@v3
25
25
  with:
26
26
  node-version: 14.x
27
- - uses: actions/setup-python@v2
27
+ - uses: actions/setup-python@v3
28
28
  with:
29
29
  python-version: ${{ matrix.python }}
30
30
  - name: Install dependencies
@@ -7,11 +7,11 @@ jobs:
7
7
  runs-on: windows-latest
8
8
  steps:
9
9
  - name: Clone gyp-next
10
- uses: actions/checkout@v2
10
+ uses: actions/checkout@v3
11
11
  with:
12
12
  path: gyp-next
13
13
  - name: Clone nodejs/node
14
- uses: actions/checkout@v2
14
+ uses: actions/checkout@v3
15
15
  with:
16
16
  repository: nodejs/node
17
17
  path: node
@@ -103,6 +103,18 @@ def Load(
103
103
  for (key, val) in generator.generator_default_variables.items():
104
104
  default_variables.setdefault(key, val)
105
105
 
106
+ output_dir = params["options"].generator_output or params["options"].toplevel_dir
107
+ if default_variables["GENERATOR"] == "ninja":
108
+ default_variables.setdefault(
109
+ "PRODUCT_DIR_ABS",
110
+ os.path.join(output_dir, "out", default_variables["build_type"]),
111
+ )
112
+ else:
113
+ default_variables.setdefault(
114
+ "PRODUCT_DIR_ABS",
115
+ os.path.join(output_dir, default_variables["CONFIGURATION_NAME"]),
116
+ )
117
+
106
118
  # Give the generator the opportunity to set additional variables based on
107
119
  # the params it will receive in the output phase.
108
120
  if getattr(generator, "CalculateVariables", None):
@@ -454,6 +454,8 @@ def GetFlavor(params):
454
454
  return "aix"
455
455
  if sys.platform.startswith(("os390", "zos")):
456
456
  return "zos"
457
+ if sys.platform == "os400":
458
+ return "os400"
457
459
 
458
460
  return "linux"
459
461
 
@@ -463,9 +465,13 @@ def CopyTool(flavor, out_path, generator_flags={}):
463
465
  to |out_path|."""
464
466
  # aix and solaris just need flock emulation. mac and win use more complicated
465
467
  # support scripts.
466
- prefix = {"aix": "flock", "solaris": "flock", "mac": "mac", "win": "win"}.get(
467
- flavor, None
468
- )
468
+ prefix = {
469
+ "aix": "flock",
470
+ "os400": "flock",
471
+ "solaris": "flock",
472
+ "mac": "mac",
473
+ "win": "win",
474
+ }.get(flavor, None)
469
475
  if not prefix:
470
476
  return
471
477
 
@@ -41,7 +41,7 @@ class FlockTool:
41
41
  # with EBADF, that's why we use this F_SETLK
42
42
  # hack instead.
43
43
  fd = os.open(lockfile, os.O_WRONLY | os.O_NOCTTY | os.O_CREAT, 0o666)
44
- if sys.platform.startswith("aix"):
44
+ if sys.platform.startswith("aix") or sys.platform == "os400":
45
45
  # Python on AIX is compiled with LARGEFILE support, which changes the
46
46
  # struct size.
47
47
  op = struct.pack("hhIllqq", fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)