copy-to-clipboard-ultralight
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -1,3 +0,3 @@ | ||
declare function ultralightCopy(sourceStr: string): boolean; | ||
declare function ultralightCopy(sourceStr?: string): boolean; | ||
export default ultralightCopy; |
@@ -1,1 +0,1 @@ | ||
function e(e){var t=document;if(t.execCommand("copy")){var o=t.createElement("input");return o.setAttribute("readonly","readonly"),o.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),o.setAttribute("value",e),t.body.appendChild(o),o.setSelectionRange(0,e.length),o.select(),t.execCommand("copy"),t.body.removeChild(o),!0}return!1}export default e; | ||
function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document;if(t.execCommand("copy")){var o=t.createElement("input");return o.setAttribute("readonly","readonly"),o.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),o.setAttribute("value",e),t.body.appendChild(o),o.setSelectionRange(0,e.length),o.select(),t.execCommand("copy"),t.body.removeChild(o),!0}return!1}export default e; |
@@ -1,1 +0,1 @@ | ||
!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(e){var t=document;if(t.execCommand("copy")){var o=t.createElement("input");return o.setAttribute("readonly","readonly"),o.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),o.setAttribute("value",e),t.body.appendChild(o),o.setSelectionRange(0,e.length),o.select(),t.execCommand("copy"),t.body.removeChild(o),!0}return!1}})); | ||
!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;if(t.execCommand("copy")){var o=t.createElement("input");return o.setAttribute("readonly","readonly"),o.setAttribute("style","position: fixed; top:0; left:0; opacity:0;"),o.setAttribute("value",e),t.body.appendChild(o),o.setSelectionRange(0,e.length),o.select(),t.execCommand("copy"),t.body.removeChild(o),!0}return!1}})); |
{ | ||
"name": "copy-to-clipboard-ultralight", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Copy text to clipboard, only support modern browser.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
function ultralightCopy(sourceStr: string): boolean { | ||
function ultralightCopy(sourceStr: string = ""): boolean { | ||
const d = document // rudeuce size | ||
@@ -3,0 +3,0 @@ if (d.execCommand('copy')) { |
Sorry, the diff of this file is not supported yet
15875