From 06a6cae4afd6dce5b0517b0cc9ce6e3c9ca92593 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 10 May 2021 19:50:26 +0530 Subject: [PATCH] Rename MessageBodyBuilder to MessageBodyBuilder Signed-off-by: RMidhunSuresh --- src/domain/Linkifier.js | 8 ++++---- .../{MessageObjectFormat.js => MessageBodyBuilder.js} | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/domain/{MessageObjectFormat.js => MessageBodyBuilder.js} (92%) diff --git a/src/domain/Linkifier.js b/src/domain/Linkifier.js index 0074e58c..25d1adac 100644 --- a/src/domain/Linkifier.js +++ b/src/domain/Linkifier.js @@ -1,4 +1,4 @@ -import { MessageObjectFormat } from "./MessageObjectFormat.js"; +import { MessageBodyBuilder } from "./MessageBodyBuilder.js"; export class Linkifier { @@ -8,7 +8,7 @@ export class Linkifier { constructor(text) { this._text = text; this._curr = 0; - this._message = new MessageObjectFormat(); + this._message = new MessageBodyBuilder(); } /** @@ -41,7 +41,7 @@ export class Linkifier { /** * Splits message text into parts (text, newline and links) - * @returns {MessageObjectFormat} Object representation of chat message + * @returns {MessageBodyBuilder} Object representation of chat message */ linkify() { const regex = /(?:https|http|ftp):\/\/[a-zA-Z0-9:.\[\]#-]+(?:\/[^\s]*[^\s.,?!]|[^\s\u{80}-\u{10ffff}.,?!])/gui @@ -64,7 +64,7 @@ export function tests() { } function test(assert, input, output) { - output = new MessageObjectFormat(output); + output = new MessageBodyBuilder(output); input = linkify(input); assert.deepEqual(input, output); } diff --git a/src/domain/MessageObjectFormat.js b/src/domain/MessageBodyBuilder.js similarity index 92% rename from src/domain/MessageObjectFormat.js rename to src/domain/MessageBodyBuilder.js index 461856b4..2ed8ed47 100644 --- a/src/domain/MessageObjectFormat.js +++ b/src/domain/MessageBodyBuilder.js @@ -1,4 +1,4 @@ -export class MessageObjectFormat { +export class MessageBodyBuilder { constructor(message = []) { this._root = message;