[SOLVED] How to do double transformation for HTTP sensors?

Yeah I could do this, but then my configuration is split across several files, which reduces readability. As (luckily) JSON path doesn’t change across these sensors, I guess I might go this way.

(function(dataString) {
    var data = JSON.parse(dataString);
    var switchState = data.result.status;
    if(switchState)  return "ON";
    if(!switchState) return "OFF";
})(input)