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

Function getIdentifierInternal

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

Source from the content-addressed store, hash-verified

819}
820
821const getIdentifierInternal = (self: Instruction): Option.Option<string> => {
822 switch (self._tag) {
823 case "Empty": {
824 return Option.none()
825 }
826 case "Single": {
827 return Option.some(self.fullName)
828 }
829 case "Both":
830 case "OrElse": {
831 const ids = Arr.getSomes([
832 getIdentifierInternal(self.left as Instruction),
833 getIdentifierInternal(self.right as Instruction)
834 ])
835 return Arr.match(ids, {
836 onEmpty: () => Option.none(),
837 onNonEmpty: (ids) => Option.some(Arr.join(ids, ", "))
838 })
839 }
840 case "KeyValueMap":
841 case "Variadic": {
842 return getIdentifierInternal(self.argumentOption as Instruction)
843 }
844 case "Map":
845 case "WithFallback":
846 case "WithDefault": {
847 return getIdentifierInternal(self.options as Instruction)
848 }
849 }
850}
851
852const getMinSizeInternal = (self: Instruction): number => {
853 switch (self._tag) {

Callers 4

getIdentifierFunction · 0.70
getHelpInternalFunction · 0.70
parseInternalFunction · 0.70
wizardInternalFunction · 0.70

Calls 1

joinMethod · 0.65

Tested by

no test coverage detected