diff --git a/lib/formats/json/formatter.js b/lib/formats/json/formatter.js index a39e1dc..d4bc3d4 100644 --- a/lib/formats/json/formatter.js +++ b/lib/formats/json/formatter.js @@ -1,18 +1,15 @@ +class JSONFormatter { + /* + * Every internal data structure is JSON by nature, so + * no transformation is required + */ + format(payload) { + return payload; + } -function JSONFormatter() { - + toString(payload) { + return JSON.stringify(payload); + } } -/* - * Every internal data structure is JSON by nature, so - * no transformation is required - */ -JSONFormatter.prototype.format = function(payload) { - return payload; -}; - -JSONFormatter.prototype.toString = function(payload) { - return JSON.stringify(payload); -}; - module.exports = JSONFormatter;