@@ -144,20 +144,16 @@ export const makeComparatorKit = (compareRemotables = (_x, _y) => 0) => {
144144 case 'string' : {
145145 // Within each of these passStyles, the rank ordering agrees with
146146 // JavaScript's relational operators `<` and `>`.
147- // @ts -expect-error FIXME narrowed
148147 if ( left < right ) {
149148 return - 1 ;
150149 } else {
151- // @ts -expect-error FIXME narrowed
152150 assert ( left > right ) ;
153151 return 1 ;
154152 }
155153 }
156154 case 'symbol' : {
157155 return comparator (
158- // @ts -expect-error FIXME narrowed
159156 nameForPassableSymbol ( left ) ,
160- // @ts -expect-error FIXME narrowed
161157 nameForPassableSymbol ( right ) ,
162158 ) ;
163159 }
@@ -171,11 +167,9 @@ export const makeComparatorKit = (compareRemotables = (_x, _y) => 0) => {
171167 }
172168 // The rank ordering of non-NaN numbers agrees with JavaScript's
173169 // relational operators '<' and '>'.
174- // @ts -expect-error FIXME narrowed
175170 if ( left < right ) {
176171 return - 1 ;
177172 } else {
178- // @ts -expect-error FIXME narrowed
179173 assert ( left > right ) ;
180174 return 1 ;
181175 }
@@ -192,46 +186,37 @@ export const makeComparatorKit = (compareRemotables = (_x, _y) => 0) => {
192186 // of these names, which we then compare lexicographically. This ensures
193187 // that if the names of record X are a subset of the names of record Y,
194188 // then record X will have an earlier rank and sort to the left of Y.
195- // @ts -expect-error FIXME narrowed
196189 const leftNames = recordNames ( left ) ;
197- // @ts -expect-error FIXME narrowed
198190 const rightNames = recordNames ( right ) ;
199191
200192 const result = comparator ( leftNames , rightNames ) ;
201193 if ( result !== 0 ) {
202194 return result ;
203195 }
204196 return comparator (
205- // @ts -expect-error FIXME narrowed
206197 recordValues ( left , leftNames ) ,
207- // @ts -expect-error FIXME narrowed
208198 recordValues ( right , rightNames ) ,
209199 ) ;
210200 }
211201 case 'copyArray' : {
212202 // Lexicographic
213- // @ts -expect-error FIXME narrowed
214203 const len = Math . min ( left . length , right . length ) ;
215204 for ( let i = 0 ; i < len ; i += 1 ) {
216- // @ts -expect-error FIXME narrowed
217205 const result = comparator ( left [ i ] , right [ i ] ) ;
218206 if ( result !== 0 ) {
219207 return result ;
220208 }
221209 }
222210 // If all matching elements were tied, then according to their lengths.
223211 // If array X is a prefix of array Y, then X has an earlier rank than Y.
224- // @ts -expect-error FIXME narrowed
225212 return comparator ( left . length , right . length ) ;
226213 }
227214 case 'tagged' : {
228215 // Lexicographic by `[Symbol.toStringTag]` then `.payload`.
229- // @ts -expect-error FIXME narrowed
230216 const labelComp = comparator ( getTag ( left ) , getTag ( right ) ) ;
231217 if ( labelComp !== 0 ) {
232218 return labelComp ;
233219 }
234- // @ts -expect-error FIXME narrowed
235220 return comparator ( left . payload , right . payload ) ;
236221 }
237222 default : {
@@ -301,10 +286,9 @@ harden(assertRankSorted);
301286 * function. This is a genuine bug for us NOW because sometimes we sort
302287 * in reverse order by passing a reversed rank comparison function.
303288 *
304- * @template {Passable} T
305- * @param {Iterable<T> } passables
289+ * @param {Iterable<Passable> } passables
306290 * @param {RankCompare } compare
307- * @returns {T [] }
291+ * @returns {Passable [] }
308292 */
309293export const sortByRank = ( passables , compare ) => {
310294 if ( Array . isArray ( passables ) ) {
@@ -398,20 +382,18 @@ export const coveredEntries = (sorted, [leftIndex, rightIndex]) => {
398382harden ( coveredEntries ) ;
399383
400384/**
401- * @template {Passable} T
402385 * @param {RankCompare } compare
403- * @param {T } a
404- * @param {T } b
405- * @returns {T }
386+ * @param {Passable } a
387+ * @param {Passable } b
388+ * @returns {Passable }
406389 */
407390const maxRank = ( compare , a , b ) => ( compare ( a , b ) >= 0 ? a : b ) ;
408391
409392/**
410- * @template {Passable} T
411393 * @param {RankCompare } compare
412- * @param {T } a
413- * @param {T } b
414- * @returns {T }
394+ * @param {Passable } a
395+ * @param {Passable } b
396+ * @returns {Passable }
415397 */
416398const minRank = ( compare , a , b ) => ( compare ( a , b ) <= 0 ? a : b ) ;
417399
0 commit comments