@yh-kit/utils 1.0.0 → 1.0.1

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/utils.js CHANGED
@@ -1,28 +1,33 @@
1
- const r = (e) => {
2
- if (!e || !e.length) return {};
3
- const o = {};
4
- return e.forEach((n) => {
5
- const t = Object.assign({ label: n.label, text: n.label }, n);
6
- o[n == null ? void 0 : n.value] = t;
7
- }), o;
8
- }, s = {
9
- toEnumObj: r
1
+ const r = {
2
+ /**
3
+ * 数组转枚举对象
4
+ * @param arr 数组
5
+ * @returns
6
+ */
7
+ toEnumObj: (e) => {
8
+ if (!e || !e.length) return {};
9
+ const o = {};
10
+ return e.forEach((n) => {
11
+ const t = Object.assign({ label: n.label, text: n.label }, n);
12
+ o[n == null ? void 0 : n.value] = t;
13
+ }), o;
14
+ }
15
+ }, a = {
16
+ ...r
17
+ }, s = (e) => e.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","), c = {
18
+ toMoney: s
10
19
  }, b = {
11
- ...s
12
- }, c = (e) => e.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","), l = {
13
- toMoney: c
14
- }, g = {
15
- ...l
16
- }, u = (e) => {
20
+ ...c
21
+ }, l = (e) => {
17
22
  const n = new RegExp("[?&]" + e + "=([^&#]*)", "i").exec(window.location.href);
18
23
  return n ? decodeURIComponent(n[1]) : null;
19
- }, a = {
20
- getQueryInfoByName: u
21
- }, y = {
22
- ...a
24
+ }, u = {
25
+ getQueryInfoByName: l
26
+ }, g = {
27
+ ...u
23
28
  };
24
29
  export {
25
- b as arrayUtils,
26
- g as numberUtils,
27
- y as urlUtils
30
+ a as arrayUtils,
31
+ b as numberUtils,
32
+ g as urlUtils
28
33
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yh-kit/utils",
3
3
  "private": false,
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -32,4 +32,4 @@
32
32
  "access": "public",
33
33
  "registry": "https://registry.npmjs.org/"
34
34
  }
35
- }
35
+ }
@@ -1,5 +1,11 @@
1
1
  import { IOptionItem, TValueEnum } from "../typings";
2
+ /** 数组转对象 */
2
3
  declare const _default: {
4
+ /**
5
+ * 数组转枚举对象
6
+ * @param arr 数组
7
+ * @returns
8
+ */
3
9
  toEnumObj: (arr: IOptionItem[]) => TValueEnum;
4
10
  };
5
11
  export default _default;