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

Function toParseableInstruction

packages/cli/src/internal/options.ts:1157–1180  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

1155}
1156
1157const toParseableInstruction = (self: Instruction): Array<ParseableInstruction> => {
1158 switch (self._tag) {
1159 case "Empty": {
1160 return Arr.empty()
1161 }
1162 case "Single":
1163 case "KeyValueMap":
1164 case "Variadic": {
1165 return Arr.of(self)
1166 }
1167 case "Map":
1168 case "WithDefault":
1169 case "WithFallback": {
1170 return toParseableInstruction(self.options as Instruction)
1171 }
1172 case "Both":
1173 case "OrElse": {
1174 return Arr.appendAll(
1175 toParseableInstruction(self.left as Instruction),
1176 toParseableInstruction(self.right as Instruction)
1177 )
1178 }
1179 }
1180}
1181
1182/** @internal */
1183const keyValueSplitter = /=(.*)/

Callers 1

options.tsFile · 0.85

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected