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

Function getChoicesInternal

packages/cli/src/internal/primitive.ts:267–291  ·  view source on GitHub ↗
(self: Instruction)

Source from the content-addressed store, hash-verified

265// =============================================================================
266
267const getChoicesInternal = (self: Instruction): Option.Option<string> => {
268 switch (self._tag) {
269 case "Bool": {
270 return Option.some("true | false")
271 }
272 case "Choice": {
273 const choices = pipe(
274 Arr.map(self.alternatives, ([choice]) => choice),
275 Arr.join(" | ")
276 )
277 return Option.some(choices)
278 }
279 case "DateTime": {
280 return Option.some("date")
281 }
282 case "Float":
283 case "Integer":
284 case "Path":
285 case "Redacted":
286 case "Secret":
287 case "Text": {
288 return Option.none()
289 }
290 }
291}
292
293const getHelpInternal = (self: Instruction): Span.Span => {
294 switch (self._tag) {

Callers 1

getChoicesFunction · 0.85

Calls 3

pipeFunction · 0.70
mapMethod · 0.65
joinMethod · 0.65

Tested by

no test coverage detected