MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / copyText

Function copyText

src/pages/markdownPreview/index.js:174–186  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

172}
173
174async function copyText(text) {
175 if (cordova?.plugins?.clipboard) {
176 cordova.plugins.clipboard.copy(text);
177 return;
178 }
179
180 if (navigator.clipboard?.writeText) {
181 await navigator.clipboard.writeText(text);
182 return;
183 }
184
185 throw new Error("Clipboard API unavailable");
186}
187
188async function fileToObjectUrl(file) {
189 const fs = fsOperation(file);

Callers 1

enhanceCodeBlocksFunction · 0.85

Calls 2

writeTextMethod · 0.80
copyMethod · 0.65

Tested by

no test coverage detected