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

Function toParseableInstruction

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

Source from the content-addressed store, hash-verified

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

Callers 1

options.tsFile · 0.85

Calls 1

ofMethod · 0.65

Tested by

no test coverage detected