Skip to content

Commit

Permalink
Fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZillaGold committed Feb 25, 2021
1 parent 3b13874 commit 2ba5cb8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rawjsonbuilder",
"version": "1.1.1",
"version": "1.1.2",
"description": "Minecraft Raw JSON text builder",
"main": "./lib/RawJSONBuilder.js",
"types": "./lib/interfaces.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/RawJSONBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const parser = minecraftProtocolChatParser(735);

export class RawJSONBuilder {

message?: IText | ITranslate | IClickEvent | IKeybind | NBT | IScore | ISelector;
message: IText | ITranslate | IClickEvent | IKeybind | NBT | IScore | ISelector;
extra: (IText | ITranslate | IClickEvent | IKeybind | NBT | IScore | ISelector)[] = [];

constructor({ extra, ...message }: RawJSON = {}) {
Expand Down Expand Up @@ -68,7 +68,7 @@ export class RawJSONBuilder {

this.extra = extra.map((element) => element.toJSON());

if (!this.message) {
if (!Object.keys(this.message).length) {
this.setText("");
}

Expand Down

0 comments on commit 2ba5cb8

Please sign in to comment.