(haystack: T[], needle: T[])
| 22 | } |
| 23 | |
| 24 | export function arrayContainsArray<T>(haystack: T[], needle: T[]): boolean { |
| 25 | // Loop over valid starting points for the subarray |
| 26 | for (let i = 0; i <= haystack.length - needle.length; i++) { |
| 27 | // Check if the relevant length sublist equals the other array. |
| 28 | if (arraysEqual(haystack.slice(i, i + needle.length), needle)) |
| 29 | return true; |
| 30 | } |
| 31 | return false; |
| 32 | } |
no test coverage detected