The unit tests would be a good place to put this, actually. Something like
var sourceQueryFromRest = { ... }
var targetQueryForOrm = { ... }
assert.equal(myTransform(sourceQueryFromRest), targetQueryForOrm);

or the like.