Correctly return value from constructor

This commit is contained in:
Dolan Miu
2022-12-30 16:16:59 +00:00
parent 62d0767ceb
commit 2435ebf16e

View File

@ -23,11 +23,11 @@ export class Text extends XmlComponent {
if (typeof options === "string") {
this.root.push(new TextAttributes({ space: SpaceType.PRESERVE }));
this.root.push(options);
return;
return this;
} else {
this.root.push(new TextAttributes({ space: options.space ?? SpaceType.DEFAULT }));
this.root.push(options.text);
return;
return this;
}
}
}