Merge pull request #14765 from malin-mallan/#14602_deprecations

Remove some deprecations
This commit is contained in:
Johan Haals
2022-11-23 10:56:05 +01:00
committed by GitHub
3 changed files with 6 additions and 6 deletions
@@ -25,7 +25,7 @@ describe('base64EncodeContent', () => {
it('encodes text files', () => {
expect(base64EncodeContent('abc')).toBe('YWJj');
expect(base64EncodeContent('abc'.repeat(1000000))).toBe(
btoa('<file too large>'),
window.btoa('<file too large>'),
);
});
@@ -38,7 +38,7 @@ describe('base64EncodeContent', () => {
);
// Triggers size check
expect(base64EncodeContent('😅'.repeat(1000000))).toBe(
btoa('<file too large>'),
window.btoa('<file too large>'),
);
});
});
@@ -59,11 +59,11 @@ interface DryRunProviderProps {
export function base64EncodeContent(content: string): string {
if (content.length > MAX_CONTENT_SIZE) {
return btoa('<file too large>');
return window.btoa('<file too large>');
}
try {
return btoa(content);
return window.btoa(content);
} catch {
const decoder = new TextEncoder();
const buffer = decoder.encode(content);
@@ -74,7 +74,7 @@ export function base64EncodeContent(content: string): string {
String.fromCharCode(...buffer.slice(offset, offset + CHUNK_SIZE)),
);
}
return btoa(chunks.join(''));
return window.btoa(chunks.join(''));
}
}
@@ -58,7 +58,7 @@ describe('DryRunResultsView', () => {
directoryContents: [
{
path: 'foo.txt',
base64Content: btoa('Foo Content'),
base64Content: window.btoa('Foo Content'),
executable: false,
},
],