Skip to content

Commit

Permalink
Fix addExtra method
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZillaGold committed Mar 15, 2021
1 parent 684b52f commit 80ba736
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 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.3",
"version": "1.1.4",
"description": "Minecraft Raw JSON text builder",
"main": "./lib/RawJSONBuilder.js",
"types": "./lib/interfaces.d.ts",
Expand Down
7 changes: 4 additions & 3 deletions src/RawJSONBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ export class RawJSONBuilder {
addExtra(extra: RawJSONBuilder | RawJSONBuilder[]): this {
extra = Array.isArray(extra) ? extra : [extra];

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

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

0 comments on commit 80ba736

Please sign in to comment.