diff --git a/package-lock.json b/package-lock.json index 5f60273..54ae4a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,39 @@ { "name": "rawjsonbuilder", - "version": "1.1.2", - "lockfileVersion": 1, + "version": "1.1.3", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "rawjsonbuilder", + "version": "1.1.3", + "license": "MIT", + "dependencies": { + "minecraft-protocol-chat-parser": "^3.0.2" + }, + "devDependencies": { + "typescript": "^4.1.5" + } + }, + "node_modules/minecraft-protocol-chat-parser": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minecraft-protocol-chat-parser/-/minecraft-protocol-chat-parser-3.0.2.tgz", + "integrity": "sha512-k8GDmsE95h1H+kw4aLOcwMe2SvQd/0g66na+zMWb4SVulTxzZB0ILyw9iEFBj4nMvUiuvZXqFGoMc7qOEGNiPQ==" + }, + "node_modules/typescript": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", + "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + } + }, "dependencies": { "minecraft-protocol-chat-parser": { "version": "3.0.2", diff --git a/package.json b/package.json index ae24c74..ab89795 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rawjsonbuilder", - "version": "1.1.2", + "version": "1.1.3", "description": "Minecraft Raw JSON text builder", "main": "./lib/RawJSONBuilder.js", "types": "./lib/interfaces.d.ts", diff --git a/src/RawJSONBuilder.ts b/src/RawJSONBuilder.ts index 66ffec8..bf93e02 100644 --- a/src/RawJSONBuilder.ts +++ b/src/RawJSONBuilder.ts @@ -82,6 +82,10 @@ export class RawJSONBuilder { .map((element) => element.toJSON()) .concat(extra); + if (!Object.keys(this.message).length) { + this.setText(""); + } + return this; }