Socket
Socket
Sign inDemoInstall

copy-to-clipboard-ultralight

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.13 to 1.0.14

README.zh-CN.md

0

dist/index.d.ts
declare function ultralightCopy(sourceStr?: string): boolean;
export default ultralightCopy;
function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document;try{var n=t.createElement("input");return n.setAttribute("readonly","readonly"),n.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),n.setAttribute("value",e),t.body.appendChild(n),n.setSelectionRange(0,e.length),n.select(),t.execCommand("copy"),t.body.removeChild(n),!0}catch(e){return!1}}export default e;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).ultralightCopy=t()}(this,(function(){"use strict";return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document;try{var n=t.createElement("input");return n.setAttribute("readonly","readonly"),n.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),n.setAttribute("value",e),t.body.appendChild(n),n.setSelectionRange(0,e.length),n.select(),t.execCommand("copy"),t.body.removeChild(n),!0}catch(e){return!1}}}));

4

package.json
{
"name": "copy-to-clipboard-ultralight",
"version": "1.0.13",
"description": "Copy text to clipboard, support TypeScript.",
"version": "1.0.14",
"description": "Copy text to clipboard, support TypeScript. Smaller than 1kb",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -6,10 +6,12 @@ # copy-to-clipboard-ultralight

A 🚀 ultralight tool ( **596Byte** ) that can copy a string to system clipboard.
Language : English | [中文](./README.zh-CN.md)
⚠️ Wide browser support, for example IE >= 10.
🚀 A ultralight tool ( **596Byte** ) that can copy a string to system clipboard.
🔑 UMD module & ESModule, offer .d.ts file to support Typescript.
💫 Wide browser support, for example IE >= 9.
📦 UMD module & ESModule, offer .d.ts file to support Typescript.git
### Install

@@ -31,2 +33,4 @@

[CodeSandBox online demo](https://codesandbox.io/s/copy-to-clipboard-ultralight-demo-g1851)
[Online demo](https://www.huangyn.icu/temp-html/copy-to-clipboard-ultralight-demo.html)

@@ -33,0 +37,0 @@

@@ -0,0 +0,0 @@ import path from 'path';

@@ -0,0 +0,0 @@ function ultralightCopy(sourceStr: string = ""): boolean {

@@ -0,0 +0,0 @@ // globalSetup.js,用于启动本地服务

@@ -0,0 +0,0 @@ // globalTeardown.js 用于停止本地服务

@@ -25,3 +25,3 @@ // test.js jest配置文件

await page.click('#test'); // 点击按钮
expect(alertMsg).toBe('success !'); // 设置测试预期结果。
expect(alertMsg).toBe('Success! Try to paste.'); // 设置测试预期结果。
}, 6000);

@@ -28,0 +28,0 @@ });

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc