Merge pull request #14765 from malin-mallan/#14602_deprecations
Remove some deprecations
This commit is contained in:
@@ -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(''));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ describe('DryRunResultsView', () => {
|
||||
directoryContents: [
|
||||
{
|
||||
path: 'foo.txt',
|
||||
base64Content: btoa('Foo Content'),
|
||||
base64Content: window.btoa('Foo Content'),
|
||||
executable: false,
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user