We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20ab129 commit d2b37c1Copy full SHA for d2b37c1
packages/firestore/src/api/blob.ts
@@ -85,14 +85,10 @@ export class Blob {
85
if (!(array instanceof Uint8Array)) {
86
throw invalidClassError('Blob.fromUint8Array', 'Uint8Array', 1, array);
87
}
88
- // We can't call array.map directly because it expects the return type to
89
- // be a Uint8Array, whereas we can convert it to a regular array by invoking
90
- // map on the Array prototype.
91
- const binaryString = Array.prototype.map
92
- .call(array, (char: number) => {
93
- return String.fromCharCode(char);
94
- })
95
- .join('');
+ let binaryString = '';
+ for (let i = 0; i < array.length; ++i) {
+ binaryString += String.fromCharCode(array[i]);
+ }
96
return new Blob(binaryString);
97
98
0 commit comments