|
@@ -0,0 +1,28 @@
|
|
|
+const result = class Result {
|
|
|
+
|
|
|
+ constructor() {
|
|
|
+ this.name = '';
|
|
|
+ this.coAuthors = [];
|
|
|
+ this.formatter = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ setFormatter(formatter) {
|
|
|
+ if (typeof formatter.format === 'function') {
|
|
|
+ this.formatter = formatter;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ removeFormatter() {
|
|
|
+ this.formatter = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ toString() {
|
|
|
+ if (this.formatter === null) {
|
|
|
+ } else {
|
|
|
+ return this.formatter.format(this);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+};
|
|
|
+
|
|
|
+module.exports = result;
|