mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
`String.fromCharCode`'s type signature requires a regular `number[]`. PR Close #34817 PR Close #34960
This commit is contained in:
parent
49d68730f6
commit
03f0f43fe0
1 changed files with 6 additions and 2 deletions
|
|
@ -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}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue