clipboard-copy
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -16,3 +16,3 @@ /*! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ | ||
} | ||
await navigator.clipboard.writeText(text) | ||
return navigator.clipboard.writeText(text) | ||
} | ||
@@ -44,3 +44,2 @@ | ||
success = window.document.execCommand('copy') | ||
if (!success) throw makeError() | ||
} finally { | ||
@@ -51,2 +50,4 @@ // Cleanup | ||
} | ||
if (!success) throw makeError() | ||
} | ||
@@ -65,4 +66,2 @@ | ||
} | ||
return Promise.resolve() | ||
} |
{ | ||
"name": "clipboard-copy", | ||
"description": "Lightweight copy to clipboard for the web", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
@@ -55,3 +55,3 @@ # clipboard-copy [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![size][size-image]][size-url] [![javascript style guide][standard-image]][standard-url] | ||
- **`clipboard-copy` (this package): [433 B gzipped](https://bundlephobia.com/result?p=clipboard-copy)** | ||
- **`clipboard-copy` (this package): [524 B gzipped](https://bundlephobia.com/result?p=clipboard-copy)** | ||
- [`clipboard-js`](https://www.npmjs.com/package/clipboard-js): [1.7 kB gzipped](https://bundlephobia.com/result?p=clipboard-js) | ||
@@ -58,0 +58,0 @@ - [`clipboard`](https://www.npmjs.com/package/clipboard): [3.2 kB gzipped](https://bundlephobia.com/result?p=clipboard) |
6603
55