MCPcopy
hub / github.com/Effect-TS/effect / makeVariadic

Function makeVariadic

packages/cli/src/internal/options.ts:1039–1053  ·  view source on GitHub ↗
(
  argumentOption: Options.Options<A>,
  min: Option.Option<number>,
  max: Option.Option<number>
)

Source from the content-addressed store, hash-verified

1037}
1038
1039const makeVariadic = <A>(
1040 argumentOption: Options.Options<A>,
1041 min: Option.Option<number>,
1042 max: Option.Option<number>
1043): Options.Options<Array<A>> => {
1044 if (!isSingle(argumentOption as Instruction)) {
1045 throw new Error("InvalidArgumentException: only single options can be variadic")
1046 }
1047 const op = Object.create(proto)
1048 op._tag = "Variadic"
1049 op.argumentOption = argumentOption
1050 op.min = min
1051 op.max = max
1052 return op
1053}
1054
1055const makeWithDefault = <A, const B>(
1056 options: Options.Options<A>,

Callers 3

options.tsFile · 0.70
repeatedFunction · 0.70
modifySingleFunction · 0.70

Calls 2

createMethod · 0.80
isSingleFunction · 0.70

Tested by

no test coverage detected