MCPcopy Index your code
hub / github.com/angular/angular / patchDecodeBase64

Function patchDecodeBase64

packages/service-worker/testing/mock.ts:11–25  ·  view source on GitHub ↗
(proto: {decodeBase64: typeof atob})

Source from the content-addressed store, hash-verified

9import {Subject} from 'rxjs';
10
11export 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
27export class MockServiceWorkerContainer {
28 private onControllerChange: Function[] = [];

Callers 1

comm_spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…