@kuankuan/assist-2026 0.1.14 → 0.1.15

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.
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+
5
+ const viteCache = path.resolve(process.cwd(), 'node_modules', '.vite');
6
+ if (fs.existsSync(viteCache)) {
7
+ fs.rmSync(viteCache, { recursive: true });
8
+ }
@@ -0,0 +1 @@
1
+ export declare let copyText: (text: string) => void;
package/dist/utils.js ADDED
@@ -0,0 +1,16 @@
1
+ export let copyText = (text) => {
2
+ if (window.navigator.clipboard) {
3
+ copyText = (text) => window.navigator.clipboard.writeText(text);
4
+ }
5
+ else {
6
+ copyText = (text) => {
7
+ const textarea = document.createElement('textarea');
8
+ textarea.value = text;
9
+ document.body.appendChild(textarea);
10
+ textarea.select();
11
+ document.execCommand('copy');
12
+ document.body.removeChild(textarea);
13
+ };
14
+ }
15
+ copyText(text);
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuankuan/assist-2026",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "A toolset from kuankuan",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -10,7 +10,8 @@
10
10
  "build": "npm run clean && tsc"
11
11
  },
12
12
  "bin": {
13
- "load-fontello": "bin/load-fontello.js"
13
+ "load-fontello": "bin/load-fontello.js",
14
+ "clear-vite-deps": "bin/clear-vite-deps.js"
14
15
  },
15
16
  "repository": {
16
17
  "type": "git",
package/src/utils.ts ADDED
@@ -0,0 +1,15 @@
1
+ export let copyText = (text: string) => {
2
+ if (window.navigator.clipboard) {
3
+ copyText = (text: string) => window.navigator.clipboard.writeText(text);
4
+ } else {
5
+ copyText = (text: string) => {
6
+ const textarea = document.createElement('textarea');
7
+ textarea.value = text;
8
+ document.body.appendChild(textarea);
9
+ textarea.select();
10
+ document.execCommand('copy');
11
+ document.body.removeChild(textarea);
12
+ };
13
+ }
14
+ copyText(text);
15
+ }