New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

clippie

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clippie - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

24

index.js
export async function clippie(content) {
for (const c of Array.isArray(content) ? content : [content]) {
if (c instanceof Blob) {
const item = new ClipboardItem({[c.type]: c});
await navigator.clipboard.write([item]);
} else {
try {
await navigator.clipboard.writeText(c);
} catch {
return fallback(c);
try {
for (const c of Array.isArray(content) ? content : [content]) {
if (c instanceof Blob) {
const item = new ClipboardItem({[c.type]: c});
await navigator.clipboard.write([item]);
} else {
try {
await navigator.clipboard.writeText(c);
} catch {
return fallback(c);
}
}
}
return true;
} catch {
return false;
}
return true;
}

@@ -16,0 +20,0 @@

{
"name": "clippie",
"version": "3.0.0",
"version": "3.0.1",
"description": "Teeny-tiny browser clipboard copy",

@@ -5,0 +5,0 @@ "author": "silverwind",

@@ -11,8 +11,7 @@ # clippie

let success;
try {
success = await clippie(stringOrBlob);
} catch {
success = false;
}
// copy text
const success = await clippie("text to copy");
// copy image
const success = await clippie(imageBlob);
```

@@ -25,3 +24,3 @@

Returns a boolean indicating success. May throw critical errors.
Returns `true` when successful and `false` when not. Will never throw.

@@ -28,0 +27,0 @@ ## Notes

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc