kitzo 2.3.22 → 2.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fns.d.ts +1 -1
- package/dist/functions/copy/copy.js +11 -7
- package/package.json +1 -1
package/dist/fns.d.ts
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a(e) {
|
|
2
2
|
const t = document.createElement("textarea");
|
|
3
3
|
t.value = e, document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
|
|
4
4
|
}
|
|
5
|
-
async function
|
|
5
|
+
async function o(e) {
|
|
6
6
|
if (!navigator.clipboard?.writeText) {
|
|
7
|
-
|
|
7
|
+
a(e);
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
try {
|
|
11
11
|
await navigator.clipboard.writeText(e);
|
|
12
12
|
} catch (t) {
|
|
13
|
-
|
|
13
|
+
a(e), console.error(t);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
async function r(e) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
let t;
|
|
18
|
+
try {
|
|
19
|
+
t = typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e);
|
|
20
|
+
} catch {
|
|
21
|
+
t = "[Cannot copy circular object]";
|
|
22
|
+
}
|
|
23
|
+
await o(t);
|
|
20
24
|
}
|
|
21
25
|
export {
|
|
22
26
|
r as default
|