processRecords function processRecords function takes in an array of records and returns an array of batches. lib/records.ts contains the code. lib/records.test.ts contains the unit tests.