pnpm 10.33.2 → 10.33.3

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 (31) hide show
  1. package/dist/node_modules/.modules.yaml +66 -66
  2. package/dist/node_modules/.pnpm/lock.yaml +8 -8
  3. package/dist/node_modules/.pnpm-workspace-state-v1.json +1 -1
  4. package/dist/node_modules/ip-address/dist/address-error.js.map +1 -1
  5. package/dist/node_modules/ip-address/dist/common.js +21 -0
  6. package/dist/node_modules/ip-address/dist/common.js.map +1 -1
  7. package/dist/node_modules/ip-address/dist/ip-address.js.map +1 -1
  8. package/dist/node_modules/ip-address/dist/ipv4.js +193 -68
  9. package/dist/node_modules/ip-address/dist/ipv4.js.map +1 -1
  10. package/dist/node_modules/ip-address/dist/ipv6.js +345 -131
  11. package/dist/node_modules/ip-address/dist/ipv6.js.map +1 -1
  12. package/dist/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  13. package/dist/node_modules/ip-address/dist/v6/constants.js +5 -0
  14. package/dist/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  15. package/dist/node_modules/ip-address/dist/v6/helpers.js +12 -3
  16. package/dist/node_modules/ip-address/dist/v6/helpers.js.map +1 -1
  17. package/dist/node_modules/ip-address/dist/v6/regular-expressions.js.map +1 -1
  18. package/dist/node_modules/ip-address/package.json +45 -35
  19. package/dist/node_modules/socks/.claude/settings.local.json +26 -0
  20. package/dist/node_modules/socks/package.json +2 -2
  21. package/dist/pnpm.cjs +38 -4
  22. package/package.json +1 -1
  23. package/dist/node_modules/ip-address/dist/address-error.d.ts.map +0 -1
  24. package/dist/node_modules/ip-address/dist/common.d.ts.map +0 -1
  25. package/dist/node_modules/ip-address/dist/ip-address.d.ts.map +0 -1
  26. package/dist/node_modules/ip-address/dist/ipv4.d.ts.map +0 -1
  27. package/dist/node_modules/ip-address/dist/ipv6.d.ts.map +0 -1
  28. package/dist/node_modules/ip-address/dist/v4/constants.d.ts.map +0 -1
  29. package/dist/node_modules/ip-address/dist/v6/constants.d.ts.map +0 -1
  30. package/dist/node_modules/ip-address/dist/v6/helpers.d.ts.map +0 -1
  31. package/dist/node_modules/ip-address/dist/v6/regular-expressions.d.ts.map +0 -1
@@ -22,21 +22,21 @@
22
22
  "tar@7.5.13": [
23
23
  "node_modules/tar"
24
24
  ],
25
- "proc-log@5.0.0": [
26
- "node_modules/proc-log"
25
+ "env-paths@2.2.1": [
26
+ "node_modules/env-paths"
27
27
  ],
28
28
  "tinyglobby@0.2.16": [
29
29
  "node_modules/tinyglobby"
30
30
  ],
31
- "exponential-backoff@3.1.3": [
32
- "node_modules/exponential-backoff"
33
- ],
34
- "env-paths@2.2.1": [
35
- "node_modules/env-paths"
31
+ "proc-log@5.0.0": [
32
+ "node_modules/proc-log"
36
33
  ],
37
34
  "which@5.0.0": [
38
35
  "node_modules/which"
39
36
  ],
37
+ "exponential-backoff@3.1.3": [
38
+ "node_modules/exponential-backoff"
39
+ ],
40
40
  "graceful-fs@4.2.11": [
41
41
  "node_modules/graceful-fs"
42
42
  ],
@@ -52,35 +52,38 @@
52
52
  "yallist@5.0.0": [
53
53
  "node_modules/yallist"
54
54
  ],
55
- "chownr@3.0.0": [
56
- "node_modules/chownr"
57
- ],
58
55
  "@isaacs/fs-minipass@4.0.1": [
59
56
  "node_modules/@isaacs/fs-minipass"
60
57
  ],
58
+ "chownr@3.0.0": [
59
+ "node_modules/chownr"
60
+ ],
61
61
  "minizlib@3.1.0": [
62
62
  "node_modules/minizlib"
63
63
  ],
64
64
  "minipass@7.1.3": [
65
65
  "node_modules/minipass"
66
66
  ],
67
- "picomatch@4.0.4": [
68
- "node_modules/picomatch"
69
- ],
70
67
  "fdir@6.5.0(picomatch@4.0.4)": [
71
68
  "node_modules/fdir"
72
69
  ],
70
+ "picomatch@4.0.4": [
71
+ "node_modules/picomatch"
72
+ ],
73
73
  "isexe@3.1.1": [
74
74
  "node_modules/isexe"
75
75
  ],
76
- "ssri@12.0.0": [
77
- "node_modules/ssri"
76
+ "promise-retry@2.0.1": [
77
+ "node_modules/promise-retry"
78
78
  ],
79
79
  "negotiator@1.0.0": [
80
80
  "node_modules/negotiator"
81
81
  ],
82
- "cacache@19.0.1": [
83
- "node_modules/cacache"
82
+ "ssri@12.0.0": [
83
+ "node_modules/ssri"
84
+ ],
85
+ "minipass-fetch@4.0.1": [
86
+ "node_modules/minipass-fetch"
84
87
  ],
85
88
  "minipass@3.3.6": [
86
89
  "node_modules/minipass-flush/node_modules/minipass",
@@ -92,17 +95,38 @@
92
95
  "node_modules/minipass-pipeline/node_modules/yallist",
93
96
  "node_modules/minipass-sized/node_modules/yallist"
94
97
  ],
98
+ "@npmcli/agent@3.0.0": [
99
+ "node_modules/@npmcli/agent"
100
+ ],
101
+ "cacache@19.0.1": [
102
+ "node_modules/cacache"
103
+ ],
95
104
  "http-cache-semantics@4.2.0": [
96
105
  "node_modules/http-cache-semantics"
97
106
  ],
98
- "promise-retry@2.0.1": [
99
- "node_modules/promise-retry"
107
+ "retry@0.12.0": [
108
+ "node_modules/retry"
100
109
  ],
101
- "minipass-fetch@4.0.1": [
102
- "node_modules/minipass-fetch"
110
+ "err-code@2.0.3": [
111
+ "node_modules/err-code"
103
112
  ],
104
- "@npmcli/agent@3.0.0": [
105
- "node_modules/@npmcli/agent"
113
+ "encoding@0.1.13": [
114
+ "node_modules/encoding"
115
+ ],
116
+ "agent-base@7.1.4": [
117
+ "node_modules/agent-base"
118
+ ],
119
+ "http-proxy-agent@7.0.2": [
120
+ "node_modules/http-proxy-agent"
121
+ ],
122
+ "https-proxy-agent@7.0.6": [
123
+ "node_modules/https-proxy-agent"
124
+ ],
125
+ "socks-proxy-agent@8.0.5": [
126
+ "node_modules/socks-proxy-agent"
127
+ ],
128
+ "lru-cache@10.4.3": [
129
+ "node_modules/lru-cache"
106
130
  ],
107
131
  "unique-filename@4.0.0": [
108
132
  "node_modules/unique-filename"
@@ -122,29 +146,14 @@
122
146
  "glob@10.5.0": [
123
147
  "node_modules/glob"
124
148
  ],
125
- "lru-cache@10.4.3": [
126
- "node_modules/lru-cache"
127
- ],
128
- "retry@0.12.0": [
129
- "node_modules/retry"
130
- ],
131
- "err-code@2.0.3": [
132
- "node_modules/err-code"
133
- ],
134
- "encoding@0.1.13": [
135
- "node_modules/encoding"
136
- ],
137
- "http-proxy-agent@7.0.2": [
138
- "node_modules/http-proxy-agent"
139
- ],
140
- "https-proxy-agent@7.0.6": [
141
- "node_modules/https-proxy-agent"
149
+ "iconv-lite@0.6.3": [
150
+ "node_modules/iconv-lite"
142
151
  ],
143
- "agent-base@7.1.4": [
144
- "node_modules/agent-base"
152
+ "debug@4.4.3": [
153
+ "node_modules/debug"
145
154
  ],
146
- "socks-proxy-agent@8.0.5": [
147
- "node_modules/socks-proxy-agent"
155
+ "socks@2.8.8": [
156
+ "node_modules/socks"
148
157
  ],
149
158
  "unique-slug@5.0.0": [
150
159
  "node_modules/unique-slug"
@@ -164,27 +173,30 @@
164
173
  "minimatch@9.0.9": [
165
174
  "node_modules/minimatch"
166
175
  ],
167
- "iconv-lite@0.6.3": [
168
- "node_modules/iconv-lite"
176
+ "safer-buffer@2.1.2": [
177
+ "node_modules/safer-buffer"
169
178
  ],
170
- "debug@4.4.3": [
171
- "node_modules/debug"
179
+ "ms@2.1.3": [
180
+ "node_modules/ms"
172
181
  ],
173
- "socks@2.8.7": [
174
- "node_modules/socks"
182
+ "smart-buffer@4.2.0": [
183
+ "node_modules/smart-buffer"
184
+ ],
185
+ "ip-address@10.2.0": [
186
+ "node_modules/ip-address"
175
187
  ],
176
188
  "imurmurhash@0.1.4": [
177
189
  "node_modules/imurmurhash"
178
190
  ],
191
+ "signal-exit@4.1.0": [
192
+ "node_modules/signal-exit"
193
+ ],
179
194
  "which@2.0.2": [
180
195
  "node_modules/cross-spawn/node_modules/which"
181
196
  ],
182
197
  "isexe@2.0.0": [
183
198
  "node_modules/cross-spawn/node_modules/isexe"
184
199
  ],
185
- "signal-exit@4.1.0": [
186
- "node_modules/signal-exit"
187
- ],
188
200
  "@isaacs/cliui@8.0.2": [
189
201
  "node_modules/@isaacs/cliui"
190
202
  ],
@@ -194,18 +206,6 @@
194
206
  "brace-expansion@2.1.0": [
195
207
  "node_modules/brace-expansion"
196
208
  ],
197
- "safer-buffer@2.1.2": [
198
- "node_modules/safer-buffer"
199
- ],
200
- "ms@2.1.3": [
201
- "node_modules/ms"
202
- ],
203
- "smart-buffer@4.2.0": [
204
- "node_modules/smart-buffer"
205
- ],
206
- "ip-address@10.1.0": [
207
- "node_modules/ip-address"
208
- ],
209
209
  "shebang-command@2.0.0": [
210
210
  "node_modules/shebang-command"
211
211
  ],
@@ -289,7 +289,7 @@
289
289
  "packageManager": "pnpm@10.33.1",
290
290
  "pendingBuilds": [],
291
291
  "publicHoistPattern": [],
292
- "prunedAt": "Thu, 23 Apr 2026 11:46:36 GMT",
292
+ "prunedAt": "Mon, 04 May 2026 21:25:54 GMT",
293
293
  "registries": {
294
294
  "default": "https://registry.npmjs.org/",
295
295
  "@jsr": "https://npm.jsr.io/"
@@ -206,8 +206,8 @@ packages:
206
206
  resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==}
207
207
  engines: {node: '>=0.8.19'}
208
208
 
209
- ip-address@10.1.0:
210
- resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==}
209
+ ip-address@10.2.0:
210
+ resolution: {integrity: sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==}
211
211
  engines: {node: '>= 12'}
212
212
 
213
213
  is-fullwidth-code-point@3.0.0:
@@ -343,8 +343,8 @@ packages:
343
343
  resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==}
344
344
  engines: {node: '>= 14'}
345
345
 
346
- socks@2.8.7:
347
- resolution: {integrity: sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==}
346
+ socks@2.8.8:
347
+ resolution: {integrity: sha512-NlGELfPrgX2f1TAAcz0WawlLn+0r3FyhhCRpFFK2CemXenPYvzMWWZINv3eDNo9ucdwme7oCHRY0Jnbs4aIkog==}
348
348
  engines: {node: '>= 10.0.0', npm: '>= 3.0.0'}
349
349
 
350
350
  ssri@12.0.0:
@@ -593,7 +593,7 @@ snapshots:
593
593
  imurmurhash@0.1.4:
594
594
  optional: true
595
595
 
596
- ip-address@10.1.0:
596
+ ip-address@10.2.0:
597
597
  optional: true
598
598
 
599
599
  is-fullwidth-code-point@3.0.0:
@@ -760,14 +760,14 @@ snapshots:
760
760
  dependencies:
761
761
  agent-base: 7.1.4
762
762
  debug: 4.4.3
763
- socks: 2.8.7
763
+ socks: 2.8.8
764
764
  transitivePeerDependencies:
765
765
  - supports-color
766
766
  optional: true
767
767
 
768
- socks@2.8.7:
768
+ socks@2.8.8:
769
769
  dependencies:
770
- ip-address: 10.1.0
770
+ ip-address: 10.2.0
771
771
  smart-buffer: 4.2.0
772
772
  optional: true
773
773
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "lastValidatedTimestamp": 1776944796156,
2
+ "lastValidatedTimestamp": 1777929954849,
3
3
  "projects": {},
4
4
  "pnpmfiles": [],
5
5
  "settings": {
@@ -1 +1 @@
1
- {"version":3,"file":"address-error.js","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe,EAAE,YAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,oCAUC"}
1
+ {"version":3,"file":"address-error.js","sourceRoot":"","sources":["../src/address-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAGrC,YAAY,OAAe,EAAE,YAAqB;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAE3B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;CACF;AAVD,oCAUC","sourcesContent":["export class AddressError extends Error {\n parseMessage?: string;\n\n constructor(message: string, parseMessage?: string) {\n super(message);\n\n this.name = 'AddressError';\n\n this.parseMessage = parseMessage;\n }\n}\n"]}
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isInSubnet = isInSubnet;
4
4
  exports.isCorrect = isCorrect;
5
+ exports.prefixLengthFromMask = prefixLengthFromMask;
5
6
  exports.numberToPaddedHex = numberToPaddedHex;
6
7
  exports.stringToPaddedHex = stringToPaddedHex;
7
8
  exports.testBit = testBit;
9
+ const address_error_1 = require("./address-error");
8
10
  function isInSubnet(address) {
9
11
  if (this.subnetMask < address.subnetMask) {
10
12
  return false;
@@ -25,6 +27,25 @@ function isCorrect(defaultBits) {
25
27
  return this.parsedSubnet === String(this.subnetMask);
26
28
  };
27
29
  }
30
+ /**
31
+ * Returns the prefix length (number of leading 1 bits) of a contiguous
32
+ * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.
33
+ * `255.0.255.0`).
34
+ */
35
+ function prefixLengthFromMask(value, totalBits) {
36
+ const binary = value.toString(2).padStart(totalBits, '0');
37
+ if (binary.length > totalBits) {
38
+ throw new address_error_1.AddressError('Invalid subnet mask.');
39
+ }
40
+ const firstZero = binary.indexOf('0');
41
+ if (firstZero === -1) {
42
+ return totalBits;
43
+ }
44
+ if (binary.slice(firstZero).includes('1')) {
45
+ throw new address_error_1.AddressError('Invalid subnet mask.');
46
+ }
47
+ return firstZero;
48
+ }
28
49
  function numberToPaddedHex(number) {
29
50
  return number.toString(16).padStart(2, '0');
30
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;AAOA,gCAUC;AAED,8BAYC;AAED,8CAEC;AAED,8CAEC;AAMD,0BASC;AA/CD,SAAgB,UAAU,CAA4B,OAA4B;IAChF,IAAI,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,WAAmB;IAC3C,OAAO;QACL,IAAI,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,KAAK,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,iBAAiB,CAAC,YAAoB;IACpD,OAAO,iBAAiB,CAAC,QAAQ,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;AACv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v4';\nimport { Address6 } from './ipv6';\nimport { AddressError } from './address-error';\n\nexport interface ReverseFormOptions {\n omitSuffix?: boolean;\n}\n\nexport function isInSubnet(this: Address4 | Address6, address: Address4 | Address6) {\n if (this.subnetMask < address.subnetMask) {\n return false;\n }\n\n if (this.mask(address.subnetMask) === address.mask()) {\n return true;\n }\n\n return false;\n}\n\nexport function isCorrect(defaultBits: number) {\n return function (this: Address4 | Address6) {\n if (this.addressMinusSuffix !== this.correctForm()) {\n return false;\n }\n\n if (this.subnetMask === defaultBits && !this.parsedSubnet) {\n return true;\n }\n\n return this.parsedSubnet === String(this.subnetMask);\n };\n}\n\n/**\n * Returns the prefix length (number of leading 1 bits) of a contiguous\n * subnet mask. Throws `AddressError` if the mask is non-contiguous (e.g.\n * `255.0.255.0`).\n */\nexport function prefixLengthFromMask(value: bigint, totalBits: number): number {\n const binary = value.toString(2).padStart(totalBits, '0');\n\n if (binary.length > totalBits) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n const firstZero = binary.indexOf('0');\n\n if (firstZero === -1) {\n return totalBits;\n }\n\n if (binary.slice(firstZero).includes('1')) {\n throw new AddressError('Invalid subnet mask.');\n }\n\n return firstZero;\n}\n\nexport function numberToPaddedHex(number: number) {\n return number.toString(16).padStart(2, '0');\n}\n\nexport function stringToPaddedHex(numberString: string) {\n return numberToPaddedHex(parseInt(numberString, 10));\n}\n\n/**\n * @param binaryValue Binary representation of a value (e.g. `10`)\n * @param position Byte position, where 0 is the least significant bit\n */\nexport function testBit(binaryValue: string, position: number): boolean {\n const { length } = binaryValue;\n\n if (position > length) {\n return false;\n }\n\n const positionInString = length - position;\n return binaryValue.substring(positionInString, positionInString + 1) === '1';\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"ip-address.js","sourceRoot":"","sources":["../src/ip-address.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,+BAAkC;AAAzB,gGAAA,QAAQ,OAAA;AACjB,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,sDAAwC;AAE3B,QAAA,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC","sourcesContent":["export { Address4 } from './ipv4';\nexport { Address6 } from './ipv6';\nexport { AddressError } from './address-error';\n\nimport * as helpers from './v6/helpers';\n\nexport const v6 = { helpers };\n"]}