From 54cb94db1d76d47633aab970c24993c4afde890b Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sun, 9 Dec 2018 03:40:40 +0900 Subject: [PATCH] Eliminate if-statement (#3555) --- src/mfm/html.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mfm/html.ts b/src/mfm/html.ts index a08666646..50d26e10e 100644 --- a/src/mfm/html.ts +++ b/src/mfm/html.ts @@ -126,11 +126,7 @@ export default (tokens: Node[], mentionedRemoteUsers: INote['mentionedRemoteUser const nodes = (token.props.text as string).split('\n').map(x => doc.createTextNode(x)); for (const x of intersperse('br', nodes)) { - if (x === 'br') { - el.appendChild(doc.createElement('br')); - } else { - el.appendChild(x); - } + el.appendChild(x === 'br' ? doc.createElement('br') : x); } return el;