Revenge/src/lib/utils/copyText.ts
2023-02-26 22:56:36 +00:00

11 lines
No EOL
304 B
TypeScript

import { clipboard } from "@metro/common";
// TODO: Remove/deprecate this, the clipboard module works the same way.
export default function copyText(content: string) {
try {
clipboard.setString(content);
} catch (e) {
throw new Error("Failed to set clipboard content.");
}
}