`String.fromCharCode`'s type signature requires a regular `number[]`. PR Close #34817 PR Close #34960
This commit is contained in:

committed by
Andrew Kushnir

parent
49d68730f6
commit
03f0f43fe0
@ -57,9 +57,13 @@ export abstract class Body {
|
||||
if (this._body instanceof ArrayBuffer) {
|
||||
switch (encodingHint) {
|
||||
case 'legacy':
|
||||
return String.fromCharCode.apply(null, new Uint16Array(this._body));
|
||||
// TODO: Argument of type 'Uint16Array' is not assignable to parameter of type
|
||||
// 'number[]'.
|
||||
return String.fromCharCode.apply(null, new Uint16Array(this._body) as any);
|
||||
case 'iso-8859':
|
||||
return String.fromCharCode.apply(null, new Uint8Array(this._body));
|
||||
// TODO: Argument of type 'Uint8Array' is not assignable to parameter of type
|
||||
// 'number[]'.
|
||||
return String.fromCharCode.apply(null, new Uint8Array(this._body) as any);
|
||||
default:
|
||||
throw new Error(`Invalid value for encodingHint: ${encodingHint}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user