@kokimin/utils 0.0.7 → 0.0.8
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/README.md +254 -0
- package/dist/index.js +1 -1
- package/index.d.ts +223 -223
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
````md
|
|
2
|
+
# @kokimin/utils
|
|
3
|
+
|
|
4
|
+
> A lightweight utility library for modern front-end applications.
|
|
5
|
+
|
|
6
|
+
`@kokimin/utils` is a collection of commonly used utility functions for
|
|
7
|
+
**arrays, objects, dates, strings, numbers, formatting, and UI alerts**.
|
|
8
|
+
|
|
9
|
+
Designed for **Vue, React, and Vanilla JS**, with built-in TypeScript support.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @kokimin/utils
|
|
17
|
+
````
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### Import
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import utils from '@kokimin/utils'
|
|
27
|
+
|
|
28
|
+
// or
|
|
29
|
+
import { uniq, orderBy, dateFormat } from '@kokimin/utils'
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
### Array
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { uniq, union, head, last } from '@kokimin/utils'
|
|
40
|
+
|
|
41
|
+
uniq([1, 2, 2, 3]) // [1, 2, 3]
|
|
42
|
+
union([1, 2], [2, 3]) // [1, 2, 3]
|
|
43
|
+
head([10, 20, 30]) // 10
|
|
44
|
+
last([10, 20, 30]) // 30
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### Collection
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
import { sortBy, orderBy } from '@kokimin/utils'
|
|
53
|
+
|
|
54
|
+
orderBy(
|
|
55
|
+
[
|
|
56
|
+
{ name: 'Tom', age: 30 },
|
|
57
|
+
{ name: 'Jane', age: 20 }
|
|
58
|
+
],
|
|
59
|
+
['age'],
|
|
60
|
+
['asc']
|
|
61
|
+
)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Date (Dayjs-based)
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { dateFormat, searchDefaultDate } from '@kokimin/utils'
|
|
70
|
+
|
|
71
|
+
dateFormat(new Date(), 'YYYY-MM-DD')
|
|
72
|
+
|
|
73
|
+
searchDefaultDate('thisMonth')
|
|
74
|
+
// ['2025-12-01', '2025-12-31']
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### Formatter
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { currencyFormatter, phoneFormatter } from '@kokimin/utils'
|
|
83
|
+
|
|
84
|
+
currencyFormatter(1234567) // "1,234,567"
|
|
85
|
+
phoneFormatter('01012341234') // "010-1234-1234"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### Object
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
import { omit, has, merge } from '@kokimin/utils'
|
|
94
|
+
|
|
95
|
+
omit({ a: 1, b: 2 }, 'b') // { a: 1 }
|
|
96
|
+
has({ a: { b: 1 } }, 'a.b') // true
|
|
97
|
+
merge({ a: 1 }, { b: 2 }) // { a: 1, b: 2 }
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### String
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { padStart, trim } from '@kokimin/utils'
|
|
106
|
+
|
|
107
|
+
padStart('5', 3, '0') // "005"
|
|
108
|
+
trim(' hello ') // "hello"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Number
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import { random, numberArrayMax } from '@kokimin/utils'
|
|
117
|
+
|
|
118
|
+
random(1, 10)
|
|
119
|
+
numberArrayMax([3, 9, 5]) // 9
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### Clone & Validation
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import { cloneDeep, isEmpty } from '@kokimin/utils'
|
|
128
|
+
|
|
129
|
+
cloneDeep({ a: 1 })
|
|
130
|
+
isEmpty({}) // true
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### UI Alerts (SweetAlert2)
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { alert, confirm, toastSuccess } from '@kokimin/utils'
|
|
139
|
+
|
|
140
|
+
await alert('Notice', 'Saved successfully')
|
|
141
|
+
|
|
142
|
+
const ok = await confirm('Confirm', 'Delete this item?')
|
|
143
|
+
|
|
144
|
+
toastSuccess('Success', 'Completed')
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## API
|
|
150
|
+
|
|
151
|
+
### Array
|
|
152
|
+
|
|
153
|
+
* `concat(array, ...values)`
|
|
154
|
+
* `uniq(array)`
|
|
155
|
+
* `union(...arrays)`
|
|
156
|
+
* `intersection(...arrays)`
|
|
157
|
+
* `head(array)`
|
|
158
|
+
* `last(array)`
|
|
159
|
+
* `flattenDeep(array)`
|
|
160
|
+
* `flattenDeepAll(array, key?, child?)`
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### Collection
|
|
165
|
+
|
|
166
|
+
* `sortBy(collection, iteratees)`
|
|
167
|
+
* `orderBy(collection, iteratees, orders?)`
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Common
|
|
172
|
+
|
|
173
|
+
* `generateUuid(v?: 'v1' | 'v4')`
|
|
174
|
+
* `generateRandomNumber(min?, max?)`
|
|
175
|
+
* `trimStringByByte(str, byteLength)`
|
|
176
|
+
* `getByteLength(str)`
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### Date
|
|
181
|
+
|
|
182
|
+
* `dateFormat(date, format?)`
|
|
183
|
+
* `quarter(date)`
|
|
184
|
+
* `calculateDay(options?)`
|
|
185
|
+
* `searchDefaultDate(type?)`
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Formatter
|
|
190
|
+
|
|
191
|
+
* `currencyFormatter(value, precision?)`
|
|
192
|
+
* `phoneFormatter(phone?)`
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
### Object
|
|
197
|
+
|
|
198
|
+
* `assign(object, ...sources)`
|
|
199
|
+
* `merge(object, ...sources)`
|
|
200
|
+
* `has(object, path)`
|
|
201
|
+
* `omit(object, paths)`
|
|
202
|
+
* `objectEmptyRemove(object)`
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
### String
|
|
207
|
+
|
|
208
|
+
* `padStart(string, targetLength, padString?)`
|
|
209
|
+
* `replace(string, pattern, replacement)`
|
|
210
|
+
* `trim(string, chars?)`
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### Number
|
|
215
|
+
|
|
216
|
+
* `random(lower?, upper?, floating?)`
|
|
217
|
+
* `numberArrayMax(arr)`
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### Alert
|
|
222
|
+
|
|
223
|
+
* `alert(title, content)`
|
|
224
|
+
* `confirm(title, content)`
|
|
225
|
+
* `toastSuccess(title, content?)`
|
|
226
|
+
* `toastError(title, content?)`
|
|
227
|
+
* `close()`
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Default Export
|
|
232
|
+
|
|
233
|
+
All utilities are also available via default export:
|
|
234
|
+
|
|
235
|
+
```ts
|
|
236
|
+
import utils from '@kokimin/utils'
|
|
237
|
+
|
|
238
|
+
utils.dateFormat(new Date())
|
|
239
|
+
utils.toastSuccess('Done')
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## TypeScript Support
|
|
245
|
+
|
|
246
|
+
* Built-in `.d.ts`
|
|
247
|
+
* Generic-friendly APIs
|
|
248
|
+
* No additional configuration required
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
|
|
254
|
+
MIT © kokimin
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3c3da8=_0x1c53;(function(_0x234a79,_0x3038ff){const _0xe9a79f=_0x1c53,_0x567eb3=_0x234a79();while(!![]){try{const _0x530506=parseInt(_0xe9a79f(0x1ce))/0x1*(-parseInt(_0xe9a79f(0x1fa))/0x2)+-parseInt(_0xe9a79f(0x212))/0x3+-parseInt(_0xe9a79f(0x1f9))/0x4*(-parseInt(_0xe9a79f(0x221))/0x5)+-parseInt(_0xe9a79f(0x21b))/0x6+parseInt(_0xe9a79f(0x1fd))/0x7*(parseInt(_0xe9a79f(0x1dc))/0x8)+parseInt(_0xe9a79f(0x216))/0x9+parseInt(_0xe9a79f(0x1fb))/0xa;if(_0x530506===_0x3038ff)break;else _0x567eb3['push'](_0x567eb3['shift']());}catch(_0x20a674){_0x567eb3['push'](_0x567eb3['shift']());}}}(_0x2f04,0xda21f));var w=Object[_0x3c3da8(0x1de)],C=(_0x23eb38,_0x4f9ac2)=>{for(var _0x1052fe in _0x4f9ac2)w(_0x23eb38,_0x1052fe,{'get':_0x4f9ac2[_0x1052fe],'enumerable':!0x0});},Y={};C(Y,{'Toast':()=>y,'alert':()=>ft,'assign':()=>rt,'calculateDay':()=>k,'cloneDeep':()=>Q,'close':()=>xt,'concat':()=>O,'confirm':()=>mt,'currencyFormatter':()=>H,'dateFormat':()=>_,'flattenDeep':()=>$,'flattenDeepAll':()=>q,'generateRandomNumber':()=>B,'generateUuid':()=>Z,'getByteLength':()=>V,'has':()=>et,'head':()=>N,'intersection':()=>T,'isEmpty':()=>W,'last':()=>z,'merge':()=>ot,'numberArrayMax':()=>tt,'objectEmptyRemove':()=>st,'omit':()=>nt,'orderBy':()=>I,'padStart':()=>ct,'phoneFormatter':()=>J,'quarter':()=>U,'random':()=>v,'replace':()=>at,'searchDefaultDate':()=>G,'sortBy':()=>F,'toastError':()=>lt,'toastSuccess':()=>ut,'trim':()=>it,'trimStringByByte':()=>L,'union':()=>j,'uniq':()=>E});import _0x32788a from'lodash';var O=(_0x47fe7f=[],..._0x110f74)=>_0x32788a['concat'](_0x47fe7f,..._0x110f74),E=(_0x3d0c85=[])=>_0x32788a[_0x3c3da8(0x1f7)](_0x3d0c85),j=(..._0x56b6bb)=>_0x32788a[_0x3c3da8(0x204)](..._0x56b6bb),N=(_0x366f3b=[])=>_0x32788a[_0x3c3da8(0x1cb)](_0x366f3b),$=(_0x1ee39a=[])=>_0x32788a['flattenDeep'](_0x1ee39a),q=(_0x1351ac=[],_0x8a7f48=_0x3c3da8(0x1db),_0x3686a1='children')=>{const _0x4fc9f3=_0x3c3da8,_0xe5764b={'QuUSM':function(_0x37eb21,_0x15056c){return _0x37eb21===_0x15056c;},'skbMx':_0x4fc9f3(0x1f1),'cQwfk':_0x4fc9f3(0x20f),'xcSeq':function(_0x309eb8,_0x4e0b56,_0x55c8e2,_0x5e236c,_0x2d16a0){return _0x309eb8(_0x4e0b56,_0x55c8e2,_0x5e236c,_0x2d16a0);},'zxrmb':function(_0x27bfaa,_0x29788d,_0x3042f7){return _0x27bfaa(_0x29788d,_0x3042f7);}};let _0x36a3ee=(_0x4db0f9,_0xbee583,_0xa16feb,_0x18d8ad)=>{const _0x1b44fb=_0x4fc9f3;let _0x3e7503=[];return _0x4db0f9[_0x1b44fb(0x207)](_0x17cbb9=>{const _0x1e150c=_0x1b44fb,_0x36c112={'UWfpZ':function(_0x4c7aff,_0x50764a){const _0x35f8f4=_0x1c53;return _0xe5764b[_0x35f8f4(0x20c)](_0x4c7aff,_0x50764a);},'TsyTa':function(_0x67076b,_0x310524){const _0x451667=_0x1c53;return _0xe5764b[_0x451667(0x20c)](_0x67076b,_0x310524);}};if(_0xe5764b[_0x1e150c(0x20c)](_0xe5764b[_0x1e150c(0x1fe)],_0xe5764b[_0x1e150c(0x215)])){if(!_0x560b5a[_0x1e150c(0x1ed)](_0xa9f3ab))return{};let _0x53bec7={..._0x49fdd5};return _0x24da24[_0x1e150c(0x1e4)](_0x53bec7)[_0x1e150c(0x207)](_0x2ecef1=>{const _0x1e8717=_0x1e150c;let _0x425178=_0x53bec7[_0x2ecef1];(_0x36c112[_0x1e8717(0x209)](_0x425178,'')||_0x36c112[_0x1e8717(0x1d8)](_0x425178,null)||_0x425178===void 0x0||_0x393d8d[_0x1e8717(0x1eb)](_0x425178)&&_0x467f40[_0x1e8717(0x21d)](_0x425178))&&delete _0x53bec7[_0x2ecef1];}),_0x53bec7;}else{if(_0x17cbb9[_0xbee583]===_0x18d8ad)_0x3e7503[_0x1e150c(0x1e3)](_0x17cbb9[_0xbee583]);else{if(_0x17cbb9[_0xa16feb]){let _0x5eb092=_0x36a3ee(_0x17cbb9[_0xa16feb],_0xbee583,_0xa16feb,_0x18d8ad);_0x5eb092['length']>0x0&&(_0x3e7503[_0x1e150c(0x1e3)](_0x17cbb9[_0xbee583]),_0x5eb092['forEach'](_0x1a1819=>_0x3e7503[_0x1e150c(0x1e3)](_0x1a1819)));}}}}),_0x3e7503;},_0x3b6cbe=(_0x13a94c,_0x3ecc86)=>_0x13a94c[_0x4fc9f3(0x1ec)]((_0x196a27,_0x456b2d)=>{const _0x113dc3=_0x4fc9f3;let _0x226186=_0x196a27[_0x113dc3(0x1e1)](_0x456b2d),_0x590639=_0x456b2d[_0x3ecc86];return _0x226186[_0x113dc3(0x1e1)](_0x590639?.['length']?_0x3b6cbe(_0x590639,_0x3ecc86):[]);},[]),_0xa72df9=(_0x313c9e,_0xf0fcc4)=>_0x313c9e['reduce']((_0x120e24,_0x4a9680)=>{const _0x39493d=_0x4fc9f3;let _0x274e5c=_0x120e24['concat'](_0x4a9680),_0xb5b95=_0x4a9680[_0xf0fcc4];return Array[_0x39493d(0x1d7)](_0x4a9680[_0xf0fcc4])||(_0x4a9680[_0xf0fcc4]=[]),_0x4a9680['parentIds']=_0xe5764b[_0x39493d(0x1e9)](_0x36a3ee,_0x1351ac,_0x8a7f48,_0xf0fcc4,_0x4a9680[_0x8a7f48]),_0x274e5c[_0x39493d(0x1e1)](_0xb5b95?.[_0x39493d(0x1f2)]?_0xe5764b[_0x39493d(0x1e7)](_0xa72df9,_0xb5b95,_0xf0fcc4):[]);},[]);return _0xe5764b[_0x4fc9f3(0x1e7)](_0xa72df9,_0x1351ac,_0x3686a1)[_0x4fc9f3(0x211)](_0x407cde=>({..._0x407cde,'childrenIds':_0x3b6cbe(_0x407cde[_0x3686a1],_0x3686a1)[_0x4fc9f3(0x211)](_0x59c97a=>_0x59c97a[_0x8a7f48])}));},z=(_0x289272=[])=>_0x32788a['last'](_0x289272),T=(..._0x4eec2d)=>_0x32788a[_0x3c3da8(0x1d5)](..._0x4eec2d);import _0x17a947 from'lodash';var F=(_0x6a812,_0x397c87)=>_0x17a947[_0x3c3da8(0x1f5)](_0x6a812,_0x397c87),I=(_0x526bc9,_0x437da1,_0x196fd8)=>_0x17a947[_0x3c3da8(0x206)](_0x526bc9,_0x437da1,_0x196fd8);import{uuid as _0x390b79}from'vue-uuid';import{random as _0x217565}from'lodash/number.js';var Z=(_0x499d73='v1')=>{let _0x14c7e0=_0x390b79[_0x499d73](),_0x214772=B();return _0x14c7e0+'-'+_0x214772;},B=(_0x68bd44=0x0,_0x3c4409=0x3e8)=>_0x217565(_0x68bd44,_0x3c4409),L=(_0x6430e8,_0x577162)=>{const _0x1a98b3=_0x3c3da8,_0x1a3d8d={'dzRCD':function(_0x238d2f,_0x438cd6){return _0x238d2f>_0x438cd6;},'iMACU':function(_0xbcc1c9,_0xca18b0){return _0xbcc1c9+_0xca18b0;}};let _0x24d13a='',_0x5ef601=0x0;for(let _0x27fca6 of _0x6430e8){let _0x31a99c=_0x1a3d8d[_0x1a98b3(0x210)](_0x27fca6[_0x1a98b3(0x1f4)](0x0),0x7f)?0x2:0x1;if(_0x1a3d8d[_0x1a98b3(0x21f)](_0x5ef601,_0x31a99c)>_0x577162)break;_0x5ef601+=_0x31a99c,_0x24d13a+=_0x27fca6;}return _0x24d13a;},V=_0x3ef847=>{const _0x201904=_0x3c3da8,_0x24bf67={'RWANX':function(_0x38c0f8,_0x4c93cf){return _0x38c0f8>_0x4c93cf;}};let _0x42cd5f=0x0;for(let _0x4b0266 of _0x3ef847){let _0x1f1e99=_0x4b0266[_0x201904(0x1f4)](0x0);_0x42cd5f+=_0x24bf67[_0x201904(0x1d3)](_0x1f1e99,0x7f)?0x2:0x1;}return _0x42cd5f;};import _0x3dd0d1 from'dayjs';import _0xf0aaed from'dayjs/plugin/quarterOfYear';_0x3dd0d1['extend'](_0xf0aaed);function _0x2f04(){const _0x36a7c3=['assign','jTfAn','cQwfk','1266300XVTAdt','zzLoG','$1-$2-$3','YYYY-MM-DD','Ltpyg','7021908GfZsLi','has','isEmpty','YLJTf','iMACU','BKXnP','10lePoQP','head','trim','error','35NjUaGU','quarter','ko-KR','string','top','RWANX','random','intersection','PeuYK','isArray','TsyTa','startOf','filter','menuId','4716776hRxUWN','constructor','defineProperty','size','PpHod','concat','swal2_body','push','keys','match','yGgoQ','zxrmb','add','xcSeq','uwnwr','isObject','reduce','isPlainObject','day','cloneDeep','swal2_title','IRSqD','length','XDJMd','charCodeAt','sortBy','subtract','uniq','mixin','2662864GBMRYA','41406rZplWp','4228350QLdUYT','TfhOl','21jcALxj','skbMx','fire','format','today-oneMonth','cIorO','freeze','union','max','orderBy','forEach','QOYSz','UWfpZ','swal2_btn_cancel','swal2_btn_confirm','QuUSM','djaIP','success','cEOrk','dzRCD','map','2626092kHBPjj'];_0x2f04=function(){return _0x36a7c3;};return _0x2f04();}var _=(_0x452bf6,_0x38b79e='YYYY-MM-DD')=>_0x3dd0d1(_0x452bf6)[_0x3c3da8(0x200)](_0x38b79e),U=_0x2fb822=>_0x3dd0d1(_0x2fb822)[_0x3c3da8(0x1cf)](),k=({type:_0x43b878=_0x3c3da8(0x1ee),addDay:_0x1dce11=0x0,format:_0x41836f=_0x3c3da8(0x219)})=>{const _0x729d62=_0x3c3da8,_0xaca53a={'yGgoQ':function(_0x36a362){return _0x36a362();},'QOYSz':function(_0x595408,_0x28ba04,_0x5c25df){return _0x595408(_0x28ba04,_0x5c25df);}};let _0x5b6c9a=_0xaca53a[_0x729d62(0x1e6)](_0x3dd0d1);return _0xaca53a[_0x729d62(0x208)](_,_0x5b6c9a[_0x729d62(0x1e8)](_0x1dce11,_0x43b878),_0x41836f);},G=(_0x566ca6=_0x3c3da8(0x201))=>{const _0x16fc65=_0x3c3da8,_0x1cb496={'zzLoG':function(_0xfc4061){return _0xfc4061();},'XDJMd':_0x16fc65(0x219),'djaIP':'month','Ltpyg':function(_0x348426,_0x15cea1){return _0x348426===_0x15cea1;},'PpHod':_0x16fc65(0x201)};let _0x4da5b6=_0x1cb496[_0x16fc65(0x217)](_0x3dd0d1)[_0x16fc65(0x200)](_0x1cb496[_0x16fc65(0x1f3)]),_0x4d9f03=_0x3dd0d1()[_0x16fc65(0x1f6)](0x1,_0x1cb496['djaIP'])[_0x16fc65(0x200)](_0x1cb496[_0x16fc65(0x1f3)]),_0x3e2c0e=_0x1cb496[_0x16fc65(0x217)](_0x3dd0d1)[_0x16fc65(0x1d9)](_0x1cb496[_0x16fc65(0x20d)])['format'](_0x1cb496['XDJMd']);return _0x1cb496[_0x16fc65(0x21a)](_0x566ca6,_0x1cb496[_0x16fc65(0x1e0)])?[_0x4d9f03,_0x4da5b6]:[_0x3e2c0e,_0x4da5b6];},g={'comma':/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g,'phone':/^(\d{2,3})-?(\d{3,4})-?(\d{4})$/,'email':/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},H=(_0x16dbdd,_0x36b431=0x0)=>_0x16dbdd==null||isNaN(Number(_0x16dbdd))?'':Number(_0x16dbdd)['toLocaleString'](_0x3c3da8(0x1d0)),J=(_0x11ef1f='')=>{const _0x2f16ec=_0x3c3da8,_0x3b5744={'uwnwr':function(_0x15b427,_0x451dba){return _0x15b427!=_0x451dba;},'cIorO':_0x2f16ec(0x1d1),'TfhOl':function(_0x988f9b,_0x1f7018){return _0x988f9b(_0x1f7018);},'YLJTf':_0x2f16ec(0x218)};if(!_0x11ef1f)return'';_0x3b5744[_0x2f16ec(0x1ea)](typeof _0x11ef1f,_0x3b5744[_0x2f16ec(0x202)])&&(_0x11ef1f=_0x3b5744[_0x2f16ec(0x1fc)](String,_0x11ef1f));let _0x42db7f=_0x11ef1f['replace'](/\D/g,'');return _0x42db7f[_0x2f16ec(0x1e5)](g['phone'])?_0x42db7f['replace'](g['phone'],_0x3b5744[_0x2f16ec(0x21e)]):_0x11ef1f;};import _0x57ae6d from'lodash';var Q=_0x186abc=>_0x57ae6d[_0x3c3da8(0x1ef)](_0x186abc),W=_0x5e862f=>_0x5e862f==null?!0x0:_0x5e862f?.[_0x3c3da8(0x1dd)]===Object?Object[_0x3c3da8(0x1e4)](_0x5e862f)['length']===0x0:Array[_0x3c3da8(0x1d7)](_0x5e862f)?_0x5e862f['length']===0x0:_0x5e862f instanceof Map||_0x5e862f instanceof Set?_0x5e862f[_0x3c3da8(0x1df)]===0x0:typeof _0x5e862f==_0x3c3da8(0x1d1)?_0x5e862f[_0x3c3da8(0x1cc)]()[_0x3c3da8(0x1f2)]===0x0:_0x57ae6d[_0x3c3da8(0x21d)](_0x5e862f);import _0x2afda6 from'lodash';function _0x1c53(_0x1b57b3,_0x8fba86){_0x1b57b3=_0x1b57b3-0x1cb;const _0x2f04e8=_0x2f04();let _0x1c53b2=_0x2f04e8[_0x1b57b3];return _0x1c53b2;}var v=(_0x140103=0x0,_0x4744e8=0x1,_0x34e654=!0x1)=>_0x2afda6[_0x3c3da8(0x1d4)](_0x140103,_0x4744e8,_0x34e654),tt=_0x2ed6b4=>{const _0x1eb4d3=_0x3c3da8,_0x5e1c6a={'PeuYK':function(_0x3a737b,_0x323809){return _0x3a737b===_0x323809;},'BKXnP':function(_0x3ca49a,_0x128ee6){return _0x3ca49a!==_0x128ee6;}};if(!Array['isArray'](_0x2ed6b4)||_0x5e1c6a[_0x1eb4d3(0x1d6)](_0x2ed6b4[_0x1eb4d3(0x1f2)],0x0))return;let _0x56c073=_0x2ed6b4[_0x1eb4d3(0x1da)](_0x154b36=>typeof _0x154b36=='number'&&!isNaN(_0x154b36));if(_0x5e1c6a[_0x1eb4d3(0x220)](_0x56c073[_0x1eb4d3(0x1f2)],0x0))return Math[_0x1eb4d3(0x205)](..._0x56c073);};import _0x99b49d from'lodash';var rt=(_0x1c5541={},..._0x55a2fa)=>_0x99b49d[_0x3c3da8(0x213)](_0x1c5541,..._0x55a2fa),ot=(_0x3d1ba3={},..._0x5c0448)=>_0x99b49d['merge'](_0x3d1ba3,..._0x5c0448),et=(_0x34dc81,_0x50e3ac)=>_0x99b49d[_0x3c3da8(0x21c)](_0x34dc81,_0x50e3ac),nt=(_0x258799,_0x4a29b5)=>_0x99b49d['omit'](_0x258799,_0x4a29b5),st=(_0x354dab={})=>{const _0x45610c=_0x3c3da8,_0x219804={'jTfAn':function(_0x5437db,_0x3086c9){return _0x5437db===_0x3086c9;}};if(!_0x99b49d[_0x45610c(0x1ed)](_0x354dab))return{};let _0x3f5ba1={..._0x354dab};return Object[_0x45610c(0x1e4)](_0x3f5ba1)[_0x45610c(0x207)](_0x247e06=>{const _0x4c84e4=_0x45610c;let _0x28ba54=_0x3f5ba1[_0x247e06];(_0x219804[_0x4c84e4(0x214)](_0x28ba54,'')||_0x219804['jTfAn'](_0x28ba54,null)||_0x219804[_0x4c84e4(0x214)](_0x28ba54,void 0x0)||_0x99b49d['isObject'](_0x28ba54)&&_0x99b49d[_0x4c84e4(0x21d)](_0x28ba54))&&delete _0x3f5ba1[_0x247e06];}),_0x3f5ba1;};import _0x3b8195 from'lodash';var ct=(_0x253cb1,_0x3f6c3b,_0x2f913c='\x20')=>_0x3b8195['padStart'](String(_0x253cb1),_0x3f6c3b,_0x2f913c),at=(_0x311eba,_0x420317,_0x2b5fc0)=>_0x3b8195['replace'](String(_0x311eba),_0x420317,_0x2b5fc0),it=(_0x24cce4,_0x3ea759)=>_0x3ea759?_0x3b8195[_0x3c3da8(0x1cc)](String(_0x24cce4),_0x3ea759):_0x3b8195[_0x3c3da8(0x1cc)](String(_0x24cce4));import _0x6110fd from'sweetalert2';var pt={'popup':'swal2_popup','title':_0x3c3da8(0x1f0),'htmlContainer':_0x3c3da8(0x1e2),'actions':'swal2_actions','confirmButton':_0x3c3da8(0x20b),'cancelButton':_0x3c3da8(0x20a)},A=(_0x3e92dc,_0x22fd4a)=>({'title':_0x3e92dc,'html':_0x22fd4a,'allowOutsideClick':!0x1,'focusConfirm':!0x1,'customClass':pt}),ft=(_0x12da1b,_0x5dcf2f)=>_0x6110fd[_0x3c3da8(0x1ff)]({...A(_0x12da1b,_0x5dcf2f),'showCancelButton':!0x1,'confirmButtonText':'확인'}),mt=(_0x37a67d,_0x1c0821)=>_0x6110fd[_0x3c3da8(0x1ff)]({...A(_0x37a67d,_0x1c0821),'showCancelButton':!0x0,'confirmButtonText':'확인','cancelButtonText':'취소'}),y=_0x6110fd[_0x3c3da8(0x1f8)]({'toast':!0x0,'position':_0x3c3da8(0x1d2),'showConfirmButton':!0x1,'timer':0xbb8,'timerProgressBar':!0x1,'backdrop':!0x1}),ut=(_0x206263,_0x1867bf)=>y['fire']({'icon':_0x3c3da8(0x20e),'title':_0x206263,'html':_0x1867bf}),lt=(_0x813558,_0x30a618)=>y['fire']({'icon':_0x3c3da8(0x1cd),'title':_0x813558,'html':_0x30a618}),xt=()=>_0x6110fd['close'](),dt=Object[_0x3c3da8(0x203)]({...Y}),Qt=dt;export{y as Toast,ft as alert,rt as assign,k as calculateDay,Q as cloneDeep,xt as close,O as concat,mt as confirm,H as currencyFormatter,_ as dateFormat,Qt as default,$ as flattenDeep,q as flattenDeepAll,B as generateRandomNumber,Z as generateUuid,V as getByteLength,et as has,N as head,T as intersection,W as isEmpty,z as last,ot as merge,tt as numberArrayMax,st as objectEmptyRemove,nt as omit,I as orderBy,ct as padStart,J as phoneFormatter,U as quarter,v as random,at as replace,G as searchDefaultDate,F as sortBy,lt as toastError,ut as toastSuccess,it as trim,L as trimStringByByte,j as union,E as uniq};
|
|
1
|
+
const _0x9c329b=_0x24ab;(function(_0x16adf0,_0x483621){const _0x51a041=_0x24ab,_0x18c0c0=_0x16adf0();while(!![]){try{const _0x5c874c=-parseInt(_0x51a041(0xfc))/0x1+parseInt(_0x51a041(0xd9))/0x2*(-parseInt(_0x51a041(0xce))/0x3)+parseInt(_0x51a041(0x102))/0x4*(parseInt(_0x51a041(0xd1))/0x5)+-parseInt(_0x51a041(0xde))/0x6+parseInt(_0x51a041(0x126))/0x7+parseInt(_0x51a041(0xbb))/0x8+parseInt(_0x51a041(0xd3))/0x9*(parseInt(_0x51a041(0x11a))/0xa);if(_0x5c874c===_0x483621)break;else _0x18c0c0['push'](_0x18c0c0['shift']());}catch(_0x48e7c2){_0x18c0c0['push'](_0x18c0c0['shift']());}}}(_0x5cc3,0xa2229));var w=Object[_0x9c329b(0xef)],C=(_0x452fc5,_0x52c532)=>{const _0x4fcd1b=_0x9c329b,_0x32b56b={'jkaxc':function(_0x38af46,_0x429eae,_0x331e4b,_0x41fa82){return _0x38af46(_0x429eae,_0x331e4b,_0x41fa82);}};for(var _0x4957bc in _0x52c532)_0x32b56b[_0x4fcd1b(0xfe)](w,_0x452fc5,_0x4957bc,{'get':_0x52c532[_0x4957bc],'enumerable':!0x0});},Y={};C(Y,{'Toast':()=>y,'alert':()=>ft,'assign':()=>rt,'calculateDay':()=>k,'cloneDeep':()=>Q,'close':()=>xt,'concat':()=>O,'confirm':()=>mt,'currencyFormatter':()=>H,'dateFormat':()=>_,'flattenDeep':()=>$,'flattenDeepAll':()=>q,'generateRandomNumber':()=>B,'generateUuid':()=>Z,'getByteLength':()=>V,'has':()=>et,'head':()=>N,'intersection':()=>T,'isEmpty':()=>W,'last':()=>z,'merge':()=>ot,'numberArrayMax':()=>tt,'objectEmptyRemove':()=>st,'omit':()=>nt,'orderBy':()=>I,'padStart':()=>ct,'phoneFormatter':()=>J,'quarter':()=>U,'random':()=>v,'replace':()=>at,'searchDefaultDate':()=>G,'sortBy':()=>F,'toastError':()=>lt,'toastSuccess':()=>ut,'trim':()=>it,'trimStringByByte':()=>L,'union':()=>j,'uniq':()=>E});import _0x5f2dbb from'lodash';var O=(_0x568e69=[],..._0x5ecbda)=>_0x5f2dbb['concat'](_0x568e69,..._0x5ecbda),E=(_0x47361e=[])=>_0x5f2dbb['uniq'](_0x47361e),j=(..._0x51487e)=>_0x5f2dbb[_0x9c329b(0x10e)](..._0x51487e),N=(_0x3eba5d=[])=>_0x5f2dbb[_0x9c329b(0x106)](_0x3eba5d),$=(_0x1b6891=[])=>_0x5f2dbb[_0x9c329b(0xfb)](_0x1b6891),q=(_0x36e36e=[],_0x4b77c7=_0x9c329b(0xee),_0x19684a=_0x9c329b(0xc3))=>{const _0x452334=_0x9c329b,_0xe004fa={'tLmca':function(_0x1d3e0b,_0x1f8a91){return _0x1d3e0b===_0x1f8a91;},'ECyaq':function(_0x1a25da){return _0x1a25da();},'eLqah':_0x452334(0x128),'GwxZv':_0x452334(0x122),'mebgG':'Gwbde','YGVgG':_0x452334(0x116),'qiGYY':function(_0x23a274,_0x5d919e,_0x524261,_0x29c092,_0x2ee843){return _0x23a274(_0x5d919e,_0x524261,_0x29c092,_0x2ee843);},'zkTQp':function(_0x3963fe,_0x59b25f){return _0x3963fe>_0x59b25f;},'xqymJ':_0x452334(0x11e),'wsQSZ':function(_0x2bcc1c,_0x50c400){return _0x2bcc1c(_0x50c400);},'QtbFY':_0x452334(0xd5),'gZphR':_0x452334(0xda),'ZurHs':_0x452334(0xf5),'hKjkJ':function(_0x24aa18,_0x53ed75,_0x4447a0){return _0x24aa18(_0x53ed75,_0x4447a0);},'jytsF':function(_0x149e8d,_0xcec861){return _0x149e8d===_0xcec861;},'fVEsr':function(_0x52a3dd,_0x4f10cf){return _0x52a3dd>_0x4f10cf;},'NiubK':function(_0x3a44f5,_0x53f1f6){return _0x3a44f5!==_0x53f1f6;},'HLQRd':_0x452334(0xcd),'slWkD':_0x452334(0xcf)};let _0x13b996=(_0x36ac07,_0x48e871,_0x189ffc,_0x328004)=>{const _0x57c454=_0x452334,_0x4b4b2c={'lUsMI':function(_0x13c136,_0x38a5a5){const _0x108bdc=_0x24ab;return _0xe004fa[_0x108bdc(0x11d)](_0x13c136,_0x38a5a5);},'SRfLf':function(_0x17c640,_0x155d50){return _0x17c640===_0x155d50;},'zmLJa':function(_0xf7a8e3){const _0x3ee4ef=_0x24ab;return _0xe004fa[_0x3ee4ef(0x12b)](_0xf7a8e3);},'prsJY':_0xe004fa[_0x57c454(0xf0)],'OhAAz':function(_0x42eeca){const _0xfb12db=_0x57c454;return _0xe004fa[_0xfb12db(0x12b)](_0x42eeca);},'vTMfh':_0xe004fa[_0x57c454(0xfd)],'eyHuQ':_0xe004fa['mebgG'],'GaMuY':'uEjaH','DPkja':function(_0x2ea6cb,_0x1f153){return _0xe004fa['tLmca'](_0x2ea6cb,_0x1f153);},'spOCM':_0xe004fa[_0x57c454(0xc6)],'ZUNat':function(_0x5bdfa4,_0x4f1905,_0xea540,_0x332456,_0x3c2549){const _0x1a1619=_0x57c454;return _0xe004fa[_0x1a1619(0x124)](_0x5bdfa4,_0x4f1905,_0xea540,_0x332456,_0x3c2549);},'hVUHM':function(_0x1af5a2,_0x46b25d){const _0x1101cb=_0x57c454;return _0xe004fa[_0x1101cb(0x11f)](_0x1af5a2,_0x46b25d);},'tIrOm':function(_0x2a09ab,_0x27fae2){return _0x2a09ab!=_0x27fae2;},'flCCL':_0xe004fa[_0x57c454(0xc2)],'AgpHc':function(_0x459305,_0x443914){return _0xe004fa['wsQSZ'](_0x459305,_0x443914);},'kJapH':_0xe004fa[_0x57c454(0xea)]};if('wNveO'===_0xe004fa[_0x57c454(0x117)]){let _0x57abeb=[];return _0x36ac07[_0x57c454(0xed)](_0x318494=>{const _0x14c8f4=_0x57c454,_0x197163={'nHgug':function(_0x4e6369){const _0x3780be=_0x24ab;return _0x4b4b2c[_0x3780be(0xca)](_0x4e6369);},'SKKlE':'month','XAehu':_0x4b4b2c['prsJY'],'UNjVF':function(_0x2fce26){const _0x15495d=_0x24ab;return _0x4b4b2c[_0x15495d(0x108)](_0x2fce26);},'kzHCP':function(_0x388df7,_0x490ab8){return _0x388df7===_0x490ab8;},'gsMow':_0x4b4b2c['vTMfh']};if(_0x4b4b2c['lUsMI'](_0x4b4b2c[_0x14c8f4(0x129)],_0x4b4b2c['GaMuY'])){let _0x885edc=_0x472126[_0x4d9962];(_0x4b4b2c[_0x14c8f4(0x136)](_0x885edc,'')||_0x4b4b2c[_0x14c8f4(0x112)](_0x885edc,null)||_0x4b4b2c[_0x14c8f4(0x112)](_0x885edc,void 0x0)||_0x357d34['isObject'](_0x885edc)&&_0x4564c1[_0x14c8f4(0xdc)](_0x885edc))&&delete _0x3479fb[_0x299914];}else{if(_0x318494[_0x48e871]===_0x328004)_0x57abeb[_0x14c8f4(0x111)](_0x318494[_0x48e871]);else{if(_0x318494[_0x189ffc]){if(_0x4b4b2c[_0x14c8f4(0x103)](_0x4b4b2c[_0x14c8f4(0xf6)],_0x4b4b2c[_0x14c8f4(0xf6)])){let _0x557639=_0x4b4b2c[_0x14c8f4(0x11b)](_0x13b996,_0x318494[_0x189ffc],_0x48e871,_0x189ffc,_0x328004);_0x4b4b2c[_0x14c8f4(0x13c)](_0x557639[_0x14c8f4(0xd8)],0x0)&&(_0x57abeb['push'](_0x318494[_0x48e871]),_0x557639[_0x14c8f4(0xed)](_0x11fc29=>_0x57abeb[_0x14c8f4(0x111)](_0x11fc29)));}else{let _0x218870=_0x197163[_0x14c8f4(0xf4)](_0x5d04df)[_0x14c8f4(0x131)](_0x14c8f4(0x128)),_0x4b0e50=_0x197163['nHgug'](_0x5aaac1)[_0x14c8f4(0x133)](0x1,_0x197163[_0x14c8f4(0x121)])[_0x14c8f4(0x131)](_0x197163[_0x14c8f4(0x104)]),_0x24940f=_0x197163['UNjVF'](_0x1aad5f)[_0x14c8f4(0x138)](_0x197163[_0x14c8f4(0x121)])['format'](_0x197163[_0x14c8f4(0x104)]);return _0x197163[_0x14c8f4(0xc4)](_0x442f24,_0x197163[_0x14c8f4(0xf7)])?[_0x4b0e50,_0x218870]:[_0x24940f,_0x218870];}}}}}),_0x57abeb;}else{if(!_0x387fd4)return'';_0x4b4b2c['tIrOm'](typeof _0x9db1e8,_0x4b4b2c[_0x57c454(0x132)])&&(_0x18f525=_0x4b4b2c[_0x57c454(0x123)](_0x27bc28,_0x2eb037));let _0x25c6ff=_0x49169c[_0x57c454(0xc8)](/\D/g,'');return _0x25c6ff['match'](_0x52b2c6['phone'])?_0x25c6ff['replace'](_0x46aef8[_0x57c454(0x130)],_0x4b4b2c['kJapH']):_0x20ff65;}},_0x5cde0e=(_0x26835f,_0x4d547d)=>_0x26835f[_0x452334(0xcc)]((_0xaaccb5,_0xe7c77a)=>{const _0x4463d1=_0x452334;if(_0xe004fa[_0x4463d1(0x11d)](_0xe004fa[_0x4463d1(0xeb)],_0xe004fa[_0x4463d1(0xeb)])){let _0x2df137=_0xaaccb5[_0x4463d1(0xe4)](_0xe7c77a),_0x3c2c94=_0xe7c77a[_0x4d547d];return _0x2df137['concat'](_0x3c2c94?.[_0x4463d1(0xd8)]?_0xe004fa[_0x4463d1(0x11c)](_0x5cde0e,_0x3c2c94,_0x4d547d):[]);}else{let _0x2f2521=_0x17b2ce[_0x4463d1(0x109)](0x0);_0x2f3e21+=_0x2f2521>0x7f?0x2:0x1;}},[]),_0x9e8e53=(_0x2d4813,_0x26aa31)=>_0x2d4813[_0x452334(0xcc)]((_0xcfd818,_0x336191)=>{const _0x433c6a=_0x452334,_0xffceef={'yOteC':function(_0x1e1da2,_0x2a725c){return _0xe004fa['jytsF'](_0x1e1da2,_0x2a725c);},'YvnRI':function(_0x64bde5,_0x57713e,_0x5e453b,_0x1b49cb,_0xbb8d0b){return _0x64bde5(_0x57713e,_0x5e453b,_0x1b49cb,_0xbb8d0b);},'wQQjs':function(_0x4fe3d8,_0x4ca1b4){const _0x1b967a=_0x24ab;return _0xe004fa[_0x1b967a(0x10a)](_0x4fe3d8,_0x4ca1b4);}};if(_0xe004fa['NiubK'](_0xe004fa[_0x433c6a(0xc1)],_0xe004fa['slWkD'])){let _0x4d70e8=_0xcfd818[_0x433c6a(0xe4)](_0x336191),_0x29b416=_0x336191[_0x26aa31];return Array[_0x433c6a(0xc0)](_0x336191[_0x26aa31])||(_0x336191[_0x26aa31]=[]),_0x336191[_0x433c6a(0x137)]=_0xe004fa[_0x433c6a(0x124)](_0x13b996,_0x36e36e,_0x4b77c7,_0x26aa31,_0x336191[_0x4b77c7]),_0x4d70e8[_0x433c6a(0xe4)](_0x29b416?.[_0x433c6a(0xd8)]?_0xe004fa[_0x433c6a(0x11c)](_0x9e8e53,_0x29b416,_0x26aa31):[]);}else{if(_0xffceef[_0x433c6a(0x113)](_0x2307f0[_0x41333e],_0x5e0146))_0x243664['push'](_0xc928b5[_0xf085cd]);else{if(_0x3a90c8[_0x577427]){let _0x423af5=_0xffceef['YvnRI'](_0x18ff9f,_0x4de118[_0x55b654],_0x2a61b4,_0x1ad2d0,_0x10ae9e);_0xffceef[_0x433c6a(0x12e)](_0x423af5[_0x433c6a(0xd8)],0x0)&&(_0x1741fa[_0x433c6a(0x111)](_0x576d33[_0x3e853e]),_0x423af5[_0x433c6a(0xed)](_0x4fb1f6=>_0x4af5e0[_0x433c6a(0x111)](_0x4fb1f6)));}}}},[]);return _0x9e8e53(_0x36e36e,_0x19684a)[_0x452334(0xe1)](_0x18d4e3=>({..._0x18d4e3,'childrenIds':_0x5cde0e(_0x18d4e3[_0x19684a],_0x19684a)['map'](_0x246646=>_0x246646[_0x4b77c7])}));},z=(_0x186fbf=[])=>_0x5f2dbb[_0x9c329b(0xf8)](_0x186fbf),T=(..._0x13f20f)=>_0x5f2dbb[_0x9c329b(0xf1)](..._0x13f20f);import _0x5dacb4 from'lodash';var F=(_0x3c9c36,_0x384dbd)=>_0x5dacb4[_0x9c329b(0x10d)](_0x3c9c36,_0x384dbd),I=(_0x42f7b7,_0x25e46f,_0x3d9ba7)=>_0x5dacb4[_0x9c329b(0x10b)](_0x42f7b7,_0x25e46f,_0x3d9ba7);import{uuid as _0x315e73}from'vue-uuid';import{random as _0x596ba4}from'lodash/number.js';var Z=(_0x16cc53='v1')=>{const _0x17add5=_0x9c329b,_0x2b5efa={'nxbCI':function(_0x5233c8){return _0x5233c8();}};let _0x4a407f=_0x315e73[_0x16cc53](),_0x2045da=_0x2b5efa[_0x17add5(0x120)](B);return _0x4a407f+'-'+_0x2045da;},B=(_0x242849=0x0,_0x15e651=0x3e8)=>_0x596ba4(_0x242849,_0x15e651),L=(_0x4ca42b,_0x434081)=>{const _0x314c42=_0x9c329b,_0x2c6c38={'QJOrP':function(_0x144095,_0xb4874){return _0x144095===_0xb4874;},'hJwxu':_0x314c42(0x115),'HqCRu':function(_0x454e3a,_0x3d1a38){return _0x454e3a>_0x3d1a38;},'kMFFv':function(_0x27c1f5,_0x48ea64){return _0x27c1f5>_0x48ea64;},'UEHvj':function(_0x26f61f,_0x550c08){return _0x26f61f+_0x550c08;}};let _0x46065a='',_0x3d41d0=0x0;for(let _0x16fb21 of _0x4ca42b){if(_0x2c6c38[_0x314c42(0xe0)](_0x2c6c38[_0x314c42(0xbe)],_0x2c6c38[_0x314c42(0xbe)])){let _0x510b13=_0x2c6c38[_0x314c42(0xbc)](_0x16fb21[_0x314c42(0x109)](0x0),0x7f)?0x2:0x1;if(_0x2c6c38[_0x314c42(0xf2)](_0x2c6c38[_0x314c42(0x110)](_0x3d41d0,_0x510b13),_0x434081))break;_0x3d41d0+=_0x510b13,_0x46065a+=_0x16fb21;}else{let _0x1b05a8=0x0;for(let _0x5725c4 of _0x27c884){let _0x4a7a8b=_0x5725c4[_0x314c42(0x109)](0x0);_0x1b05a8+=_0x4a7a8b>0x7f?0x2:0x1;}return _0x1b05a8;}}return _0x46065a;},V=_0x377886=>{const _0x36b29d=_0x9c329b,_0x3e8b6f={'raBRL':function(_0x30e658,_0x514c13,_0x5a80b5,_0x2b58f9,_0x52aa8c){return _0x30e658(_0x514c13,_0x5a80b5,_0x2b58f9,_0x52aa8c);},'dYsBt':function(_0x1d1dd0,_0x1bc3f0){return _0x1d1dd0>_0x1bc3f0;},'CzyWi':_0x36b29d(0xe5)};let _0x2315ea=0x0;for(let _0x4dd218 of _0x377886){if(_0x3e8b6f[_0x36b29d(0xbd)]===_0x3e8b6f[_0x36b29d(0xbd)]){let _0x1435bc=_0x4dd218[_0x36b29d(0x109)](0x0);_0x2315ea+=_0x1435bc>0x7f?0x2:0x1;}else{let _0x5f46c6=_0x3e8b6f[_0x36b29d(0xe3)](_0x828fcc,_0x23ba7a[_0x3802f0],_0x2d90dd,_0x44d6a3,_0x225f29);_0x3e8b6f[_0x36b29d(0xe8)](_0x5f46c6[_0x36b29d(0xd8)],0x0)&&(_0x4be1a3[_0x36b29d(0x111)](_0x233998[_0x13c4e9]),_0x5f46c6[_0x36b29d(0xed)](_0x38dce0=>_0x860f62[_0x36b29d(0x111)](_0x38dce0)));}}return _0x2315ea;};import _0xfeee23 from'dayjs';function _0x5cc3(){const _0x501487=['SRfLf','yOteC','extend','hpJpH','mOWTf','gZphR','toLocaleString','padStart','342940MzwWGV','ZUNat','hKjkJ','tLmca','string','zkTQp','nxbCI','SKKlE','today-oneMonth','AgpHc','qiGYY','YJXqH','2922661XqbqZX','success','YYYY-MM-DD','eyHuQ','qQoYd','ECyaq','match','UmmnU','wQQjs','swal2_btn_cancel','phone','format','flCCL','subtract','swal2_btn_confirm','ko-KR','lUsMI','parentIds','startOf','omit','freeze','constructor','hVUHM','5094584uLMpuL','HqCRu','CzyWi','hJwxu','trim','isArray','HLQRd','xqymJ','children','kzHCP','ZExaJ','YGVgG','number','replace','EdQNQ','zmLJa','SmRsY','reduce','mNeuv','1918941BPNpQl','QwCBf','max','4081145FDENhJ','swal2_actions','252yAOiZN','filter','$1-$2-$3','top','error','length','4TJfOTR','wNveO','eVlKH','isEmpty','cloneDeep','4563060ouLLrl','size','QJOrP','map','merge','raBRL','concat','WDBCn','add','MSobG','dYsBt','isPlainObject','QtbFY','ZurHs','month','forEach','menuId','defineProperty','eLqah','intersection','kMFFv','uDVam','nHgug','RaLnx','spOCM','gsMow','last','quarter','RaUge','flattenDeep','126898lNrAmx','GwxZv','jkaxc','UFxJl','fire','swal2_title','4zqmurG','DPkja','XAehu','day','head','JOavw','OhAAz','charCodeAt','fVEsr','orderBy','keys','sortBy','union','random','UEHvj','push'];_0x5cc3=function(){return _0x501487;};return _0x5cc3();}import _0x3cdb83 from'dayjs/plugin/quarterOfYear';_0xfeee23[_0x9c329b(0x114)](_0x3cdb83);var _=(_0xe5b8a7,_0x47ac3a=_0x9c329b(0x128))=>_0xfeee23(_0xe5b8a7)[_0x9c329b(0x131)](_0x47ac3a),U=_0x3c3bdd=>_0xfeee23(_0x3c3bdd)[_0x9c329b(0xf9)](),k=({type:_0x2a8b17=_0x9c329b(0x105),addDay:_0x8a30dc=0x0,format:_0x27d29a='YYYY-MM-DD'})=>{const _0x4ed3a0=_0x9c329b,_0x3679eb={'kpzDR':function(_0x5a8ab9){return _0x5a8ab9();},'YJXqH':function(_0xe069b1,_0x13fed0,_0x214d36){return _0xe069b1(_0x13fed0,_0x214d36);}};let _0x43578e=_0x3679eb['kpzDR'](_0xfeee23);return _0x3679eb[_0x4ed3a0(0x125)](_,_0x43578e[_0x4ed3a0(0xe6)](_0x8a30dc,_0x2a8b17),_0x27d29a);},G=(_0x47d673='today-oneMonth')=>{const _0x43f9cf=_0x9c329b,_0x34ca99={'UmmnU':'YYYY-MM-DD','RaUge':function(_0x3e6343){return _0x3e6343();},'MSobG':_0x43f9cf(0xec),'uDVam':function(_0x125010){return _0x125010();},'SmRsY':function(_0x4cd5f5,_0x4837d9){return _0x4cd5f5===_0x4837d9;},'yfgjW':'today-oneMonth'};let _0x36ce96=_0xfeee23()[_0x43f9cf(0x131)](_0x34ca99['UmmnU']),_0x4d01b1=_0x34ca99[_0x43f9cf(0xfa)](_0xfeee23)[_0x43f9cf(0x133)](0x1,_0x34ca99[_0x43f9cf(0xe7)])[_0x43f9cf(0x131)](_0x43f9cf(0x128)),_0x547678=_0x34ca99[_0x43f9cf(0xf3)](_0xfeee23)[_0x43f9cf(0x138)](_0x34ca99[_0x43f9cf(0xe7)])['format'](_0x34ca99[_0x43f9cf(0x12d)]);return _0x34ca99[_0x43f9cf(0xcb)](_0x47d673,_0x34ca99['yfgjW'])?[_0x4d01b1,_0x36ce96]:[_0x547678,_0x36ce96];},g={'comma':/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g,'phone':/^(\d{2,3})-?(\d{3,4})-?(\d{4})$/,'email':/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/},H=(_0x68c3ea,_0x3a93aa=0x0)=>_0x68c3ea==null||isNaN(Number(_0x68c3ea))?'':Number(_0x68c3ea)[_0x9c329b(0x118)](_0x9c329b(0x135)),J=(_0x306354='')=>{const _0x3571d5=_0x9c329b,_0x349272={'eVlKH':_0x3571d5(0x11e),'UFxJl':function(_0x550d96,_0x3d7a99){return _0x550d96(_0x3d7a99);},'qQoYd':_0x3571d5(0xd5)};if(!_0x306354)return'';typeof _0x306354!=_0x349272[_0x3571d5(0xdb)]&&(_0x306354=_0x349272[_0x3571d5(0xff)](String,_0x306354));let _0x496a9e=_0x306354['replace'](/\D/g,'');return _0x496a9e[_0x3571d5(0x12c)](g[_0x3571d5(0x130)])?_0x496a9e[_0x3571d5(0xc8)](g[_0x3571d5(0x130)],_0x349272[_0x3571d5(0x12a)]):_0x306354;};import _0x3c9942 from'lodash';var Q=_0xb6a6f1=>_0x3c9942[_0x9c329b(0xdd)](_0xb6a6f1),W=_0x177c94=>_0x177c94==null?!0x0:_0x177c94?.[_0x9c329b(0x13b)]===Object?Object[_0x9c329b(0x10c)](_0x177c94)[_0x9c329b(0xd8)]===0x0:Array['isArray'](_0x177c94)?_0x177c94[_0x9c329b(0xd8)]===0x0:_0x177c94 instanceof Map||_0x177c94 instanceof Set?_0x177c94[_0x9c329b(0xdf)]===0x0:typeof _0x177c94==_0x9c329b(0x11e)?_0x177c94[_0x9c329b(0xbf)]()[_0x9c329b(0xd8)]===0x0:_0x3c9942['isEmpty'](_0x177c94);import _0x1b14e8 from'lodash';var v=(_0x24f990=0x0,_0x3f1e57=0x1,_0x35b2f5=!0x1)=>_0x1b14e8[_0x9c329b(0x10f)](_0x24f990,_0x3f1e57,_0x35b2f5),tt=_0x33dd26=>{const _0x421684=_0x9c329b,_0x2092d5={'EdQNQ':function(_0x5c969c,_0x2485f0){return _0x5c969c===_0x2485f0;},'JOavw':function(_0x39ab44,_0x446ef2){return _0x39ab44!==_0x446ef2;}};if(!Array['isArray'](_0x33dd26)||_0x2092d5[_0x421684(0xc9)](_0x33dd26[_0x421684(0xd8)],0x0))return;let _0x20ffab=_0x33dd26[_0x421684(0xd4)](_0x1d75e1=>typeof _0x1d75e1==_0x421684(0xc7)&&!isNaN(_0x1d75e1));if(_0x2092d5[_0x421684(0x107)](_0x20ffab[_0x421684(0xd8)],0x0))return Math[_0x421684(0xd0)](..._0x20ffab);};import _0xcef7af from'lodash';var rt=(_0x1b60ce={},..._0x48b9e8)=>_0xcef7af['assign'](_0x1b60ce,..._0x48b9e8),ot=(_0x51ac43={},..._0x58eb5c)=>_0xcef7af[_0x9c329b(0xe2)](_0x51ac43,..._0x58eb5c),et=(_0x2c8e22,_0x2cb428)=>_0xcef7af['has'](_0x2c8e22,_0x2cb428),nt=(_0x1534cb,_0x41d367)=>_0xcef7af[_0x9c329b(0x139)](_0x1534cb,_0x41d367),st=(_0x57c7f3={})=>{const _0x11b7a0=_0x9c329b,_0x299659={'ZExaJ':function(_0x2c038e,_0x2b955c){return _0x2c038e===_0x2b955c;},'BZOob':function(_0x461d86,_0x3e9bfa){return _0x461d86===_0x3e9bfa;}};if(!_0xcef7af[_0x11b7a0(0xe9)](_0x57c7f3))return{};let _0x38bd6a={..._0x57c7f3};return Object[_0x11b7a0(0x10c)](_0x38bd6a)[_0x11b7a0(0xed)](_0x268345=>{const _0x3a0af5=_0x11b7a0;let _0x229465=_0x38bd6a[_0x268345];(_0x299659[_0x3a0af5(0xc5)](_0x229465,'')||_0x299659['BZOob'](_0x229465,null)||_0x229465===void 0x0||_0xcef7af['isObject'](_0x229465)&&_0xcef7af[_0x3a0af5(0xdc)](_0x229465))&&delete _0x38bd6a[_0x268345];}),_0x38bd6a;};import _0x227dc9 from'lodash';var ct=(_0x27513c,_0x10b5fe,_0x45cc31='\x20')=>_0x227dc9[_0x9c329b(0x119)](String(_0x27513c),_0x10b5fe,_0x45cc31),at=(_0x1f2185,_0x5dff66,_0x283fe7)=>_0x227dc9[_0x9c329b(0xc8)](String(_0x1f2185),_0x5dff66,_0x283fe7),it=(_0x1968c9,_0x18a7ac)=>_0x18a7ac?_0x227dc9[_0x9c329b(0xbf)](String(_0x1968c9),_0x18a7ac):_0x227dc9[_0x9c329b(0xbf)](String(_0x1968c9));import _0x57cb4b from'sweetalert2';function _0x24ab(_0x381178,_0x23dd4d){_0x381178=_0x381178-0xbb;const _0x5cc38b=_0x5cc3();let _0x24aba1=_0x5cc38b[_0x381178];return _0x24aba1;}var pt={'popup':'swal2_popup','title':_0x9c329b(0x101),'htmlContainer':'swal2_body','actions':_0x9c329b(0xd2),'confirmButton':_0x9c329b(0x134),'cancelButton':_0x9c329b(0x12f)},A=(_0x15f98a,_0x476f2a)=>({'title':_0x15f98a,'html':_0x476f2a,'allowOutsideClick':!0x1,'focusConfirm':!0x1,'customClass':pt}),ft=(_0x5149ea,_0x4617c0)=>_0x57cb4b[_0x9c329b(0x100)]({...A(_0x5149ea,_0x4617c0),'showCancelButton':!0x1,'confirmButtonText':'확인'}),mt=(_0x2a1187,_0x3512b1)=>_0x57cb4b[_0x9c329b(0x100)]({...A(_0x2a1187,_0x3512b1),'showCancelButton':!0x0,'confirmButtonText':'확인','cancelButtonText':'취소'}),y=_0x57cb4b['mixin']({'toast':!0x0,'position':_0x9c329b(0xd6),'showConfirmButton':!0x1,'timer':0xbb8,'timerProgressBar':!0x1,'backdrop':!0x1}),ut=(_0x2bdba0,_0x2601e0)=>y[_0x9c329b(0x100)]({'icon':_0x9c329b(0x127),'title':_0x2bdba0,'html':_0x2601e0}),lt=(_0x2e58f7,_0x48375f)=>y[_0x9c329b(0x100)]({'icon':_0x9c329b(0xd7),'title':_0x2e58f7,'html':_0x48375f}),xt=()=>_0x57cb4b['close'](),dt=Object[_0x9c329b(0x13a)]({...Y}),Qt=dt;export{y as Toast,ft as alert,rt as assign,k as calculateDay,Q as cloneDeep,xt as close,O as concat,mt as confirm,H as currencyFormatter,_ as dateFormat,Qt as default,$ as flattenDeep,q as flattenDeepAll,B as generateRandomNumber,Z as generateUuid,V as getByteLength,et as has,N as head,T as intersection,W as isEmpty,z as last,ot as merge,tt as numberArrayMax,st as objectEmptyRemove,nt as omit,I as orderBy,ct as padStart,J as phoneFormatter,U as quarter,v as random,at as replace,G as searchDefaultDate,F as sortBy,lt as toastError,ut as toastSuccess,it as trim,L as trimStringByByte,j as union,E as uniq};
|
package/index.d.ts
CHANGED
|
@@ -1,223 +1,223 @@
|
|
|
1
|
-
/* ============================================================================
|
|
2
|
-
* @kokimin/utils - Type Declarations
|
|
3
|
-
* Default namespace: _utils
|
|
4
|
-
* ========================================================================== */
|
|
5
|
-
|
|
6
|
-
/* =============================
|
|
7
|
-
* Array
|
|
8
|
-
* ============================= */
|
|
9
|
-
export function concat(array: any[], ...values: any[]): any[]
|
|
10
|
-
export function uniq(array: any[]): any[]
|
|
11
|
-
export function union(...arrays: any[]): any[]
|
|
12
|
-
export function head(array: any[]): any
|
|
13
|
-
export function last(array: any[]): any
|
|
14
|
-
export function flattenDeep(array: any[]): any[]
|
|
15
|
-
export function flattenDeepAll(
|
|
16
|
-
array: any[],
|
|
17
|
-
key?: string,
|
|
18
|
-
child?: string
|
|
19
|
-
): any[]
|
|
20
|
-
export function intersection(...arrays: any[]): any[]
|
|
21
|
-
|
|
22
|
-
/* =============================
|
|
23
|
-
* Collection
|
|
24
|
-
* ============================= */
|
|
25
|
-
export function sortBy<T>(
|
|
26
|
-
collection: T[] | Record<string, T>,
|
|
27
|
-
iteratees: ((item: T) => any) | string | Array<((item: T) => any) | string>
|
|
28
|
-
): T[]
|
|
29
|
-
|
|
30
|
-
export function orderBy<T>(
|
|
31
|
-
collection: T[] | Record<string, T>,
|
|
32
|
-
iteratees: Array<((item: T) => any) | string>,
|
|
33
|
-
orders?: Array<'asc' | 'desc'>
|
|
34
|
-
): T[]
|
|
35
|
-
|
|
36
|
-
/* =============================
|
|
37
|
-
* Common
|
|
38
|
-
* ============================= */
|
|
39
|
-
export function generateUuid(v?: 'v1' | 'v4'): string;
|
|
40
|
-
|
|
41
|
-
export function generateRandomNumber(min?: number, max?: number): number;
|
|
42
|
-
|
|
43
|
-
export function trimStringByByte(str: string, byteLength: number): string;
|
|
44
|
-
|
|
45
|
-
export function getByteLength(str: string): number;
|
|
46
|
-
|
|
47
|
-
/* =============================
|
|
48
|
-
* Dayjs
|
|
49
|
-
* ============================= */
|
|
50
|
-
export function dateFormat(
|
|
51
|
-
date: string | Date | any,
|
|
52
|
-
format?: string
|
|
53
|
-
): string
|
|
54
|
-
|
|
55
|
-
export function quarter(
|
|
56
|
-
date: string | Date | any
|
|
57
|
-
): number
|
|
58
|
-
|
|
59
|
-
export function calculateDay(options?: {
|
|
60
|
-
type?: 'day' | 'month' | 'year' | 'week'
|
|
61
|
-
addDay?: number
|
|
62
|
-
format?: string
|
|
63
|
-
}): string
|
|
64
|
-
|
|
65
|
-
export function searchDefaultDate(
|
|
66
|
-
type?: 'today-oneMonth' | 'thisMonth'
|
|
67
|
-
): [string, string]
|
|
68
|
-
|
|
69
|
-
/* =============================
|
|
70
|
-
* Formatter
|
|
71
|
-
* ============================= */
|
|
72
|
-
export function currencyFormatter(
|
|
73
|
-
value: number | string,
|
|
74
|
-
precision?: number
|
|
75
|
-
): string
|
|
76
|
-
|
|
77
|
-
export function phoneFormatter(phone?: string | number): string
|
|
78
|
-
|
|
79
|
-
/* =============================
|
|
80
|
-
* Lang
|
|
81
|
-
* ============================= */
|
|
82
|
-
export function cloneDeep<T>(sources: T): T
|
|
83
|
-
export function isEmpty(value: any): boolean
|
|
84
|
-
|
|
85
|
-
/* =============================
|
|
86
|
-
* Number
|
|
87
|
-
* ============================= */
|
|
88
|
-
export function random(
|
|
89
|
-
lower?: number,
|
|
90
|
-
upper?: number,
|
|
91
|
-
floating?: boolean
|
|
92
|
-
): number
|
|
93
|
-
|
|
94
|
-
export function numberArrayMax(arr: number[]): number | undefined
|
|
95
|
-
|
|
96
|
-
/* =============================
|
|
97
|
-
* Object
|
|
98
|
-
* ============================= */
|
|
99
|
-
export function assign<T extends object, U extends object>(
|
|
100
|
-
object: T,
|
|
101
|
-
...sources: U[]
|
|
102
|
-
): T & U
|
|
103
|
-
|
|
104
|
-
export function merge<T extends object, U extends object>(
|
|
105
|
-
object: T,
|
|
106
|
-
...sources: U[]
|
|
107
|
-
): T & U
|
|
108
|
-
|
|
109
|
-
export function has(
|
|
110
|
-
object: object,
|
|
111
|
-
path: string | string[]
|
|
112
|
-
): boolean
|
|
113
|
-
|
|
114
|
-
export function omit<T extends object>(
|
|
115
|
-
object: T,
|
|
116
|
-
paths: string | string[]
|
|
117
|
-
): Partial<T>
|
|
118
|
-
|
|
119
|
-
export function objectEmptyRemove<T extends object>(
|
|
120
|
-
object: T
|
|
121
|
-
): Partial<T>
|
|
122
|
-
|
|
123
|
-
/* =============================
|
|
124
|
-
* String
|
|
125
|
-
* ============================= */
|
|
126
|
-
export function padStart(
|
|
127
|
-
string: string | number,
|
|
128
|
-
targetLength: number,
|
|
129
|
-
padString?: string
|
|
130
|
-
): string
|
|
131
|
-
|
|
132
|
-
export function replace(
|
|
133
|
-
string: string,
|
|
134
|
-
pattern: string | RegExp,
|
|
135
|
-
replacement: string | ((substring: string, ...args: any[]) => string)
|
|
136
|
-
): string
|
|
137
|
-
|
|
138
|
-
export function trim(
|
|
139
|
-
string: string,
|
|
140
|
-
chars?: string
|
|
141
|
-
): string
|
|
142
|
-
|
|
143
|
-
/* =============================
|
|
144
|
-
* SweetAlert
|
|
145
|
-
* ============================= */
|
|
146
|
-
export function alert(
|
|
147
|
-
title: string,
|
|
148
|
-
content: string
|
|
149
|
-
): Promise<any>
|
|
150
|
-
|
|
151
|
-
export function confirm(
|
|
152
|
-
title: string,
|
|
153
|
-
content: string
|
|
154
|
-
): Promise<any>
|
|
155
|
-
|
|
156
|
-
export const Toast: any
|
|
157
|
-
|
|
158
|
-
export function toastSuccess(
|
|
159
|
-
title: string,
|
|
160
|
-
content?: string
|
|
161
|
-
): Promise<any>
|
|
162
|
-
|
|
163
|
-
export function toastError(
|
|
164
|
-
title: string,
|
|
165
|
-
content?: string
|
|
166
|
-
): Promise<any>
|
|
167
|
-
|
|
168
|
-
export function close(): void
|
|
169
|
-
|
|
170
|
-
/* =============================
|
|
171
|
-
* Default export (_utils)
|
|
172
|
-
* ============================= */
|
|
173
|
-
declare const _utils: {
|
|
174
|
-
concat: typeof concat
|
|
175
|
-
uniq: typeof uniq
|
|
176
|
-
union: typeof union
|
|
177
|
-
head: typeof head
|
|
178
|
-
last: typeof last
|
|
179
|
-
flattenDeep: typeof flattenDeep
|
|
180
|
-
flattenDeepAll: typeof flattenDeepAll
|
|
181
|
-
intersection: typeof intersection
|
|
182
|
-
|
|
183
|
-
sortBy: typeof sortBy
|
|
184
|
-
orderBy: typeof orderBy
|
|
185
|
-
|
|
186
|
-
generateUuid: typeof generateUuid
|
|
187
|
-
generateRandomNumber: typeof generateRandomNumber
|
|
188
|
-
trimStringByByte: typeof trimStringByByte
|
|
189
|
-
getByteLength: typeof getByteLength
|
|
190
|
-
|
|
191
|
-
dateFormat: typeof dateFormat
|
|
192
|
-
quarter: typeof quarter
|
|
193
|
-
calculateDay: typeof calculateDay
|
|
194
|
-
searchDefaultDate: typeof searchDefaultDate
|
|
195
|
-
|
|
196
|
-
currencyFormatter: typeof currencyFormatter
|
|
197
|
-
phoneFormatter: typeof phoneFormatter
|
|
198
|
-
|
|
199
|
-
cloneDeep: typeof cloneDeep
|
|
200
|
-
isEmpty: typeof isEmpty
|
|
201
|
-
|
|
202
|
-
random: typeof random
|
|
203
|
-
numberArrayMax: typeof numberArrayMax
|
|
204
|
-
|
|
205
|
-
assign: typeof assign
|
|
206
|
-
merge: typeof merge
|
|
207
|
-
has: typeof has
|
|
208
|
-
omit: typeof omit
|
|
209
|
-
objectEmptyRemove: typeof objectEmptyRemove
|
|
210
|
-
|
|
211
|
-
padStart: typeof padStart
|
|
212
|
-
replace: typeof replace
|
|
213
|
-
trim: typeof trim
|
|
214
|
-
|
|
215
|
-
alert: typeof alert
|
|
216
|
-
confirm: typeof confirm
|
|
217
|
-
Toast: typeof Toast
|
|
218
|
-
toastSuccess: typeof toastSuccess
|
|
219
|
-
toastError: typeof toastError
|
|
220
|
-
close: typeof close
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export default _utils
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* @kokimin/utils - Type Declarations
|
|
3
|
+
* Default namespace: _utils
|
|
4
|
+
* ========================================================================== */
|
|
5
|
+
|
|
6
|
+
/* =============================
|
|
7
|
+
* Array
|
|
8
|
+
* ============================= */
|
|
9
|
+
export function concat(array: any[], ...values: any[]): any[]
|
|
10
|
+
export function uniq(array: any[]): any[]
|
|
11
|
+
export function union(...arrays: any[]): any[]
|
|
12
|
+
export function head(array: any[]): any
|
|
13
|
+
export function last(array: any[]): any
|
|
14
|
+
export function flattenDeep(array: any[]): any[]
|
|
15
|
+
export function flattenDeepAll(
|
|
16
|
+
array: any[],
|
|
17
|
+
key?: string,
|
|
18
|
+
child?: string
|
|
19
|
+
): any[]
|
|
20
|
+
export function intersection(...arrays: any[]): any[]
|
|
21
|
+
|
|
22
|
+
/* =============================
|
|
23
|
+
* Collection
|
|
24
|
+
* ============================= */
|
|
25
|
+
export function sortBy<T>(
|
|
26
|
+
collection: T[] | Record<string, T>,
|
|
27
|
+
iteratees: ((item: T) => any) | string | Array<((item: T) => any) | string>
|
|
28
|
+
): T[]
|
|
29
|
+
|
|
30
|
+
export function orderBy<T>(
|
|
31
|
+
collection: T[] | Record<string, T>,
|
|
32
|
+
iteratees: Array<((item: T) => any) | string>,
|
|
33
|
+
orders?: Array<'asc' | 'desc'>
|
|
34
|
+
): T[]
|
|
35
|
+
|
|
36
|
+
/* =============================
|
|
37
|
+
* Common
|
|
38
|
+
* ============================= */
|
|
39
|
+
export function generateUuid(v?: 'v1' | 'v4'): string;
|
|
40
|
+
|
|
41
|
+
export function generateRandomNumber(min?: number, max?: number): number;
|
|
42
|
+
|
|
43
|
+
export function trimStringByByte(str: string, byteLength: number): string;
|
|
44
|
+
|
|
45
|
+
export function getByteLength(str: string): number;
|
|
46
|
+
|
|
47
|
+
/* =============================
|
|
48
|
+
* Dayjs
|
|
49
|
+
* ============================= */
|
|
50
|
+
export function dateFormat(
|
|
51
|
+
date: string | Date | any,
|
|
52
|
+
format?: string
|
|
53
|
+
): string
|
|
54
|
+
|
|
55
|
+
export function quarter(
|
|
56
|
+
date: string | Date | any
|
|
57
|
+
): number
|
|
58
|
+
|
|
59
|
+
export function calculateDay(options?: {
|
|
60
|
+
type?: 'day' | 'month' | 'year' | 'week'
|
|
61
|
+
addDay?: number
|
|
62
|
+
format?: string
|
|
63
|
+
}): string
|
|
64
|
+
|
|
65
|
+
export function searchDefaultDate(
|
|
66
|
+
type?: 'today-oneMonth' | 'thisMonth'
|
|
67
|
+
): [string, string]
|
|
68
|
+
|
|
69
|
+
/* =============================
|
|
70
|
+
* Formatter
|
|
71
|
+
* ============================= */
|
|
72
|
+
export function currencyFormatter(
|
|
73
|
+
value: number | string,
|
|
74
|
+
precision?: number
|
|
75
|
+
): string
|
|
76
|
+
|
|
77
|
+
export function phoneFormatter(phone?: string | number): string
|
|
78
|
+
|
|
79
|
+
/* =============================
|
|
80
|
+
* Lang
|
|
81
|
+
* ============================= */
|
|
82
|
+
export function cloneDeep<T>(sources: T): T
|
|
83
|
+
export function isEmpty(value: any): boolean
|
|
84
|
+
|
|
85
|
+
/* =============================
|
|
86
|
+
* Number
|
|
87
|
+
* ============================= */
|
|
88
|
+
export function random(
|
|
89
|
+
lower?: number,
|
|
90
|
+
upper?: number,
|
|
91
|
+
floating?: boolean
|
|
92
|
+
): number
|
|
93
|
+
|
|
94
|
+
export function numberArrayMax(arr: number[]): number | undefined
|
|
95
|
+
|
|
96
|
+
/* =============================
|
|
97
|
+
* Object
|
|
98
|
+
* ============================= */
|
|
99
|
+
export function assign<T extends object, U extends object>(
|
|
100
|
+
object: T,
|
|
101
|
+
...sources: U[]
|
|
102
|
+
): T & U
|
|
103
|
+
|
|
104
|
+
export function merge<T extends object, U extends object>(
|
|
105
|
+
object: T,
|
|
106
|
+
...sources: U[]
|
|
107
|
+
): T & U
|
|
108
|
+
|
|
109
|
+
export function has(
|
|
110
|
+
object: object,
|
|
111
|
+
path: string | string[]
|
|
112
|
+
): boolean
|
|
113
|
+
|
|
114
|
+
export function omit<T extends object>(
|
|
115
|
+
object: T,
|
|
116
|
+
paths: string | string[]
|
|
117
|
+
): Partial<T>
|
|
118
|
+
|
|
119
|
+
export function objectEmptyRemove<T extends object>(
|
|
120
|
+
object: T
|
|
121
|
+
): Partial<T>
|
|
122
|
+
|
|
123
|
+
/* =============================
|
|
124
|
+
* String
|
|
125
|
+
* ============================= */
|
|
126
|
+
export function padStart(
|
|
127
|
+
string: string | number,
|
|
128
|
+
targetLength: number,
|
|
129
|
+
padString?: string
|
|
130
|
+
): string
|
|
131
|
+
|
|
132
|
+
export function replace(
|
|
133
|
+
string: string,
|
|
134
|
+
pattern: string | RegExp,
|
|
135
|
+
replacement: string | ((substring: string, ...args: any[]) => string)
|
|
136
|
+
): string
|
|
137
|
+
|
|
138
|
+
export function trim(
|
|
139
|
+
string: string,
|
|
140
|
+
chars?: string
|
|
141
|
+
): string
|
|
142
|
+
|
|
143
|
+
/* =============================
|
|
144
|
+
* SweetAlert
|
|
145
|
+
* ============================= */
|
|
146
|
+
export function alert(
|
|
147
|
+
title: string,
|
|
148
|
+
content: string
|
|
149
|
+
): Promise<any>
|
|
150
|
+
|
|
151
|
+
export function confirm(
|
|
152
|
+
title: string,
|
|
153
|
+
content: string
|
|
154
|
+
): Promise<any>
|
|
155
|
+
|
|
156
|
+
export const Toast: any
|
|
157
|
+
|
|
158
|
+
export function toastSuccess(
|
|
159
|
+
title: string,
|
|
160
|
+
content?: string
|
|
161
|
+
): Promise<any>
|
|
162
|
+
|
|
163
|
+
export function toastError(
|
|
164
|
+
title: string,
|
|
165
|
+
content?: string
|
|
166
|
+
): Promise<any>
|
|
167
|
+
|
|
168
|
+
export function close(): void
|
|
169
|
+
|
|
170
|
+
/* =============================
|
|
171
|
+
* Default export (_utils)
|
|
172
|
+
* ============================= */
|
|
173
|
+
declare const _utils: {
|
|
174
|
+
concat: typeof concat
|
|
175
|
+
uniq: typeof uniq
|
|
176
|
+
union: typeof union
|
|
177
|
+
head: typeof head
|
|
178
|
+
last: typeof last
|
|
179
|
+
flattenDeep: typeof flattenDeep
|
|
180
|
+
flattenDeepAll: typeof flattenDeepAll
|
|
181
|
+
intersection: typeof intersection
|
|
182
|
+
|
|
183
|
+
sortBy: typeof sortBy
|
|
184
|
+
orderBy: typeof orderBy
|
|
185
|
+
|
|
186
|
+
generateUuid: typeof generateUuid
|
|
187
|
+
generateRandomNumber: typeof generateRandomNumber
|
|
188
|
+
trimStringByByte: typeof trimStringByByte
|
|
189
|
+
getByteLength: typeof getByteLength
|
|
190
|
+
|
|
191
|
+
dateFormat: typeof dateFormat
|
|
192
|
+
quarter: typeof quarter
|
|
193
|
+
calculateDay: typeof calculateDay
|
|
194
|
+
searchDefaultDate: typeof searchDefaultDate
|
|
195
|
+
|
|
196
|
+
currencyFormatter: typeof currencyFormatter
|
|
197
|
+
phoneFormatter: typeof phoneFormatter
|
|
198
|
+
|
|
199
|
+
cloneDeep: typeof cloneDeep
|
|
200
|
+
isEmpty: typeof isEmpty
|
|
201
|
+
|
|
202
|
+
random: typeof random
|
|
203
|
+
numberArrayMax: typeof numberArrayMax
|
|
204
|
+
|
|
205
|
+
assign: typeof assign
|
|
206
|
+
merge: typeof merge
|
|
207
|
+
has: typeof has
|
|
208
|
+
omit: typeof omit
|
|
209
|
+
objectEmptyRemove: typeof objectEmptyRemove
|
|
210
|
+
|
|
211
|
+
padStart: typeof padStart
|
|
212
|
+
replace: typeof replace
|
|
213
|
+
trim: typeof trim
|
|
214
|
+
|
|
215
|
+
alert: typeof alert
|
|
216
|
+
confirm: typeof confirm
|
|
217
|
+
Toast: typeof Toast
|
|
218
|
+
toastSuccess: typeof toastSuccess
|
|
219
|
+
toastError: typeof toastError
|
|
220
|
+
close: typeof close
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default _utils
|