Skip to content

Commit 16862b1

Browse files
TypeScript Botnoshiro-pf
andauthored
🤖 Pick PR #59163 (fix: fix the return type of Int8Arr...) into release-5.5 (#59197)
Co-authored-by: Hideaki Noshiro <[email protected]>
1 parent e28a76c commit 16862b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/lib/es2023.array.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ interface Int8Array {
185185
/**
186186
* Copies the array and returns the copy with the elements in reverse order.
187187
*/
188-
toReversed(): Uint8Array;
188+
toReversed(): Int8Array;
189189

190190
/**
191191
* Copies and sorts the array.
192192
* @param compareFn Function used to determine the order of the elements. It is expected to return
193193
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
194194
* value otherwise. If omitted, the elements are sorted in ascending order.
195195
* ```ts
196-
* const myNums = Uint8Array.from([11, 2, 22, 1]);
197-
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
196+
* const myNums = Int8Array.from([11, 2, 22, 1]);
197+
* myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22]
198198
* ```
199199
*/
200-
toSorted(compareFn?: (a: number, b: number) => number): Uint8Array;
200+
toSorted(compareFn?: (a: number, b: number) => number): Int8Array;
201201

202202
/**
203203
* Copies the array and inserts the given number at the provided index.
@@ -206,7 +206,7 @@ interface Int8Array {
206206
* @param value The value to insert into the copied array.
207207
* @returns A copy of the original array with the inserted value.
208208
*/
209-
with(index: number, value: number): Uint8Array;
209+
with(index: number, value: number): Int8Array;
210210
}
211211

212212
interface Uint8Array {

0 commit comments

Comments
 (0)