MCPcopy Index your code
hub / github.com/Effect-TS/effect / getIdentifierInternal

Function getIdentifierInternal

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

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…