(fun)
| 90 | } |
| 91 | |
| 92 | function once(fun) { |
| 93 | var called = false; |
| 94 | return function (...args) { |
| 95 | /* istanbul ignore if */ |
| 96 | if (called) { |
| 97 | // this is a smoke test and should never actually happen |
| 98 | throw new Error('once called more than once'); |
| 99 | } else { |
| 100 | called = true; |
| 101 | fun.apply(this, args); |
| 102 | } |
| 103 | }; |
| 104 | } |
| 105 | |
| 106 | function toPromise(func) { |
| 107 | //create the function we will be returning |
no outgoing calls
no test coverage detected
searching dependent graphs…