(logs)
| 111 | // --------------------------------------------------------------------------- |
| 112 | |
| 113 | function normalizeBrowserLogs(logs) { |
| 114 | return (logs || []).map(l => { |
| 115 | if (typeof l === 'string') return l |
| 116 | if (l && typeof l.type === 'function' && typeof l.text === 'function') { |
| 117 | return { type: l.type(), text: l.text() } |
| 118 | } |
| 119 | return l |
| 120 | }) |
| 121 | } |
| 122 | |
| 123 | async function captureStorageState(helper) { |
| 124 | if (typeof helper.grabStorageState === 'function') { |