@kokimin/utils 0.0.6 → 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 -218
- 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 _0x5df5d7=_0x36f3;(function(_0x2cbef1,_0x3c1f15){const _0x42b58a=_0x36f3,_0x4a3d25=_0x2cbef1();while(!![]){try{const _0x386ff1=parseInt(_0x42b58a(0x1c8))/0x1*(-parseInt(_0x42b58a(0x17e))/0x2)+-parseInt(_0x42b58a(0x1c5))/0x3*(parseInt(_0x42b58a(0x181))/0x4)+-parseInt(_0x42b58a(0x18e))/0x5+-parseInt(_0x42b58a(0x1b2))/0x6*(parseInt(_0x42b58a(0x198))/0x7)+parseInt(_0x42b58a(0x18b))/0x8+-parseInt(_0x42b58a(0x185))/0x9+-parseInt(_0x42b58a(0x1bf))/0xa*(-parseInt(_0x42b58a(0x171))/0xb);if(_0x386ff1===_0x3c1f15)break;else _0x4a3d25['push'](_0x4a3d25['shift']());}catch(_0x2783db){_0x4a3d25['push'](_0x4a3d25['shift']());}}}(_0x5534,0x98109));var w=Object[_0x5df5d7(0x1ad)],C=(_0x3a9c77,_0x4ce200)=>{const _0x144320=_0x5df5d7,_0x26e799={'MauWQ':function(_0x115748,_0x5213c5,_0x3f436e,_0x4e3442){return _0x115748(_0x5213c5,_0x3f436e,_0x4e3442);}};for(var _0x31981f in _0x4ce200)_0x26e799[_0x144320(0x1a0)](w,_0x3a9c77,_0x31981f,{'get':_0x4ce200[_0x31981f],'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 _0x31e60d from'lodash';var O=(_0x349efa=[],..._0x4b154b)=>_0x31e60d[_0x5df5d7(0x1a2)](_0x349efa,..._0x4b154b),E=(_0x39d829=[])=>_0x31e60d[_0x5df5d7(0x1a4)](_0x39d829),j=(..._0x447414)=>_0x31e60d[_0x5df5d7(0x191)](..._0x447414),N=(_0x2390d9=[])=>_0x31e60d[_0x5df5d7(0x1a6)](_0x2390d9),$=(_0x5e325a=[])=>_0x31e60d['flattenDeep'](_0x5e325a),q=(_0xf94a59=[],_0x5add94=_0x5df5d7(0x1a9),_0x444c95=_0x5df5d7(0x178))=>{const _0x5dfca0=_0x5df5d7,_0x4c8704={'eXosb':function(_0x28bfb1,_0x36ee79){return _0x28bfb1>_0x36ee79;},'fuKKw':function(_0x2406ed,_0x478af9){return _0x2406ed===_0x478af9;},'UxNia':'riGLT','pabUe':function(_0x5308d1,_0x210a9f,_0x231eb2,_0x3b3884,_0x2bc38b){return _0x5308d1(_0x210a9f,_0x231eb2,_0x3b3884,_0x2bc38b);},'BhEqS':function(_0x61b632,_0x530b5e){return _0x61b632===_0x530b5e;},'PiWjl':'UaHRT','oHkwB':function(_0xd7eb63,_0x9e4024,_0x42f5d9){return _0xd7eb63(_0x9e4024,_0x42f5d9);},'viiWo':function(_0xd32f20,_0x3c2d4e,_0xc34517){return _0xd32f20(_0x3c2d4e,_0xc34517);}};let _0x54928e=(_0xd90c61,_0x4586a4,_0x48b93f,_0x24aba3)=>{const _0x400b51=_0x36f3,_0x4cd689={'bzycQ':function(_0x12e03c,_0x463d18){const _0x281467=_0x36f3;return _0x4c8704[_0x281467(0x172)](_0x12e03c,_0x463d18);},'HJNKI':function(_0x9118ec,_0x3ecbff){return _0x9118ec===_0x3ecbff;},'yaKBA':_0x4c8704[_0x400b51(0x1c6)],'iMbCf':function(_0x3c57e8,_0x141f62,_0x381b68,_0x433224,_0x28c3db){return _0x4c8704['pabUe'](_0x3c57e8,_0x141f62,_0x381b68,_0x433224,_0x28c3db);},'BTZRw':function(_0x15bddd,_0x39675a){return _0x15bddd>_0x39675a;}};if(_0x4c8704[_0x400b51(0x19d)](_0x4c8704['PiWjl'],_0x4c8704[_0x400b51(0x1b6)])){let _0x34eadb=[];return _0xd90c61['forEach'](_0x325c16=>{const _0x183adc=_0x400b51,_0x1bc450={'XhXIQ':function(_0x22db84,_0x61f5ff){const _0x2bdc7f=_0x36f3;return _0x4cd689[_0x2bdc7f(0x1b0)](_0x22db84,_0x61f5ff);},'XltZN':function(_0x7c28af,_0x1b34e8){return _0x7c28af!==_0x1b34e8;}};if(_0x4cd689['bzycQ'](_0x325c16[_0x4586a4],_0x24aba3))_0x34eadb['push'](_0x325c16[_0x4586a4]);else{if(_0x325c16[_0x48b93f]){if(_0x4cd689['HJNKI'](_0x183adc(0x19e),_0x4cd689[_0x183adc(0x16f)])){if(!_0x5d4ec7[_0x183adc(0x1a3)](_0x449dfd)||_0x1bc450[_0x183adc(0x196)](_0x522bbf['length'],0x0))return;let _0x3c34b3=_0x4fd9d0[_0x183adc(0x1b1)](_0x143338=>typeof _0x143338==_0x183adc(0x19a)&&!_0x3de9c6(_0x143338));if(_0x1bc450['XltZN'](_0x3c34b3[_0x183adc(0x1cb)],0x0))return _0x58eb27[_0x183adc(0x1b9)](..._0x3c34b3);}else{let _0xb705cf=_0x4cd689[_0x183adc(0x1c2)](_0x54928e,_0x325c16[_0x48b93f],_0x4586a4,_0x48b93f,_0x24aba3);_0x4cd689[_0x183adc(0x1ab)](_0xb705cf[_0x183adc(0x1cb)],0x0)&&(_0x34eadb[_0x183adc(0x1c1)](_0x325c16[_0x4586a4]),_0xb705cf[_0x183adc(0x1b5)](_0x39097b=>_0x34eadb[_0x183adc(0x1c1)](_0x39097b)));}}}}),_0x34eadb;}else{let _0xf9c3e4=0x0;for(let _0x449b0b of _0x82747d){let _0x2670c2=_0x449b0b['charCodeAt'](0x0);_0xf9c3e4+=_0x4c8704[_0x400b51(0x175)](_0x2670c2,0x7f)?0x2:0x1;}return _0xf9c3e4;}},_0x383235=(_0x1ab2f4,_0x5e97ef)=>_0x1ab2f4['reduce']((_0x38b068,_0x300e73)=>{const _0xaa33c6=_0x36f3;let _0x53097f=_0x38b068['concat'](_0x300e73),_0x2840ae=_0x300e73[_0x5e97ef];return _0x53097f['concat'](_0x2840ae?.[_0xaa33c6(0x1cb)]?_0x383235(_0x2840ae,_0x5e97ef):[]);},[]),_0x24beb1=(_0x52d96c,_0x3df83c)=>_0x52d96c['reduce']((_0xcf9a06,_0x282ef2)=>{const _0x4b3078=_0x36f3;let _0x389892=_0xcf9a06[_0x4b3078(0x1a2)](_0x282ef2),_0x5bc88e=_0x282ef2[_0x3df83c];return Array[_0x4b3078(0x1a3)](_0x282ef2[_0x3df83c])||(_0x282ef2[_0x3df83c]=[]),_0x282ef2[_0x4b3078(0x1cd)]=_0x4c8704[_0x4b3078(0x1ae)](_0x54928e,_0xf94a59,_0x5add94,_0x3df83c,_0x282ef2[_0x5add94]),_0x389892[_0x4b3078(0x1a2)](_0x5bc88e?.[_0x4b3078(0x1cb)]?_0x4c8704[_0x4b3078(0x16e)](_0x24beb1,_0x5bc88e,_0x3df83c):[]);},[]);return _0x4c8704[_0x5dfca0(0x1a7)](_0x24beb1,_0xf94a59,_0x444c95)['map'](_0x4437ec=>({..._0x4437ec,'childrenIds':_0x383235(_0x4437ec[_0x444c95],_0x444c95)[_0x5dfca0(0x186)](_0x3e9508=>_0x3e9508[_0x5add94])}));},z=(_0x518247=[])=>_0x31e60d[_0x5df5d7(0x1c3)](_0x518247),T=(..._0xd3da7d)=>_0x31e60d['intersection'](..._0xd3da7d);function _0x5534(){const _0x2c82e4=['LOgdN','omit','1080416IngyJI','has','replace','3435360pofgoM','day','MEhxk','union','phone','isObject','qdzsD','today-oneMonth','XhXIQ','swal2_body','7adzNNO','trim','number','cloneDeep','format','BhEqS','dIvUc','orderBy','MauWQ','assign','concat','isArray','uniq','fire','head','viiWo','add','menuId','$1-$2-$3','BTZRw','Ddrzw','defineProperty','pabUe','KjRAG','bzycQ','filter','7243386EzdFsO','LGhCx','hOcYO','forEach','PiWjl','QIMZT','FxzxD','max','swal2_btn_confirm','success','ko-KR','constructor','dUVWR','20936490kODEro','swal2_popup','push','iMbCf','last','goFHC','6573bBfDxS','UxNia','string','2ohhlJa','isEmpty','swal2_actions','length','YYYY-MM-DD','parentIds','month','size','ISNcd','startOf','UJmkT','oHkwB','yaKBA','fsluH','22skwNvL','fuKKw','charCodeAt','toLocaleString','eXosb','quarter','error','children','tXxXH','padStart','yXXVQ','subtract','sortBy','797332DvMVPG','isPlainObject','hxLSo','924ODqNpn','merge','top','keys','4515633EZEhKw','map','dFvql','qARlq'];_0x5534=function(){return _0x2c82e4;};return _0x5534();}import _0x2cf506 from'lodash';var F=(_0x167608,_0x2ae0c7)=>_0x2cf506[_0x5df5d7(0x17d)](_0x167608,_0x2ae0c7),I=(_0x15f5b2,_0x37304b,_0x357ea3)=>_0x2cf506[_0x5df5d7(0x19f)](_0x15f5b2,_0x37304b,_0x357ea3);import{uuid as _0x20f773}from'vue-uuid';import{random as _0x53193d}from'lodash/number.js';var Z=(_0x1db03b='v1')=>{const _0x42e533=_0x5df5d7,_0x15ed72={'fsluH':function(_0x58d180){return _0x58d180();}};let _0x5ba343=_0x20f773[_0x1db03b](),_0x5a7574=_0x15ed72[_0x42e533(0x170)](B);return _0x5ba343+'-'+_0x5a7574;},B=(_0x50c529=0x0,_0x5997ff=0x3e8)=>_0x53193d(_0x50c529,_0x5997ff),L=(_0x53210c,_0x1fbf42)=>{const _0x41e663=_0x5df5d7,_0x2bcccf={'ISNcd':function(_0x2614a2,_0x1d4f88){return _0x2614a2===_0x1d4f88;},'wGXKG':_0x41e663(0x179)};let _0x5e16ab='',_0x1f5c29=0x0;for(let _0x11a71f of _0x53210c){if(_0x2bcccf[_0x41e663(0x1d0)](_0x2bcccf['wGXKG'],'tXxXH')){let _0x580d1b=_0x11a71f[_0x41e663(0x173)](0x0)>0x7f?0x2:0x1;if(_0x1f5c29+_0x580d1b>_0x1fbf42)break;_0x1f5c29+=_0x580d1b,_0x5e16ab+=_0x11a71f;}else{const _0x31dfd1={'QIMZT':function(_0x21234b,_0x1c1b0b){return _0x2bcccf['ISNcd'](_0x21234b,_0x1c1b0b);}};if(!_0x1a8db2['isPlainObject'](_0x398386))return{};let _0x155d64={..._0x5c9574};return _0x2205cb[_0x41e663(0x184)](_0x155d64)['forEach'](_0x407b7d=>{const _0x5538c1=_0x41e663;let _0x35be24=_0x155d64[_0x407b7d];(_0x35be24===''||_0x31dfd1[_0x5538c1(0x1b7)](_0x35be24,null)||_0x35be24===void 0x0||_0x134356['isObject'](_0x35be24)&&_0x107ed2[_0x5538c1(0x1c9)](_0x35be24))&&delete _0x155d64[_0x407b7d];}),_0x155d64;}}return _0x5e16ab;},V=_0x51ae96=>{const _0x3b965b=_0x5df5d7,_0x2182d0={'yXXVQ':function(_0x59783e,_0x51d95a){return _0x59783e>_0x51d95a;}};let _0x4ff9fc=0x0;for(let _0xecd097 of _0x51ae96){let _0x20d9fd=_0xecd097['charCodeAt'](0x0);_0x4ff9fc+=_0x2182d0[_0x3b965b(0x17b)](_0x20d9fd,0x7f)?0x2:0x1;}return _0x4ff9fc;};import _0x962fb1 from'dayjs';import _0x33de7f from'dayjs/plugin/quarterOfYear';_0x962fb1['extend'](_0x33de7f);var _=(_0x2ba164,_0x2ce452=_0x5df5d7(0x1cc))=>_0x962fb1(_0x2ba164)[_0x5df5d7(0x19c)](_0x2ce452),U=_0x934f7c=>_0x962fb1(_0x934f7c)[_0x5df5d7(0x176)](),k=({type:_0x24914c=_0x5df5d7(0x18f),addDay:_0xb40315=0x0,format:_0x3720a6='YYYY-MM-DD'})=>{const _0x230007=_0x5df5d7,_0x55d9b5={'goFHC':function(_0x278f69){return _0x278f69();},'veGyd':function(_0x291dc9,_0x17f170,_0x3bbf18){return _0x291dc9(_0x17f170,_0x3bbf18);}};let _0x34175f=_0x55d9b5[_0x230007(0x1c4)](_0x962fb1);return _0x55d9b5['veGyd'](_,_0x34175f[_0x230007(0x1a8)](_0xb40315,_0x24914c),_0x3720a6);},G=(_0x507adc=_0x5df5d7(0x195))=>{const _0x27fa4d=_0x5df5d7,_0x1e968f={'qdzsD':function(_0x1f5f44){return _0x1f5f44();},'dUVWR':'YYYY-MM-DD','KjRAG':function(_0x4ce298){return _0x4ce298();},'UJmkT':_0x27fa4d(0x1ce),'MEhxk':function(_0x23a1bd){return _0x23a1bd();},'hxLSo':function(_0x860baa,_0x5d7ed9){return _0x860baa===_0x5d7ed9;},'qARlq':_0x27fa4d(0x195)};let _0x1a51ca=_0x1e968f[_0x27fa4d(0x194)](_0x962fb1)[_0x27fa4d(0x19c)](_0x1e968f[_0x27fa4d(0x1be)]),_0x33eb22=_0x1e968f[_0x27fa4d(0x1af)](_0x962fb1)[_0x27fa4d(0x17c)](0x1,_0x1e968f[_0x27fa4d(0x1d2)])[_0x27fa4d(0x19c)](_0x1e968f[_0x27fa4d(0x1be)]),_0x45ded2=_0x1e968f[_0x27fa4d(0x190)](_0x962fb1)[_0x27fa4d(0x1d1)](_0x1e968f['UJmkT'])[_0x27fa4d(0x19c)](_0x1e968f[_0x27fa4d(0x1be)]);return _0x1e968f[_0x27fa4d(0x180)](_0x507adc,_0x1e968f[_0x27fa4d(0x188)])?[_0x33eb22,_0x1a51ca]:[_0x45ded2,_0x1a51ca];},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=(_0x388471,_0x48e3f3=0x0)=>_0x388471==null||isNaN(Number(_0x388471))?'':Number(_0x388471)[_0x5df5d7(0x174)](_0x5df5d7(0x1bc)),J=(_0x3a04c0='')=>{const _0x5e2493=_0x5df5d7,_0x56ceb6={'FxzxD':function(_0x2c3845,_0x146b40){return _0x2c3845!=_0x146b40;},'LGhCx':_0x5e2493(0x1c7),'dFvql':function(_0x24f18c,_0x549176){return _0x24f18c(_0x549176);},'HYiqK':_0x5e2493(0x1aa)};if(!_0x3a04c0)return'';_0x56ceb6[_0x5e2493(0x1b8)](typeof _0x3a04c0,_0x56ceb6[_0x5e2493(0x1b3)])&&(_0x3a04c0=_0x56ceb6[_0x5e2493(0x187)](String,_0x3a04c0));let _0x2f2f41=_0x3a04c0[_0x5e2493(0x18d)](/\D/g,'');return _0x2f2f41['match'](g[_0x5e2493(0x192)])?_0x2f2f41[_0x5e2493(0x18d)](g[_0x5e2493(0x192)],_0x56ceb6['HYiqK']):_0x3a04c0;};import _0x2ebae4 from'lodash';var Q=_0x1c8871=>_0x2ebae4[_0x5df5d7(0x19b)](_0x1c8871),W=_0x332fe9=>_0x332fe9==null?!0x0:_0x332fe9?.[_0x5df5d7(0x1bd)]===Object?Object[_0x5df5d7(0x184)](_0x332fe9)[_0x5df5d7(0x1cb)]===0x0:Array[_0x5df5d7(0x1a3)](_0x332fe9)?_0x332fe9[_0x5df5d7(0x1cb)]===0x0:_0x332fe9 instanceof Map||_0x332fe9 instanceof Set?_0x332fe9[_0x5df5d7(0x1cf)]===0x0:typeof _0x332fe9==_0x5df5d7(0x1c7)?_0x332fe9['trim']()['length']===0x0:_0x2ebae4[_0x5df5d7(0x1c9)](_0x332fe9);import _0x502704 from'lodash';var v=(_0x1bf573=0x0,_0x5e210e=0x1,_0x25d285=!0x1)=>_0x502704['random'](_0x1bf573,_0x5e210e,_0x25d285),tt=_0x3a7be8=>{const _0x311fbb=_0x5df5d7,_0x2ad26a={'LOgdN':function(_0x4cd6c6,_0x36a0ca){return _0x4cd6c6===_0x36a0ca;}};if(!Array['isArray'](_0x3a7be8)||_0x2ad26a[_0x311fbb(0x189)](_0x3a7be8[_0x311fbb(0x1cb)],0x0))return;let _0xa9df06=_0x3a7be8['filter'](_0x48dc6e=>typeof _0x48dc6e==_0x311fbb(0x19a)&&!isNaN(_0x48dc6e));if(_0xa9df06[_0x311fbb(0x1cb)]!==0x0)return Math[_0x311fbb(0x1b9)](..._0xa9df06);};import _0x48b350 from'lodash';function _0x36f3(_0x3e985a,_0xbe85d3){_0x3e985a=_0x3e985a-0x16e;const _0x55342a=_0x5534();let _0x36f3f9=_0x55342a[_0x3e985a];return _0x36f3f9;}var rt=(_0x489daf={},..._0x4b342f)=>_0x48b350[_0x5df5d7(0x1a1)](_0x489daf,..._0x4b342f),ot=(_0x46723d={},..._0x17c0cb)=>_0x48b350[_0x5df5d7(0x182)](_0x46723d,..._0x17c0cb),et=(_0x40d15d,_0x54f347)=>_0x48b350[_0x5df5d7(0x18c)](_0x40d15d,_0x54f347),nt=(_0x2f873e,_0x424b36)=>_0x48b350[_0x5df5d7(0x18a)](_0x2f873e,_0x424b36),st=(_0x1b6ae8={})=>{const _0x4c9390=_0x5df5d7,_0x3ca17a={'Ddrzw':function(_0x34ad1d,_0x562683){return _0x34ad1d===_0x562683;},'hOcYO':function(_0x351e4e,_0x38cd00){return _0x351e4e===_0x38cd00;}};if(!_0x48b350[_0x4c9390(0x17f)](_0x1b6ae8))return{};let _0x52fb92={..._0x1b6ae8};return Object['keys'](_0x52fb92)[_0x4c9390(0x1b5)](_0x315bca=>{const _0x2d596e=_0x4c9390;let _0x1f48c2=_0x52fb92[_0x315bca];(_0x3ca17a[_0x2d596e(0x1ac)](_0x1f48c2,'')||_0x3ca17a[_0x2d596e(0x1b4)](_0x1f48c2,null)||_0x1f48c2===void 0x0||_0x48b350[_0x2d596e(0x193)](_0x1f48c2)&&_0x48b350['isEmpty'](_0x1f48c2))&&delete _0x52fb92[_0x315bca];}),_0x52fb92;};import _0x486b88 from'lodash';var ct=(_0x35c327,_0x49ea51,_0x28d195='\x20')=>_0x486b88[_0x5df5d7(0x17a)](String(_0x35c327),_0x49ea51,_0x28d195),at=(_0x5a79d7,_0x489f5e,_0x13a81e)=>_0x486b88['replace'](String(_0x5a79d7),_0x489f5e,_0x13a81e),it=(_0x4512e4,_0x3d5762)=>_0x3d5762?_0x486b88[_0x5df5d7(0x199)](String(_0x4512e4),_0x3d5762):_0x486b88[_0x5df5d7(0x199)](String(_0x4512e4));import _0x40ce47 from'sweetalert2';var pt={'popup':_0x5df5d7(0x1c0),'title':'swal2_title','htmlContainer':_0x5df5d7(0x197),'actions':_0x5df5d7(0x1ca),'confirmButton':_0x5df5d7(0x1ba),'cancelButton':'swal2_btn_cancel'},A=(_0x1de6c0,_0x3a4282)=>({'title':_0x1de6c0,'html':_0x3a4282,'allowOutsideClick':!0x1,'focusConfirm':!0x1,'customClass':pt}),ft=(_0x5eb3e7,_0x12929d)=>_0x40ce47['fire']({...A(_0x5eb3e7,_0x12929d),'showCancelButton':!0x1,'confirmButtonText':'확인'}),mt=(_0x4598bc,_0x5e3ea1)=>_0x40ce47['fire']({...A(_0x4598bc,_0x5e3ea1),'showCancelButton':!0x0,'confirmButtonText':'확인','cancelButtonText':'취소'}),y=_0x40ce47['mixin']({'toast':!0x0,'position':_0x5df5d7(0x183),'showConfirmButton':!0x1,'timer':0xbb8,'timerProgressBar':!0x1,'backdrop':!0x1}),ut=(_0x259f08,_0x5efb08)=>y[_0x5df5d7(0x1a5)]({'icon':_0x5df5d7(0x1bb),'title':_0x259f08,'html':_0x5efb08}),lt=(_0x230eb1,_0x4e7162)=>y[_0x5df5d7(0x1a5)]({'icon':_0x5df5d7(0x177),'title':_0x230eb1,'html':_0x4e7162}),xt=()=>_0x40ce47['close'](),dt=Object['freeze']({...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,218 +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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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
|