@optique/core 1.0.16-dev.2990 → 1.0.16-dev.2998

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/facade.cjs CHANGED
@@ -373,7 +373,10 @@ function createCompletionParser(programName, availableShells, commandConfig, opt
373
373
  hidden: optionConfig.hidden
374
374
  }));
375
375
  const completionOptionParser = completionOptions.length === 1 ? completionOptions[0] : require_constructs.longestMatch(...completionOptions);
376
- const argsParser = require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }), { description: require_message.message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), []);
376
+ const argsParser = require_modifiers.withDefault(require_modifiers.multiple(require_primitives.argument(require_valueparser.string({ metavar: "ARG" }), {
377
+ description: require_message.message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).`,
378
+ hidden: optionConfig.hidden
379
+ })), []);
377
380
  completionOption = require_constructs.object({
378
381
  shell: completionOptionParser,
379
382
  args: argsParser
package/dist/facade.js CHANGED
@@ -373,7 +373,10 @@ function createCompletionParser(programName, availableShells, commandConfig, opt
373
373
  hidden: optionConfig.hidden
374
374
  }));
375
375
  const completionOptionParser = completionOptions.length === 1 ? completionOptions[0] : longestMatch(...completionOptions);
376
- const argsParser = withDefault(multiple(argument(string({ metavar: "ARG" }), { description: message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).` })), []);
376
+ const argsParser = withDefault(multiple(argument(string({ metavar: "ARG" }), {
377
+ description: message`Command line arguments for completion suggestions (used by shell integration; you usually don't need to provide this).`,
378
+ hidden: optionConfig.hidden
379
+ })), []);
377
380
  completionOption = object({
378
381
  shell: completionOptionParser,
379
382
  args: argsParser
@@ -12,6 +12,7 @@ const require_extension = require('./extension.cjs');
12
12
  const require_dependency_metadata = require('./dependency-metadata.cjs');
13
13
 
14
14
  //#region src/modifiers.ts
15
+ const MULTIPLE_NATIVE_APPEND_THRESHOLD = 256;
15
16
  function isTerminalMultipleItemState(state) {
16
17
  const unwrapped = unwrapMultipleItemState(state).value;
17
18
  return unwrapped != null && typeof unwrapped === "object" && Object.hasOwn(unwrapped, "success") && typeof unwrapped.success === "boolean";
@@ -1048,7 +1049,7 @@ function multiple(parser, options = {}) {
1048
1049
  ...result.provisional ? { provisional: true } : {},
1049
1050
  next: {
1050
1051
  ...result.next,
1051
- state: require_annotations.annotateFreshArray(context.state, [...added ? context.state : context.state.slice(0, -1), nextItemState]),
1052
+ state: require_annotations.annotateFreshArray(context.state, itemIndex < MULTIPLE_NATIVE_APPEND_THRESHOLD ? [...added ? context.state : context.state.slice(0, -1), nextItemState] : [...added ? context.state : context.state.slice(0, -1)].toSpliced(Infinity, 0, nextItemState)),
1052
1053
  ...mergedExec != null ? {
1053
1054
  trace: mergedExec.trace,
1054
1055
  exec: mergedExec,
@@ -1128,7 +1129,7 @@ function multiple(parser, options = {}) {
1128
1129
  ...result.provisional ? { provisional: true } : {},
1129
1130
  next: {
1130
1131
  ...result.next,
1131
- state: require_annotations.annotateFreshArray(context.state, [...added ? context.state : context.state.slice(0, -1), nextItemState]),
1132
+ state: require_annotations.annotateFreshArray(context.state, itemIndex < MULTIPLE_NATIVE_APPEND_THRESHOLD ? [...added ? context.state : context.state.slice(0, -1), nextItemState] : [...added ? context.state : context.state.slice(0, -1)].toSpliced(Infinity, 0, nextItemState)),
1132
1133
  ...mergedExec != null ? {
1133
1134
  trace: mergedExec.trace,
1134
1135
  exec: mergedExec,
package/dist/modifiers.js CHANGED
@@ -12,6 +12,7 @@ import { defineTraits, getTraits } from "./extension.js";
12
12
  import { composeDependencyMetadata } from "./dependency-metadata.js";
13
13
 
14
14
  //#region src/modifiers.ts
15
+ const MULTIPLE_NATIVE_APPEND_THRESHOLD = 256;
15
16
  function isTerminalMultipleItemState(state) {
16
17
  const unwrapped = unwrapMultipleItemState(state).value;
17
18
  return unwrapped != null && typeof unwrapped === "object" && Object.hasOwn(unwrapped, "success") && typeof unwrapped.success === "boolean";
@@ -1048,7 +1049,7 @@ function multiple(parser, options = {}) {
1048
1049
  ...result.provisional ? { provisional: true } : {},
1049
1050
  next: {
1050
1051
  ...result.next,
1051
- state: annotateFreshArray(context.state, [...added ? context.state : context.state.slice(0, -1), nextItemState]),
1052
+ state: annotateFreshArray(context.state, itemIndex < MULTIPLE_NATIVE_APPEND_THRESHOLD ? [...added ? context.state : context.state.slice(0, -1), nextItemState] : [...added ? context.state : context.state.slice(0, -1)].toSpliced(Infinity, 0, nextItemState)),
1052
1053
  ...mergedExec != null ? {
1053
1054
  trace: mergedExec.trace,
1054
1055
  exec: mergedExec,
@@ -1128,7 +1129,7 @@ function multiple(parser, options = {}) {
1128
1129
  ...result.provisional ? { provisional: true } : {},
1129
1130
  next: {
1130
1131
  ...result.next,
1131
- state: annotateFreshArray(context.state, [...added ? context.state : context.state.slice(0, -1), nextItemState]),
1132
+ state: annotateFreshArray(context.state, itemIndex < MULTIPLE_NATIVE_APPEND_THRESHOLD ? [...added ? context.state : context.state.slice(0, -1), nextItemState] : [...added ? context.state : context.state.slice(0, -1)].toSpliced(Infinity, 0, nextItemState)),
1132
1133
  ...mergedExec != null ? {
1133
1134
  trace: mergedExec.trace,
1134
1135
  exec: mergedExec,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.16-dev.2990",
3
+ "version": "1.0.16-dev.2998",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",