astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
33 lines (32 loc) • 643 B
JavaScript
import { writeText } from "tinyclip";
class TinyclipClipboard {
constructor({
logger,
prompt
}) {
this.
this.
}
async copy(text) {
if (!await this.
message: "Copy to clipboard?",
defaultValue: true
})) {
return;
}
try {
await writeText(text.trim());
this.
} catch {
this.
"SKIP_FORMAT",
"Sorry, something went wrong! Please copy the text above manually."
);
}
}
}
export {
TinyclipClipboard
};