MCPcopy Index your code
hub / github.com/devspace-sh/devspace / copyToClipboard

Function copyToClipboard

ui/src/lib/utils.tsx:85–99  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

83 document.body.removeChild(textArea);
84};
85export function copyToClipboard(text: string) {
86 if (!(navigator as any).clipboard) {
87 fallbackCopyTextToClipboard(text);
88 return;
89 }
90
91 (navigator as any).clipboard.writeText(text).then(
92 () => {
93 console.log('Async: Copying to clipboard was successful!');
94 },
95 (err: Error) => {
96 console.error('Async: Could not copy text: ', err);
97 }
98 );
99}
100
101export const deepCopy: <T>(obj: T) => T = (obj: any) => {
102 if (!obj) {

Callers 1

CopyButtonFunction · 0.90

Calls 1

Tested by

no test coverage detected