zmdms-utils 0.0.22 → 0.0.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/es/parseTime.js +21 -7
- package/dist/es/src/parseTimeTest.js +21 -7
- package/package.json +1 -1
- package/src/parseTime.ts +21 -7
- package/src/parseTimeTest.js +21 -7
package/dist/es/parseTime.js
CHANGED
|
@@ -39,8 +39,10 @@ function parseTime(config) {
|
|
|
39
39
|
index: index,
|
|
40
40
|
endType: endTypeItem,
|
|
41
41
|
});
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
if (fromKey !== toKey) {
|
|
43
|
+
// 删除原有key
|
|
44
|
+
Reflect.deleteProperty(newParams_1, fromKey);
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
// 2. 从一个键 转成 两个键
|
|
46
48
|
if (typeof fromKey === "string" && typeof toKey === "object") {
|
|
@@ -62,7 +64,9 @@ function parseTime(config) {
|
|
|
62
64
|
index: index,
|
|
63
65
|
endType: endEndType,
|
|
64
66
|
});
|
|
65
|
-
|
|
67
|
+
if (fromKey !== toKey1 && fromKey !== toKey2) {
|
|
68
|
+
Reflect.deleteProperty(newParams_1, fromKey);
|
|
69
|
+
}
|
|
66
70
|
}
|
|
67
71
|
// 3. 从两个键 转成 一个键
|
|
68
72
|
if (typeof fromKey === "object" && typeof toKey === "string") {
|
|
@@ -86,8 +90,12 @@ function parseTime(config) {
|
|
|
86
90
|
endType: endEndType,
|
|
87
91
|
}),
|
|
88
92
|
];
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
if (fromKey1 !== toKey) {
|
|
94
|
+
Reflect.deleteProperty(newParams_1, fromKey1);
|
|
95
|
+
}
|
|
96
|
+
if (fromtKey2 !== toKey) {
|
|
97
|
+
Reflect.deleteProperty(newParams_1, fromtKey2);
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
// 4. 从两个键 转成 两个键
|
|
93
101
|
if (typeof fromKey === "object" && typeof toKey === "object") {
|
|
@@ -110,8 +118,14 @@ function parseTime(config) {
|
|
|
110
118
|
index: index,
|
|
111
119
|
endType: endEndType,
|
|
112
120
|
});
|
|
113
|
-
|
|
114
|
-
|
|
121
|
+
if (fromKey1 !== toKey1) {
|
|
122
|
+
// 删除原有key
|
|
123
|
+
Reflect.deleteProperty(newParams_1, fromKey1);
|
|
124
|
+
}
|
|
125
|
+
if (fromtKey2 !== toKey2) {
|
|
126
|
+
// 删除原有key
|
|
127
|
+
Reflect.deleteProperty(newParams_1, fromtKey2);
|
|
128
|
+
}
|
|
115
129
|
}
|
|
116
130
|
});
|
|
117
131
|
return newParams_1;
|
|
@@ -37,8 +37,10 @@ function parseTime(config) {
|
|
|
37
37
|
index,
|
|
38
38
|
endType: endTypeItem,
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
if (fromKey !== toKey) {
|
|
41
|
+
// 删除原有key
|
|
42
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
// 2. 从一个键 转成 两个键
|
|
44
46
|
if (typeof fromKey === "string" && typeof toKey === "object") {
|
|
@@ -60,7 +62,9 @@ function parseTime(config) {
|
|
|
60
62
|
index,
|
|
61
63
|
endType: endEndType,
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
if (fromKey !== toKey1 && fromKey !== toKey2) {
|
|
66
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
67
|
+
}
|
|
64
68
|
}
|
|
65
69
|
// 3. 从两个键 转成 一个键
|
|
66
70
|
if (typeof fromKey === "object" && typeof toKey === "string") {
|
|
@@ -84,8 +88,12 @@ function parseTime(config) {
|
|
|
84
88
|
endType: endEndType,
|
|
85
89
|
}),
|
|
86
90
|
];
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
if (fromKey1 !== toKey) {
|
|
92
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
93
|
+
}
|
|
94
|
+
if (fromtKey2 !== toKey) {
|
|
95
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
96
|
+
}
|
|
89
97
|
}
|
|
90
98
|
// 4. 从两个键 转成 两个键
|
|
91
99
|
if (typeof fromKey === "object" && typeof toKey === "object") {
|
|
@@ -108,8 +116,14 @@ function parseTime(config) {
|
|
|
108
116
|
index,
|
|
109
117
|
endType: endEndType,
|
|
110
118
|
});
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
if (fromKey1 !== toKey1) {
|
|
120
|
+
// 删除原有key
|
|
121
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
122
|
+
}
|
|
123
|
+
if (fromtKey2 !== toKey2) {
|
|
124
|
+
// 删除原有key
|
|
125
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
126
|
+
}
|
|
113
127
|
}
|
|
114
128
|
});
|
|
115
129
|
|
package/package.json
CHANGED
package/src/parseTime.ts
CHANGED
|
@@ -66,8 +66,10 @@ export default function parseTime(config: IConfig) {
|
|
|
66
66
|
index,
|
|
67
67
|
endType: endTypeItem,
|
|
68
68
|
});
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
if (fromKey !== toKey) {
|
|
70
|
+
// 删除原有key
|
|
71
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
// 2. 从一个键 转成 两个键
|
|
73
75
|
if (typeof fromKey === "string" && typeof toKey === "object") {
|
|
@@ -89,7 +91,9 @@ export default function parseTime(config: IConfig) {
|
|
|
89
91
|
index,
|
|
90
92
|
endType: endEndType,
|
|
91
93
|
});
|
|
92
|
-
|
|
94
|
+
if (fromKey !== toKey1 && fromKey !== toKey2) {
|
|
95
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
96
|
+
}
|
|
93
97
|
}
|
|
94
98
|
// 3. 从两个键 转成 一个键
|
|
95
99
|
if (typeof fromKey === "object" && typeof toKey === "string") {
|
|
@@ -113,8 +117,12 @@ export default function parseTime(config: IConfig) {
|
|
|
113
117
|
endType: endEndType,
|
|
114
118
|
}),
|
|
115
119
|
];
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
if (fromKey1 !== toKey) {
|
|
121
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
122
|
+
}
|
|
123
|
+
if (fromtKey2 !== toKey) {
|
|
124
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
125
|
+
}
|
|
118
126
|
}
|
|
119
127
|
// 4. 从两个键 转成 两个键
|
|
120
128
|
if (typeof fromKey === "object" && typeof toKey === "object") {
|
|
@@ -137,8 +145,14 @@ export default function parseTime(config: IConfig) {
|
|
|
137
145
|
index,
|
|
138
146
|
endType: endEndType,
|
|
139
147
|
});
|
|
140
|
-
|
|
141
|
-
|
|
148
|
+
if (fromKey1 !== toKey1) {
|
|
149
|
+
// 删除原有key
|
|
150
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
151
|
+
}
|
|
152
|
+
if (fromtKey2 !== toKey2) {
|
|
153
|
+
// 删除原有key
|
|
154
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
155
|
+
}
|
|
142
156
|
}
|
|
143
157
|
});
|
|
144
158
|
|
package/src/parseTimeTest.js
CHANGED
|
@@ -35,8 +35,10 @@ function parseTime(config) {
|
|
|
35
35
|
index,
|
|
36
36
|
endType: endTypeItem,
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if (fromKey !== toKey) {
|
|
39
|
+
// 删除原有key
|
|
40
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
41
|
+
}
|
|
40
42
|
}
|
|
41
43
|
// 2. 从一个键 转成 两个键
|
|
42
44
|
if (typeof fromKey === "string" && typeof toKey === "object") {
|
|
@@ -58,7 +60,9 @@ function parseTime(config) {
|
|
|
58
60
|
index,
|
|
59
61
|
endType: endEndType,
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
if (fromKey !== toKey1 && fromKey !== toKey2) {
|
|
64
|
+
Reflect.deleteProperty(newParams, fromKey);
|
|
65
|
+
}
|
|
62
66
|
}
|
|
63
67
|
// 3. 从两个键 转成 一个键
|
|
64
68
|
if (typeof fromKey === "object" && typeof toKey === "string") {
|
|
@@ -82,8 +86,12 @@ function parseTime(config) {
|
|
|
82
86
|
endType: endEndType,
|
|
83
87
|
}),
|
|
84
88
|
];
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
if (fromKey1 !== toKey) {
|
|
90
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
91
|
+
}
|
|
92
|
+
if (fromtKey2 !== toKey) {
|
|
93
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
// 4. 从两个键 转成 两个键
|
|
89
97
|
if (typeof fromKey === "object" && typeof toKey === "object") {
|
|
@@ -106,8 +114,14 @@ function parseTime(config) {
|
|
|
106
114
|
index,
|
|
107
115
|
endType: endEndType,
|
|
108
116
|
});
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
if (fromKey1 !== toKey1) {
|
|
118
|
+
// 删除原有key
|
|
119
|
+
Reflect.deleteProperty(newParams, fromKey1);
|
|
120
|
+
}
|
|
121
|
+
if (fromtKey2 !== toKey2) {
|
|
122
|
+
// 删除原有key
|
|
123
|
+
Reflect.deleteProperty(newParams, fromtKey2);
|
|
124
|
+
}
|
|
111
125
|
}
|
|
112
126
|
});
|
|
113
127
|
|