@optique/run 1.0.0-dev.588 → 1.0.0-dev.592

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/dist/run.d.cts CHANGED
@@ -240,12 +240,14 @@ type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext
240
240
  * Rejects option shapes that may carry a non-empty `contexts` array so plain
241
241
  * Program overloads do not bypass the context-aware overloads.
242
242
  */
243
- type RejectContextfulOptions<TOptions> = TOptions extends {
243
+ type ContextsFromOptions<TOptions> = [Exclude<TOptions, undefined>] extends [never] ? undefined : Exclude<TOptions, undefined> extends {
244
244
  readonly contexts?: infer TContexts extends readonly SourceContext<unknown>[] | undefined;
245
- } ? [TContexts] extends [undefined | readonly []] ? unknown : never : unknown;
245
+ } ? TContexts : undefined;
246
+ type RejectContextfulOptions<TOptions> = [ContextsFromOptions<TOptions>] extends [undefined | readonly []] ? unknown : never;
246
247
  /**
247
248
  * Rejects option shapes that introduce keys outside the public `RunOptions`
248
- * contract, preserving excess-property checks for direct object literals.
249
+ * contract, preserving typo detection for direct object literals and wider
250
+ * option variables.
249
251
  */
250
252
  type RejectUnknownRunOptionKeys<TOptions> = [TOptions] extends [undefined] ? unknown : Exclude<keyof TOptions, keyof RunOptions> extends never ? unknown : never;
251
253
  /**
package/dist/run.d.ts CHANGED
@@ -240,12 +240,14 @@ type NonEmptySourceContexts = readonly [SourceContext<unknown>, ...SourceContext
240
240
  * Rejects option shapes that may carry a non-empty `contexts` array so plain
241
241
  * Program overloads do not bypass the context-aware overloads.
242
242
  */
243
- type RejectContextfulOptions<TOptions> = TOptions extends {
243
+ type ContextsFromOptions<TOptions> = [Exclude<TOptions, undefined>] extends [never] ? undefined : Exclude<TOptions, undefined> extends {
244
244
  readonly contexts?: infer TContexts extends readonly SourceContext<unknown>[] | undefined;
245
- } ? [TContexts] extends [undefined | readonly []] ? unknown : never : unknown;
245
+ } ? TContexts : undefined;
246
+ type RejectContextfulOptions<TOptions> = [ContextsFromOptions<TOptions>] extends [undefined | readonly []] ? unknown : never;
246
247
  /**
247
248
  * Rejects option shapes that introduce keys outside the public `RunOptions`
248
- * contract, preserving excess-property checks for direct object literals.
249
+ * contract, preserving typo detection for direct object literals and wider
250
+ * option variables.
249
251
  */
250
252
  type RejectUnknownRunOptionKeys<TOptions> = [TOptions] extends [undefined] ? unknown : Exclude<keyof TOptions, keyof RunOptions> extends never ? unknown : never;
251
253
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/run",
3
- "version": "1.0.0-dev.588+73f34b2e",
3
+ "version": "1.0.0-dev.592+7e14faca",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "sideEffects": false,
72
72
  "dependencies": {
73
- "@optique/core": "1.0.0-dev.588+73f34b2e"
73
+ "@optique/core": "1.0.0-dev.592+7e14faca"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/node": "^20.19.9",