Skip to content

Commit 37bb54b

Browse files
committed
feat: add deepClone
1 parent 110d437 commit 37bb54b

File tree

4 files changed

+297
-300
lines changed

4 files changed

+297
-300
lines changed

README.md

Lines changed: 154 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ or
6262
- [arrByObj](#arrByObj) 数值转对象 (常用于处理后台返回的枚举转换,工作中很常用)
6363
- [uniqueArray](#uniqueArray) undefined
6464
65+
### 浏览器相关
66+
67+
- [getBrowserInfo](#getBrowserInfo) 获取浏览器相关信息
68+
6569
### 血袋相关工具函数
6670
6771
- [formatRhBloodGroup](#formatRhBloodGroup) 转换Rh血型
6872
- [isRhNegative](#isRhNegative) 是否阴性
6973
- [isRhPositive](#isRhPositive) 是否阳性
7074
- [sorterCallBack](#sorterCallBack) sort []
7175
72-
### 浏览器相关
73-
74-
- [getBrowserInfo](#getBrowserInfo) 获取浏览器相关信息
75-
7676
### 数据持久化,缓存
7777
7878
- [removeStorage](#removeStorage) 删除
@@ -93,14 +93,14 @@ or
9393
- [timeFormat](#timeFormat) 时间个性化输出功能
9494
- [getCountDays](#getCountDays) 获取当前月份天数
9595
96-
### 防抖
97-
98-
- [debounce](#debounce) debounce 防抖, 固定时间内持续触发,只执行最后一次
99-
10096
###
10197
10298
- [decoratorNonenumerable](#decoratorNonenumerable) decoratorNonenumerable
10399
100+
### 防抖
101+
102+
- [debounce](#debounce) debounce 防抖, 固定时间内持续触发,只执行最后一次
103+
104104
### 用户设备相关(客户端系统)
105105
106106
- [osInfo](#osInfo) 获取用户系统平台信息
@@ -141,13 +141,6 @@ or
141141
- [cleanObject](#cleanObject) cleanObject 去除对象中value为空(null,undefined,'')的属性
142142
- [deepClone](#deepClone) 深克隆 deepClone
143143
144-
### Queue 队列
145-
146-
147-
### 休眠
148-
149-
- [sleep](#sleep) 休眠多少毫秒
150-
151144
### 字符串处理相关
152145
153146
- [trim](#trim) 去除字符串空格, 默认去除前后空格 (常用)
@@ -160,6 +153,13 @@ or
160153
- [uuid](#uuid) 生成随机字符串,第一个参数指定位数,第二个字符串指定字符,都是可选参数,如果都不传,默认生成8位
161154
- [endWith](#endWith) 字符串判断结尾
162155
156+
### Queue 队列
157+
158+
159+
### 休眠
160+
161+
- [sleep](#sleep) 休眠多少毫秒
162+
163163
### 节流
164164
165165
- [throttle](#throttle) 节流 多次调用方法,按照一定的时间间隔执行
@@ -192,6 +192,117 @@ or
192192
193193
## API 说明
194194
195+
### formatRhBloodGroup
196+
197+
转换Rh血型
198+
199+
```javascript
200+
wuxh
201+
* @Date: 2021-09-07 13:44:36
202+
* @param {*}
203+
* @return {*}
204+
* @example: formatRhBloodGroup('**D**') => 阳性
205+
* formatRhBloodGroup('+') => 阳性
206+
*
207+
```
208+
209+
### isRhNegative
210+
211+
是否阴性
212+
213+
```javascript
214+
wuxh
215+
* @Date: 2022-01-17 23:57:31
216+
* @param {string} input
217+
* @return {*}
218+
* @example:
219+
```
220+
221+
### isRhPositive
222+
223+
是否阳性
224+
225+
```javascript
226+
wuxh
227+
* @Date: 2022-01-17 23:57:19
228+
* @param {string} input
229+
* @return {*}
230+
* @example:
231+
```
232+
233+
### sorterCallBack
234+
235+
sort []
236+
237+
```javascript
238+
wuxh
239+
* @Date: 2021-09-07 14:12:06
240+
* @param {string} key
241+
* @return {*}
242+
* @example:
243+
* const arr = [{name: '666'}, {name: '333'}]
244+
* arr.sorterCallBackString('name') => [{name: '333'}, {name: '666'}]
245+
* arr.sorterCallBackString('name', false) => [{name: '666'}, {name: '333'}]
246+
```
247+
248+
### removeStorage
249+
250+
删除
251+
252+
```javascript
253+
wuxh
254+
* @Date: 2020-05-06 11:56:29
255+
* @param {key}
256+
* @return: undefined
257+
* @example:
258+
removeStorage('test')
259+
=> undefined
260+
```
261+
262+
### saveStorage
263+
264+
保存
265+
266+
```javascript
267+
wuxh
268+
* @Date: 2020-05-06 11:56:29
269+
* @param {key}
270+
* @param {value}
271+
* @param {isJson}
272+
* @return: undefined
273+
* @example:
274+
saveStorage('test', '001')
275+
=> undefined
276+
```
277+
278+
### getStorage
279+
280+
获取
281+
282+
```javascript
283+
wuxh
284+
* @Date: 2020-05-06 12:00:37
285+
* @param {key}
286+
* @return: String
287+
* @example:
288+
getStorage('test')
289+
=> '001'
290+
```
291+
292+
### isSupportStorage
293+
294+
是否支持local
295+
296+
```javascript
297+
wuxh
298+
* @Date: 2020-05-06 12:01:43
299+
* @param
300+
* @return: Boolean
301+
* @example:
302+
isSupportStorage()
303+
=> true
304+
```
305+
195306
### doubleRanking
196307
197308
处理复杂数组的两级排序(一级按照自定义顺序,二级可正序倒序)
@@ -270,59 +381,6 @@ or
270381
uniqueArray([1,1,1,1,1]) => [1]
271382
```
272383
273-
### formatRhBloodGroup
274-
275-
转换Rh血型
276-
277-
```javascript
278-
wuxh
279-
* @Date: 2021-09-07 13:44:36
280-
* @param {*}
281-
* @return {*}
282-
* @example: formatRhBloodGroup('**D**') => 阳性
283-
* formatRhBloodGroup('+') => 阳性
284-
*
285-
```
286-
287-
### isRhNegative
288-
289-
是否阴性
290-
291-
```javascript
292-
wuxh
293-
* @Date: 2022-01-17 23:57:31
294-
* @param {string} input
295-
* @return {*}
296-
* @example:
297-
```
298-
299-
### isRhPositive
300-
301-
是否阳性
302-
303-
```javascript
304-
wuxh
305-
* @Date: 2022-01-17 23:57:19
306-
* @param {string} input
307-
* @return {*}
308-
* @example:
309-
```
310-
311-
### sorterCallBack
312-
313-
sort []
314-
315-
```javascript
316-
wuxh
317-
* @Date: 2021-09-07 14:12:06
318-
* @param {string} key
319-
* @return {*}
320-
* @example:
321-
* const arr = [{name: '666'}, {name: '333'}]
322-
* arr.sorterCallBackString('name') => [{name: '333'}, {name: '666'}]
323-
* arr.sorterCallBackString('name', false) => [{name: '666'}, {name: '333'}]
324-
```
325-
326384
### getBrowserInfo
327385
328386
获取浏览器相关信息
@@ -350,26 +408,18 @@ or
350408
getCookie('name') => 123
351409
```
352410
353-
### debounce
411+
### osInfo
354412
355-
debounce 防抖, 固定时间内持续触发,只执行最后一次
413+
获取用户系统平台信息
356414
357415
```javascript
358416
wuxh
359-
* @Date: 2021-09-02 21:30:44
360-
* @param {*} Function 要进行debouce的函数
361-
* @param {*} wait 等待时间,默认500ms
362-
* @param {*} immediate 是否立即执行
363-
* @return {*} Function
417+
* @Date: 2020-05-06 12:07:03
418+
* @param {e}
419+
* @return: {os: "mac", version: "10.15.3"}
364420
* @example:
365-
* function onInput() {
366-
console.log('1111')
367-
}
368-
const debounceOnInput = debounce(onInput)
369-
document
370-
.getElementById('input')
371-
.addEventListener('input', debounceOnInput)
372-
*
421+
osInfo()
422+
=> {os: "mac", version: "10.15.3"}
373423
```
374424
375425
### dateInterval
@@ -462,74 +512,38 @@ or
462512
* @example:
463513
```
464514
465-
### decoratorNonenumerable
466-
467-
decoratorNonenumerable
468-
469-
```javascript
470-
wuxh
471-
* @Date: 2021-11-10 11:43:45
472-
* @param {*}
473-
* @return {*}
474-
* @example:
475-
```
476-
477-
### removeStorage
478-
479-
删除
480-
481-
```javascript
482-
wuxh
483-
* @Date: 2020-05-06 11:56:29
484-
* @param {key}
485-
* @return: undefined
486-
* @example:
487-
removeStorage('test')
488-
=> undefined
489-
```
490-
491-
### saveStorage
492-
493-
保存
494-
495-
```javascript
496-
wuxh
497-
* @Date: 2020-05-06 11:56:29
498-
* @param {key}
499-
* @param {value}
500-
* @param {isJson}
501-
* @return: undefined
502-
* @example:
503-
saveStorage('test', '001')
504-
=> undefined
505-
```
506-
507-
### getStorage
515+
### debounce
508516
509-
获取
517+
debounce 防抖, 固定时间内持续触发,只执行最后一次
510518
511519
```javascript
512520
wuxh
513-
* @Date: 2020-05-06 12:00:37
514-
* @param {key}
515-
* @return: String
521+
* @Date: 2021-09-02 21:30:44
522+
* @param {*} Function 要进行debouce的函数
523+
* @param {*} wait 等待时间,默认500ms
524+
* @param {*} immediate 是否立即执行
525+
* @return {*} Function
516526
* @example:
517-
getStorage('test')
518-
=> '001'
527+
* function onInput() {
528+
console.log('1111')
529+
}
530+
const debounceOnInput = debounce(onInput)
531+
document
532+
.getElementById('input')
533+
.addEventListener('input', debounceOnInput)
534+
*
519535
```
520536
521-
### isSupportStorage
537+
### decoratorNonenumerable
522538
523-
是否支持local
539+
decoratorNonenumerable
524540
525541
```javascript
526542
wuxh
527-
* @Date: 2020-05-06 12:01:43
528-
* @param
529-
* @return: Boolean
530-
* @example:
531-
isSupportStorage()
532-
=> true
543+
* @Date: 2021-11-10 11:43:45
544+
* @param {*}
545+
* @return {*}
546+
* @example:
533547
```
534548
535549
### download
@@ -577,20 +591,6 @@ or
577591
copyToBoard('lalallala') => true // 如果复制成功返回true
578592
```
579593
580-
### osInfo
581-
582-
获取用户系统平台信息
583-
584-
```javascript
585-
wuxh
586-
* @Date: 2020-05-06 12:07:03
587-
* @param {e}
588-
* @return: {os: "mac", version: "10.15.3"}
589-
* @example:
590-
osInfo()
591-
=> {os: "mac", version: "10.15.3"}
592-
```
593-
594594
### getFormData
595595
596596
对象转化为FormData对象

0 commit comments

Comments
 (0)