Merge pull request #1861 from dolanmiu/hot-fix/return-constructor-value
Hot fix/return constructor value
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "docx",
|
||||
"version": "7.8.0",
|
||||
"version": "7.8.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "docx",
|
||||
"version": "7.8.0",
|
||||
"version": "7.8.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "^18.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docx",
|
||||
"version": "7.8.0",
|
||||
"version": "7.8.1",
|
||||
"description": "Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user