beer-network 1.1.1-alpha.3 → 1.1.1-alpha.4

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/elementUtils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare class ElementUtils {
1
+ export default class ElementUtils {
2
2
  /**
3
3
  * 选择文件本地文件.
4
4
  */
package/elementUtils.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElementUtils = void 0;
4
3
  class ElementUtils {
5
4
  /**
6
5
  * 选择文件本地文件.
@@ -32,4 +31,4 @@ class ElementUtils {
32
31
  document.body.removeChild(link);
33
32
  }
34
33
  }
35
- exports.ElementUtils = ElementUtils;
34
+ exports.default = ElementUtils;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "beer-network",
3
3
  "private": false,
4
- "version": "1.1.1-alpha.3",
4
+ "version": "1.1.1-alpha.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "pub-w": "copy package.json .\\dist\\package.json && npm publish ./dist"
package/utils.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export default class Utils {
2
+ /**
3
+ * 获取URI 地址参数.
4
+ * @param key 参数名称.
5
+ */
6
+ static getParam(key: string): string | undefined;
7
+ /**
8
+ * 复制到剪切板.
9
+ * @param value 内容.
10
+ */
11
+ static copy(value: string): Promise<void>;
12
+ }
package/utils.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class Utils {
4
+ /**
5
+ * 获取URI 地址参数.
6
+ * @param key 参数名称.
7
+ */
8
+ static getParam(key) {
9
+ const values = window.location.search.split('?');
10
+ if (values.length <= 1) {
11
+ return undefined;
12
+ }
13
+ const value = values[1];
14
+ if (value === undefined) {
15
+ return undefined;
16
+ }
17
+ for (const it of decodeURIComponent(value)
18
+ .split('&')) {
19
+ const args = it.trim()
20
+ .split('=');
21
+ if (args.length !== 2) {
22
+ continue;
23
+ }
24
+ if (args[0].toString()
25
+ .toLocaleLowerCase() === key.toLocaleLowerCase()) {
26
+ return args[1];
27
+ }
28
+ }
29
+ return undefined;
30
+ }
31
+ /**
32
+ * 复制到剪切板.
33
+ * @param value 内容.
34
+ */
35
+ static async copy(value) {
36
+ return navigator.clipboard.writeText(value);
37
+ }
38
+ }
39
+ exports.default = Utils;