Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions lib/formats/json/formatter.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@

function JSONFormatter() {

class JSONFormatter {
/*
* Every internal data structure is JSON by nature, so
* no transformation is required
*/
format(payload) {
return payload;
}

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;