Comparing version 1.0.0 to 1.0.1
10
index.js
export async function clippie(content) { | ||
if (content instanceof Blob) { | ||
const item = new ClipboardItem({[content.type]: content}); | ||
const item = new ClipboardItem({[content.type]: content}); // eslint-disable-line no-undef | ||
await navigator.clipboard.write([item]); | ||
@@ -9,3 +9,3 @@ } else { | ||
} catch { | ||
return fallbackCopyToClipboard(content); | ||
return fallback(content); | ||
} | ||
@@ -18,12 +18,12 @@ } | ||
if (!document.execCommand) return false; | ||
const tempTextArea = document.createElement('textarea'); | ||
const tempTextArea = document.createElement("textarea"); | ||
tempTextArea.value = text; | ||
tempTextArea.style.top = 0; | ||
tempTextArea.style.left = 0; | ||
tempTextArea.style.position = 'fixed'; | ||
tempTextArea.style.position = "fixed"; | ||
document.body.appendChild(tempTextArea); | ||
tempTextArea.select(); | ||
const success = document.execCommand('copy'); | ||
const success = document.execCommand("copy"); | ||
document.body.removeChild(tempTextArea); | ||
return success; | ||
} |
{ | ||
"name": "clippie", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Teeny-tiny browser clipboard copy", | ||
@@ -16,3 +16,3 @@ "author": "silverwind", | ||
"eslint": "8.28.0", | ||
"eslint-config-silverwind": "62.0.1", | ||
"eslint-config-silverwind": "63.0.0", | ||
"updates": "13.2.1", | ||
@@ -19,0 +19,0 @@ "versions": "10.2.4" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2200