kitzo 2.3.22 → 2.3.23

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 CHANGED
@@ -1,3 +1,3 @@
1
- export declare function copy(doc: string): Promise<void>;
1
+ export declare function copy(doc: unknown): Promise<void>;
2
2
 
3
3
  export { }
@@ -2,7 +2,7 @@ function o(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 n(e) {
5
+ async function a(e) {
6
6
  if (!navigator.clipboard?.writeText) {
7
7
  o(e);
8
8
  return;
@@ -13,11 +13,10 @@ async function n(e) {
13
13
  o(e), console.error(t);
14
14
  }
15
15
  }
16
- async function r(e) {
17
- if (e == null) throw new Error("[kitzo/copy] expected a value to copy, got null or undefined.");
18
- const t = typeof e == "string" || typeof e == "number" ? String(e) : JSON.stringify(e);
19
- await n(t);
16
+ async function n(e) {
17
+ const t = typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : JSON.stringify(e);
18
+ await a(t);
20
19
  }
21
20
  export {
22
- r as default
21
+ n as default
23
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kitzo",
3
- "version": "2.3.22",
3
+ "version": "2.3.23",
4
4
  "description": "A lightweight React micro-utility.",
5
5
  "type": "module",
6
6
  "files": [