From 7b73285703c8722066afbc680f3460004c57a0b7 Mon Sep 17 00:00:00 2001 From: ckoegel Date: Tue, 24 Sep 2024 10:22:04 -0400 Subject: [PATCH] don't use ?? --- models/bxml/Verb.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/models/bxml/Verb.ts b/models/bxml/Verb.ts index ac026b1..567a4bd 100644 --- a/models/bxml/Verb.ts +++ b/models/bxml/Verb.ts @@ -8,8 +8,8 @@ import { XMLBuilder, XMLWriterOptions } from 'xmlbuilder2/lib/interfaces'; */ export class Verb { name: string; - content: string; - attributes: object; + content: string | undefined; + attributes: object | undefined; /** * Creates an instance of Verb @@ -19,15 +19,16 @@ export class Verb { */ constructor(name: string, content?: string, attributes?: object) { this.name = name; - this.content = content ?? ''; - this.attributes = attributes ?? {}; + this.content = content; + this.attributes = attributes; } /** * Generate an XML element for the verb */ generateXml(): XMLBuilder { - const xml = create().ele(this.name, this.attributes).txt(this.content); + const xml = create().ele(this.name, this.attributes); + if (this.content) { xml.txt(this.content); } return xml; }