MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / newMethod

Function newMethod

src/main/clipboard.ts:11–22  ·  view source on GitHub ↗
(...args: any[])

Source from the content-addressed store, hash-verified

9 descriptor: PropertyDescriptor
10) {
11 const newMethod = function (...args: any[]) {
12 if (target["clipboard"] == undefined) {
13 target["operations"].push({
14 key: propertyKey,
15 args,
16 });
17 return;
18 } else {
19 const clipboard = target["clipboard"];
20 return clipboard[propertyKey].call(clipboard, ...args);
21 }
22 };
23 descriptor.value = newMethod; // 替换原声明
24}
25

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
callMethod · 0.80

Tested by

no test coverage detected