You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
393 B

1 month ago
  1. /* eslint-env browser */
  2. 'use strict';
  3. export const write = async text => {
  4. await navigator.clipboard.writeText(text);
  5. };
  6. export const read = async () => navigator.clipboard.readText();
  7. export const readSync = () => {
  8. throw new Error('`.readSync()` is not supported in browsers!');
  9. };
  10. export const writeSync = () => {
  11. throw new Error('`.writeSync()` is not supported in browsers!');
  12. };