MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / getAction

Method getAction

src/common/action.ts:100–110  ·  view source on GitHub ↗
(identifier: Identifier)

Source from the content-addressed store, hash-verified

98 }
99
100 getAction(identifier: Identifier): ActionView {
101 if (!this.actions.has(identifier)) {
102 logger.toast(`动作 ${identifier} 不存在`);
103 return { id: identifier, type: "normal" } as ActionView;
104 }
105 const action = this.actions.get(identifier) as ActionView;
106 if (action && action.subMenuGenerator) {
107 action.submenu = action.subMenuGenerator(action.id);
108 }
109 return action;
110 }
111
112 append(action: ActionInitOpt) {
113 if (!action.actionType) {

Callers 4

dispatchMethod · 0.95
filterByCateMethod · 0.95
getKeysMethod · 0.95
getMenuMethod · 0.80

Calls 3

toastMethod · 0.80
hasMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected