@types/node 22.8.1 → 22.8.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 (3) hide show
  1. node/README.md +1 -1
  2. node/package.json +2 -2
  3. node/util.d.ts +11 -6
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 25 Oct 2024 22:02:20 GMT
11
+ * Last updated: Mon, 28 Oct 2024 20:34:09 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.8.1",
3
+ "version": "22.8.2",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~6.19.8"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "679317e7cae6b391e6bf63e356e0496420e31113098d850dbc95b3d22c17a6c6",
223
+ "typesPublisherContentHash": "cd80254255e433e4854a55c5aae4bfaa5e327e06832bf06cc80cb4140a43b754",
224
224
  "typeScriptVersion": "4.8"
225
225
  }
node/util.d.ts CHANGED
@@ -1517,18 +1517,23 @@ declare module "util" {
1517
1517
  string | boolean
1518
1518
  >;
1519
1519
 
1520
+ type ApplyOptionalModifiers<O extends ParseArgsOptionsConfig, V extends Record<keyof O, unknown>> = (
1521
+ & { -readonly [LongOption in keyof O]?: V[LongOption] }
1522
+ & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] }
1523
+ ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object
1524
+
1520
1525
  type ParsedValues<T extends ParseArgsConfig> =
1521
1526
  & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
1522
- & (T["options"] extends ParseArgsOptionsConfig ? {
1523
- -readonly [LongOption in keyof T["options"]]:
1524
- // when "default" is not undefined, the value will be present
1525
- | (T["options"][LongOption]["default"] extends {} ? never : undefined)
1526
- | IfDefaultsFalse<
1527
+ & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers<
1528
+ T["options"],
1529
+ {
1530
+ [LongOption in keyof T["options"]]: IfDefaultsFalse<
1527
1531
  T["options"][LongOption]["multiple"],
1528
1532
  Array<ExtractOptionValue<T, T["options"][LongOption]>>,
1529
1533
  ExtractOptionValue<T, T["options"][LongOption]>
1530
1534
  >;
1531
- }
1535
+ }
1536
+ >
1532
1537
  : {});
1533
1538
 
1534
1539
  type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<