app/lib/clipboard.ts
8 lines and 2 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| copyText | 6 to 8 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
| <anonymous:7> | 7 to 7 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
Imports
It imports no other module of this repo. Imported by app/components/admin/copy-button.tsx, app/components/admin/media-bulk-bar.tsx, app/components/admin/media-palette.tsx, app/enhance/blog.ts, app/enhance/cv.ts.
Source
/**
* Copies text to the clipboard. Wrapped in a promise because with no clipboard (an insecure
* context) the call throws before any promise exists, and every caller wants one failure path.
* Client-safe and dependency-free: the enhancement bundles import it.
*/
export function copyText(text: string): Promise<void> {
return Promise.resolve().then(() => navigator.clipboard.writeText(text));
}