File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export const compareStrings = (a: string, b: string) => {
7777 // Case 5: ZA, AA - multiple chars, only second letters match
7878 // Case 6: ZA, AZ - multiple chars, no match
7979
80+ // Both
8081 // Case 7: AA, Z - multiple chars, and single char
8182 // Case 8: Z, AA - single char, and multiple chars
8283
@@ -155,15 +156,14 @@ export const sortProducts = (products: ProductTuple[], method: SortMethod) => {
155156 continue ;
156157 }
157158
158- // swap based on shelf if both match
159159 // Case 2: swap based on shelf if both match
160160 if ( compare === Compare . EQUALS ) {
161161 if ( Number ( currentShelf ) > Number ( nextShelf ) ) {
162162 swap ( result , i , i + 1 ) ;
163163 }
164164 }
165165
166- // swap based on bay
166+ // Case 3: swap based on bay
167167 if ( compare === Compare . BIGGER_THAN ) {
168168 swap ( result , i , i + 1 ) ;
169169 }
You can’t perform that action at this time.
0 commit comments