MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeVariadic

Function makeVariadic

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

Source from the content-addressed store, hash-verified

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