(obj: any)
| 1 | import { toUnicode } from 'punycode'; |
| 2 | |
| 3 | export function deepCopy<T>(obj: any): T { |
| 4 | let newObj: any; |
| 5 | try { |
| 6 | newObj = obj.push ? [] : {}; |
| 7 | } catch (error) { |
| 8 | newObj = {}; |
| 9 | } |
| 10 | for (let attr in obj) { |
| 11 | if (typeof obj[attr] === 'object') { |
| 12 | newObj[attr] = deepCopy(obj[attr]); |
| 13 | } else { |
| 14 | newObj[attr] = obj[attr]; |
| 15 | } |
| 16 | } |
| 17 | return newObj; |
| 18 | } |
| 19 | |
| 20 | export function debounce(func: Function, wait: number) { |
| 21 | let timeout: NodeJS.Timeout | null = null; |
no outgoing calls
no test coverage detected