refactor(http): fix a strictBindCallApply issue. (#34817)
`String.fromCharCode`'s type signature requires a regular `number[]`. PR Close #34817
This commit is contained in:
parent
a3b2d6735a
commit
11a4370e15
|
@ -57,9 +57,13 @@ export abstract class Body {
|
||||||
if (this._body instanceof ArrayBuffer) {
|
if (this._body instanceof ArrayBuffer) {
|
||||||
switch (encodingHint) {
|
switch (encodingHint) {
|
||||||
case 'legacy':
|
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':
|
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:
|
default:
|
||||||
throw new Error(`Invalid value for encodingHint: ${encodingHint}`);
|
throw new Error(`Invalid value for encodingHint: ${encodingHint}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue