Compare commits

..

2 Commits
7.8.0 ... 7.8.1

Author SHA1 Message Date
a481518470 Version bump 2022-12-30 16:21:00 +00:00
2435ebf16e Correctly return value from constructor 2022-12-30 16:16:59 +00:00
3 changed files with 5 additions and 5 deletions

4
package-lock.json generated
View File

@ -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",

View File

@ -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": {

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;
}
}
}