Skip to content

Commit

Permalink
fixed function not beeing private
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicuschgifthub committed Jul 27, 2024
1 parent 5e9f5f6 commit 54262e9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions DiscordSimpleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ class DiscordSimpleTable {
this._verticalBar = false;
}

setStringOffset(offset = 2) {
setStringOffset(offset = 2) {
this._stringOffset = offset;
return this;
}

addIndex(startValue = 1) {
addIndex(startValue = 1) {
this._items = this._items.map((item, index) => {
return { ...item, index: startValue + index };
});
Expand All @@ -23,7 +23,7 @@ class DiscordSimpleTable {
return this;
}

setJsonArrayInputs(jsonArray) {
setJsonArrayInputs(jsonArray) {
jsonArray.forEach((row) => this._items.push(row));

if (jsonArray.length > 0) {
Expand All @@ -42,7 +42,7 @@ class DiscordSimpleTable {
return this;
}

updateWidthForKeys() {
_updateWidthForKeys() {
for (let key in this._widthForKeys) {
const maxLength = Math.max(
...this._items.map(item => item[key].toString().length)
Expand All @@ -62,7 +62,7 @@ class DiscordSimpleTable {
return string + ' '.repeat(spacesToAdd);
}

makeTopHeader() {
_makeTopHeader() {
let header = "`";

this._columns.forEach(element => {
Expand All @@ -82,7 +82,7 @@ class DiscordSimpleTable {
return header;
}

makeEntries() {
_makeEntries() {
let string = "";

this._items.forEach(dataItem => {
Expand All @@ -101,14 +101,14 @@ class DiscordSimpleTable {
}

build() {
this.updateWidthForKeys();
this._updateWidthForKeys();

let string = this.makeTopHeader();
string += this.makeEntries();
let string = this._makeTopHeader();
string += this._makeEntries();

return string;
}
}


module.exports = { DiscordSimpleTable };
module.exports = DiscordSimpleTable ;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Can be used for Discord to make tables

```js
// Other imports...
const { DiscordSimpleTable } = require('discord-simpletable');
const DiscordSimpleTable = require('discord-simpletable');

const data = [
{ name: "Nicusch", sizetype: "Big", count: 20 },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-simpletable",
"version": "1.0.2",
"version": "1.0.3",
"description": "A DiscordSimpleTable builder for Discord.js",
"main": "DiscordSimpleTable.js",
"publishConfig": {
Expand Down

0 comments on commit 54262e9

Please sign in to comment.