@optique/core 1.1.0-dev.2069 → 1.1.0-dev.2070

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.
@@ -162,7 +162,7 @@ function _${programName} () {
162
162
 
163
163
  # Pre-expand file candidates. When the glob base came from the
164
164
  # program's pattern and contains wildcard characters (* or ?),
165
- # use it as-is via compgen -G (safe no command substitution).
165
+ # use it as-is via compgen -G (safe—no command substitution).
166
166
  # Otherwise append * to treat it as a prefix.
167
167
  # Note: [ is NOT treated as a glob indicator because it commonly
168
168
  # appears in literal filenames like [draft] or foo[1].txt.
@@ -375,7 +375,7 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
375
375
  [[ "\$__compare_pattern" == */* ]] && __compare_pattern="\${__compare_pattern%/*}/" || __compare_pattern=""
376
376
  fi
377
377
  if [[ ( -n "\$__compare_pattern" || -n "\$__norm_prefix" ) && \${#__norm_prefix} -ge \${#__compare_pattern} && "\${__norm_prefix[1,\${#__compare_pattern}]}" == "\$__compare_pattern" && "\$PREFIX" != "\$pattern" ]]; then
378
- # User typed an equivalent or extended form keep PREFIX
378
+ # User typed an equivalent or extended form—keep PREFIX
379
379
  true
380
380
  else
381
381
  PREFIX="\$pattern"
@@ -536,7 +536,7 @@ ${escapedArgs ? ` set -l output (${programName} ${escapedArgs} $prev $current
536
536
  end
537
537
  end
538
538
 
539
- # Expand tilde prefix for globbing fish does not expand ~
539
+ # Expand tilde prefix for globbing—fish does not expand ~
540
540
  # inside variable substitutions, so replace it with $HOME
541
541
  if string match -q '~/*' -- "$glob_base"
542
542
  set __tilde_prefix "~"
@@ -1186,7 +1186,7 @@ ${escapedArgs ? ` \$completionArgs += @(${escapedArgs})
1186
1186
  \$prefix = \$prefix + '/'
1187
1187
  }
1188
1188
 
1189
- # Build the glob path when the prefix contains wildcard
1189
+ # Build the glob path—when the prefix contains wildcard
1190
1190
  # characters, use it as-is; otherwise append *
1191
1191
  \$globPath = if (\$prefix -match '[\*\?]') { \$prefix } else { "\${prefix}*" }
1192
1192
 
@@ -162,7 +162,7 @@ function _${programName} () {
162
162
 
163
163
  # Pre-expand file candidates. When the glob base came from the
164
164
  # program's pattern and contains wildcard characters (* or ?),
165
- # use it as-is via compgen -G (safe no command substitution).
165
+ # use it as-is via compgen -G (safe—no command substitution).
166
166
  # Otherwise append * to treat it as a prefix.
167
167
  # Note: [ is NOT treated as a glob indicator because it commonly
168
168
  # appears in literal filenames like [draft] or foo[1].txt.
@@ -375,7 +375,7 @@ function _${programName.replace(/[^a-zA-Z0-9]/g, "_")} () {
375
375
  [[ "\$__compare_pattern" == */* ]] && __compare_pattern="\${__compare_pattern%/*}/" || __compare_pattern=""
376
376
  fi
377
377
  if [[ ( -n "\$__compare_pattern" || -n "\$__norm_prefix" ) && \${#__norm_prefix} -ge \${#__compare_pattern} && "\${__norm_prefix[1,\${#__compare_pattern}]}" == "\$__compare_pattern" && "\$PREFIX" != "\$pattern" ]]; then
378
- # User typed an equivalent or extended form keep PREFIX
378
+ # User typed an equivalent or extended form—keep PREFIX
379
379
  true
380
380
  else
381
381
  PREFIX="\$pattern"
@@ -536,7 +536,7 @@ ${escapedArgs ? ` set -l output (${programName} ${escapedArgs} $prev $current
536
536
  end
537
537
  end
538
538
 
539
- # Expand tilde prefix for globbing fish does not expand ~
539
+ # Expand tilde prefix for globbing—fish does not expand ~
540
540
  # inside variable substitutions, so replace it with $HOME
541
541
  if string match -q '~/*' -- "$glob_base"
542
542
  set __tilde_prefix "~"
@@ -1186,7 +1186,7 @@ ${escapedArgs ? ` \$completionArgs += @(${escapedArgs})
1186
1186
  \$prefix = \$prefix + '/'
1187
1187
  }
1188
1188
 
1189
- # Build the glob path when the prefix contains wildcard
1189
+ # Build the glob path—when the prefix contains wildcard
1190
1190
  # characters, use it as-is; otherwise append *
1191
1191
  \$globPath = if (\$prefix -match '[\*\?]') { \$prefix } else { "\${prefix}*" }
1192
1192
 
@@ -1597,7 +1597,7 @@ function filterExcludedFieldParsers(pairs, excludedFields) {
1597
1597
  /**
1598
1598
  * Pre-completes dependency source fields and registers their values in
1599
1599
  * the given registry. Unlike `completeDependencySourceDefaults()` (used
1600
- * by suggest), this function handles all four Phase 1 cases including
1600
+ * by suggest), this function handles all four Phase 1 cases—including
1601
1601
  * PendingDependencySourceState in arrays and wrappedDependencySourceMarker.
1602
1602
  *
1603
1603
  * The original state is NOT modified; only the registry is populated.
@@ -1597,7 +1597,7 @@ function filterExcludedFieldParsers(pairs, excludedFields) {
1597
1597
  /**
1598
1598
  * Pre-completes dependency source fields and registers their values in
1599
1599
  * the given registry. Unlike `completeDependencySourceDefaults()` (used
1600
- * by suggest), this function handles all four Phase 1 cases including
1600
+ * by suggest), this function handles all four Phase 1 cases—including
1601
1601
  * PendingDependencySourceState in arrays and wrappedDependencySourceMarker.
1602
1602
  *
1603
1603
  * The original state is NOT modified; only the registry is populated.
@@ -20,13 +20,13 @@ interface DependencySourceCapability {
20
20
  * The `state` argument is the current parser state for the source-owning
21
21
  * parser. Each wrapper composes this method to handle its own state shape:
22
22
  * - plain source: reads from `DependencySourceState`
23
- * - `optional()` / `withDefault()`: unwraps `[innerState]` first
23
+ * - `optional()`/`withDefault()`: unwraps `[innerState]` first
24
24
  * - `map()`: reads the pre-transform value from inner state
25
25
  *
26
26
  * Returns the `ValueParserResult` (which may be successful with any
27
27
  * value including `undefined`, or failed), a promise that resolves to the
28
28
  * same shape when extraction needs async work, or `undefined` if the state
29
- * does not contain a source result at all (unpopulated / wrong shape).
29
+ * does not contain a source result at all (unpopulated/wrong shape).
30
30
  * Callers and wrapper authors must handle both direct and promise-wrapped
31
31
  * results when composing `extractSourceValue`.
32
32
  */
@@ -20,13 +20,13 @@ interface DependencySourceCapability {
20
20
  * The `state` argument is the current parser state for the source-owning
21
21
  * parser. Each wrapper composes this method to handle its own state shape:
22
22
  * - plain source: reads from `DependencySourceState`
23
- * - `optional()` / `withDefault()`: unwraps `[innerState]` first
23
+ * - `optional()`/`withDefault()`: unwraps `[innerState]` first
24
24
  * - `map()`: reads the pre-transform value from inner state
25
25
  *
26
26
  * Returns the `ValueParserResult` (which may be successful with any
27
27
  * value including `undefined`, or failed), a promise that resolves to the
28
28
  * same shape when extraction needs async work, or `undefined` if the state
29
- * does not contain a source result at all (unpopulated / wrong shape).
29
+ * does not contain a source result at all (unpopulated/wrong shape).
30
30
  * Callers and wrapper authors must handle both direct and promise-wrapped
31
31
  * results when composing `extractSourceValue`.
32
32
  */
@@ -112,7 +112,7 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
112
112
  *
113
113
  * Each built-in combinator computes this from its structural semantics.
114
114
  * Custom parser implementations must include every fixed token that
115
- * the parser accepts at `argv[0]` — command names, option names, and
115
+ * the parser accepts at `argv[0]`—command names, option names, and
116
116
  * literal values alike. For example, a parser whose usage declares
117
117
  * `{ type: "literal", value: "serve" }` should include `"serve"` in
118
118
  * this set. Parsers that accept *any* token (like `argument()`) should
@@ -265,8 +265,8 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
265
265
  * parser (e.g., regex patterns, numeric bounds, `choice()` values).
266
266
  *
267
267
  * Wrappers like `bindEnv()` and `bindConfig()` call this on fallback
268
- * values environment variables parsed by a looser env parser,
269
- * configured defaults, and values loaded from config files so that
268
+ * values—environment variables parsed by a looser env parser,
269
+ * configured defaults, and values loaded from config files—so that
270
270
  * those values obey the same validation semantics as CLI input.
271
271
  * Without it, parser constraints can be silently bypassed through
272
272
  * fallback paths.
@@ -292,7 +292,7 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
292
292
  * current dependency value, and custom value parsers whose `format()`
293
293
  * intentionally throws for unsupported inputs. Values that
294
294
  * `format()` successfully serializes to a string are always re-parsed,
295
- * and any resulting parse failure is propagated they represent the
295
+ * and any resulting parse failure is propagated—they represent the
296
296
  * bug class this method exists to surface.
297
297
  *
298
298
  * @param value The candidate value to validate.
@@ -413,7 +413,7 @@ interface ExecutionContext {
413
413
  * `preCompleteAndRegisterDependencies` results directly to children
414
414
  * in Phase 3. Children read it in their own Phase 1 to avoid
415
415
  * re-evaluating non-idempotent default thunks, but never write to
416
- * it this prevents sibling completions from leaking into each
416
+ * it—this prevents sibling completions from leaking into each
417
417
  * other.
418
418
  *
419
419
  * Field-name keying naturally handles parser reuse across different
@@ -112,7 +112,7 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
112
112
  *
113
113
  * Each built-in combinator computes this from its structural semantics.
114
114
  * Custom parser implementations must include every fixed token that
115
- * the parser accepts at `argv[0]` — command names, option names, and
115
+ * the parser accepts at `argv[0]`—command names, option names, and
116
116
  * literal values alike. For example, a parser whose usage declares
117
117
  * `{ type: "literal", value: "serve" }` should include `"serve"` in
118
118
  * this set. Parsers that accept *any* token (like `argument()`) should
@@ -265,8 +265,8 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
265
265
  * parser (e.g., regex patterns, numeric bounds, `choice()` values).
266
266
  *
267
267
  * Wrappers like `bindEnv()` and `bindConfig()` call this on fallback
268
- * values environment variables parsed by a looser env parser,
269
- * configured defaults, and values loaded from config files so that
268
+ * values—environment variables parsed by a looser env parser,
269
+ * configured defaults, and values loaded from config files—so that
270
270
  * those values obey the same validation semantics as CLI input.
271
271
  * Without it, parser constraints can be silently bypassed through
272
272
  * fallback paths.
@@ -292,7 +292,7 @@ interface Parser<M extends Mode = "sync", TValue = unknown, TState = unknown> {
292
292
  * current dependency value, and custom value parsers whose `format()`
293
293
  * intentionally throws for unsupported inputs. Values that
294
294
  * `format()` successfully serializes to a string are always re-parsed,
295
- * and any resulting parse failure is propagated they represent the
295
+ * and any resulting parse failure is propagated—they represent the
296
296
  * bug class this method exists to surface.
297
297
  *
298
298
  * @param value The candidate value to validate.
@@ -413,7 +413,7 @@ interface ExecutionContext {
413
413
  * `preCompleteAndRegisterDependencies` results directly to children
414
414
  * in Phase 3. Children read it in their own Phase 1 to avoid
415
415
  * re-evaluating non-idempotent default thunks, but never write to
416
- * it this prevents sibling completions from leaking into each
416
+ * it—this prevents sibling completions from leaking into each
417
417
  * other.
418
418
  *
419
419
  * Field-name keying naturally handles parser reuse across different
@@ -142,14 +142,14 @@ function extractOptionalLikePhase2Seed(parser, state, exec) {
142
142
  }
143
143
  /**
144
144
  * Computes the inner state to pass through to the wrapped parser inside
145
- * {@link optional} / {@link withDefault}. When the outer state is an
145
+ * {@link optional}/{@link withDefault}. When the outer state is an
146
146
  * array, the inner state is `state[0]`. Otherwise, including the
147
147
  * common case where `optional()` sits at top level and the outer state
148
- * is either `undefined` or an annotation wrapper from `parseOptionalLike`
149
- * / `parse({ annotations })`, we use the wrapped parser's
148
+ * is either `undefined` or an annotation wrapper from `parseOptionalLike`/
149
+ * `parse({ annotations })`, we use the wrapped parser's
150
150
  * `initialState`, propagating annotations from the outer state so that
151
- * source-binding wrappers under `optional()` / `withDefault()` (e.g.,
152
- * `bindEnv()` / `bindConfig()`) can resolve their fallbacks.
151
+ * source-binding wrappers under `optional()`/`withDefault()` (e.g.,
152
+ * `bindEnv()`/`bindConfig()`) can resolve their fallbacks.
153
153
  *
154
154
  * @internal
155
155
  */
@@ -677,7 +677,7 @@ function withDefault(parser, defaultValue, options) {
677
677
  *
678
678
  * Because the `deferred` flag is propagated conservatively, mapped scalar
679
679
  * results are treated as missing (`undefined`) during phase-two context
680
- * collection even when `transform` only used non-deferred fields.
680
+ * collection—even when `transform` only used non-deferred fields.
681
681
  * For example, `map(object({ apiKey: prompt(...), mode: option(...) }),
682
682
  * v => v.mode)` makes phase-two contexts see `undefined` instead of the
683
683
  * real `mode` value. This is the intentional trade-off: the alternative
@@ -138,7 +138,7 @@ declare function withDefault<M extends Mode, TValue, TState, const TDefault = TV
138
138
  *
139
139
  * Because the `deferred` flag is propagated conservatively, mapped scalar
140
140
  * results are treated as missing (`undefined`) during phase-two context
141
- * collection even when `transform` only used non-deferred fields.
141
+ * collection—even when `transform` only used non-deferred fields.
142
142
  * For example, `map(object({ apiKey: prompt(...), mode: option(...) }),
143
143
  * v => v.mode)` makes phase-two contexts see `undefined` instead of the
144
144
  * real `mode` value. This is the intentional trade-off: the alternative
@@ -138,7 +138,7 @@ declare function withDefault<M extends Mode, TValue, TState, const TDefault = TV
138
138
  *
139
139
  * Because the `deferred` flag is propagated conservatively, mapped scalar
140
140
  * results are treated as missing (`undefined`) during phase-two context
141
- * collection even when `transform` only used non-deferred fields.
141
+ * collection—even when `transform` only used non-deferred fields.
142
142
  * For example, `map(object({ apiKey: prompt(...), mode: option(...) }),
143
143
  * v => v.mode)` makes phase-two contexts see `undefined` instead of the
144
144
  * real `mode` value. This is the intentional trade-off: the alternative
package/dist/modifiers.js CHANGED
@@ -142,14 +142,14 @@ function extractOptionalLikePhase2Seed(parser, state, exec) {
142
142
  }
143
143
  /**
144
144
  * Computes the inner state to pass through to the wrapped parser inside
145
- * {@link optional} / {@link withDefault}. When the outer state is an
145
+ * {@link optional}/{@link withDefault}. When the outer state is an
146
146
  * array, the inner state is `state[0]`. Otherwise, including the
147
147
  * common case where `optional()` sits at top level and the outer state
148
- * is either `undefined` or an annotation wrapper from `parseOptionalLike`
149
- * / `parse({ annotations })`, we use the wrapped parser's
148
+ * is either `undefined` or an annotation wrapper from `parseOptionalLike`/
149
+ * `parse({ annotations })`, we use the wrapped parser's
150
150
  * `initialState`, propagating annotations from the outer state so that
151
- * source-binding wrappers under `optional()` / `withDefault()` (e.g.,
152
- * `bindEnv()` / `bindConfig()`) can resolve their fallbacks.
151
+ * source-binding wrappers under `optional()`/`withDefault()` (e.g.,
152
+ * `bindEnv()`/`bindConfig()`) can resolve their fallbacks.
153
153
  *
154
154
  * @internal
155
155
  */
@@ -677,7 +677,7 @@ function withDefault(parser, defaultValue, options) {
677
677
  *
678
678
  * Because the `deferred` flag is propagated conservatively, mapped scalar
679
679
  * results are treated as missing (`undefined`) during phase-two context
680
- * collection even when `transform` only used non-deferred fields.
680
+ * collection—even when `transform` only used non-deferred fields.
681
681
  * For example, `map(object({ apiKey: prompt(...), mode: option(...) }),
682
682
  * v => v.mode)` makes phase-two contexts see `undefined` instead of the
683
683
  * real `mode` value. This is the intentional trade-off: the alternative
@@ -55,7 +55,7 @@ function collectLeadingCandidates(terms, optionNames, commandNames) {
55
55
  *
56
56
  * This is the command-only projection of {@link collectLeadingCandidates}
57
57
  * and is used to generate accurate "Did you mean?" suggestions in
58
- * `command()` error messages suggestions are scoped to commands actually
58
+ * `command()` error messages—suggestions are scoped to commands actually
59
59
  * reachable at the current parse position rather than all commands anywhere
60
60
  * in the usage tree.
61
61
  *
@@ -55,7 +55,7 @@ function collectLeadingCandidates(terms, optionNames, commandNames) {
55
55
  *
56
56
  * This is the command-only projection of {@link collectLeadingCandidates}
57
57
  * and is used to generate accurate "Did you mean?" suggestions in
58
- * `command()` error messages suggestions are scoped to commands actually
58
+ * `command()` error messages—suggestions are scoped to commands actually
59
59
  * reachable at the current parse position rather than all commands anywhere
60
60
  * in the usage tree.
61
61
  *
@@ -161,7 +161,7 @@ type ValueParserResult<T> = {
161
161
  * A recursive map that tracks which fields in a parsed object hold deferred
162
162
  * placeholder values. Each entry maps a property key to either `null`
163
163
  * (the field is fully deferred and should be replaced with `undefined`)
164
- * or another `DeferredMap` (the field is partially deferred recurse into
164
+ * or another `DeferredMap` (the field is partially deferred—recurse into
165
165
  * its sub-fields).
166
166
  *
167
167
  * @since 1.0.0
@@ -161,7 +161,7 @@ type ValueParserResult<T> = {
161
161
  * A recursive map that tracks which fields in a parsed object hold deferred
162
162
  * placeholder values. Each entry maps a property key to either `null`
163
163
  * (the field is fully deferred and should be replaced with `undefined`)
164
- * or another `DeferredMap` (the field is partially deferred recurse into
164
+ * or another `DeferredMap` (the field is partially deferred—recurse into
165
165
  * its sub-fields).
166
166
  *
167
167
  * @since 1.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.1.0-dev.2069",
3
+ "version": "1.1.0-dev.2070",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",