* Wraps an array around itself at a given start index * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`
(array: T[], startIndex: number)
| 938 | * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` |
| 939 | */ |
| 940 | function wrapArray<T>(array: T[], startIndex: number) { |
| 941 | return array.map((_, index) => array[(startIndex + index) % array.length]) |
| 942 | } |
| 943 | |
| 944 | /** |
| 945 | * This is the "meat" of the typeahead matching logic. It takes in all the values, |
no outgoing calls
no test coverage detected
searching dependent graphs…