(proto: {decodeBase64: typeof atob})
| 9 | import {Subject} from 'rxjs'; |
| 10 | |
| 11 | export const patchDecodeBase64 = (proto: {decodeBase64: typeof atob}) => { |
| 12 | let unpatch: () => void = () => undefined; |
| 13 | |
| 14 | if (typeof atob === 'undefined' && typeof Buffer === 'function') { |
| 15 | const oldDecodeBase64 = proto.decodeBase64; |
| 16 | const newDecodeBase64 = (input: string) => Buffer.from(input, 'base64').toString('binary'); |
| 17 | |
| 18 | proto.decodeBase64 = newDecodeBase64; |
| 19 | unpatch = () => { |
| 20 | proto.decodeBase64 = oldDecodeBase64; |
| 21 | }; |
| 22 | } |
| 23 | |
| 24 | return unpatch; |
| 25 | }; |
| 26 | |
| 27 | export class MockServiceWorkerContainer { |
| 28 | private onControllerChange: Function[] = []; |
no outgoing calls
no test coverage detected
searching dependent graphs…