Just a "bike shed" thing but I've noticed a few `if (Array.isArray(arr)) ...` statements. You could remove the if/else by doing this instead:

`array.getArray(dataSource).map(...)` etc. so you always have an array to work with.