We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb8e0f9 commit c36f194Copy full SHA for c36f194
lib/formats/json/formatter.js
@@ -1,18 +1,15 @@
1
-
2
-function JSONFormatter() {
3
+class JSONFormatter {
+ /*
+ * Every internal data structure is JSON by nature, so
4
+ * no transformation is required
5
+ */
6
+ format(payload) {
7
+ return payload;
8
+ }
9
+
10
+ toString(payload) {
11
+ return JSON.stringify(payload);
12
13
}
14
-/*
- * 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) {
15
- return JSON.stringify(payload);
16
17
18
module.exports = JSONFormatter;
0 commit comments