|
@@ -1,14 +1,10 @@
|
|
|
const formatter = class Formatter {
|
|
|
|
|
|
- constructor(name, result) {
|
|
|
- this.name = name;
|
|
|
- this.result = result.sort(this._alphabeticalSort);
|
|
|
- }
|
|
|
-
|
|
|
- toString() {
|
|
|
- let str = `"${this.name}" has ${this.result.length} coauthors:`;
|
|
|
- for (const index in this.result) {
|
|
|
- str += `\n- ${this.result[index]}`;
|
|
|
+ format(result) {
|
|
|
+ result.coAuthors.sort(this._alphabeticalSort);
|
|
|
+ let str = `"${result.name}" has ${result.coAuthors.length} coauthors:`;
|
|
|
+ for (const index in result.coAuthors) {
|
|
|
+ str += `\n- ${result.coAuthors[index]}`;
|
|
|
}
|
|
|
return str;
|
|
|
}
|