(s: string, times: number)
| 2 | import {memoize, strategies} from '@formatjs/fast-memoize' |
| 3 | |
| 4 | export function repeat(s: string, times: number): string { |
| 5 | if (typeof s.repeat === 'function') { |
| 6 | return s.repeat(times) |
| 7 | } |
| 8 | const arr = Array.from({length: times}) |
| 9 | for (let i = 0; i < arr.length; i++) { |
| 10 | arr[i] = s |
| 11 | } |
| 12 | return arr.join('') |
| 13 | } |
| 14 | |
| 15 | export function setInternalSlot< |
| 16 | Instance extends object, |
no outgoing calls
no test coverage detected