```ts
export function driftCheck(readings: number[], step: number): number {
    if (!readings || !step) {
        throw new Error('Input readings and step cannot be empty');
    }

    for (let i = 1; i < readings.length; ++i) {
        const diff = Math.abs(readings[i] - readings[i - 1]);
        if (diff > step) {
            return i;
        }
    }

    return -1;
}
```