Ended up with `transform` and some JSDoc.