Skip to content

Commit 3ebc1b0

Browse files
committed
Prettified code.
1 parent addc8f7 commit 3ebc1b0

File tree

5 files changed

+35
-40
lines changed

5 files changed

+35
-40
lines changed

.github/workflows/npm-publish.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@
44
name: Node.js Package
55

66
on:
7-
release:
8-
types: [created]
7+
release:
8+
types: [created]
99

1010
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v1
16-
with:
17-
node-version: 14
18-
- run: npm ci
19-
- run: npm test
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: 14
18+
- run: npm ci
19+
- run: npm test
2020

21-
publish-npm:
22-
needs: build
23-
runs-on: ubuntu-latest
24-
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-node@v1
27-
with:
28-
node-version: 14
29-
registry-url: https://registry.npmjs.org/
30-
- run: npm ci
31-
- run: npm publish
32-
env:
33-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
21+
publish-npm:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v1
27+
with:
28+
node-version: 14
29+
registry-url: https://registry.npmjs.org/
30+
- run: npm ci
31+
- run: npm publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"main": "dist/index.js",
2424
"name": "discord.js-better-embed",
2525
"prettier": {
26-
"useTabs": true,
26+
"arrowParens": "avoid",
2727
"bracketSpacing": false,
28-
"tabWidth": 4,
2928
"printWidth": 200,
30-
"arrowParens": "avoid",
31-
"singleQuote": true
29+
"singleQuote": true,
30+
"tabWidth": 4,
31+
"useTabs": true
3232
},
3333
"readme": "https://github.com/Ayfri/Better-Embed/blob/master/README.md",
3434
"repository": {

src/BetterEmbed.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class BetterEmbed extends MessageEmbed {
5252
super(data);
5353
this.checkSize();
5454
}
55-
55+
5656
public static fromTemplate(template: keyof typeof templates | typeof templates | MessageEmbedOptions, values: AnyObject) {
5757
if (typeof template === 'string')
5858
if (templates[template]) template = templates[template];
@@ -86,10 +86,11 @@ class BetterEmbed extends MessageEmbed {
8686
if (this.fields?.length > limits.fields.size) throw new RangeError(`Too much fields (${limits.fields.size}).`);
8787
this.fields.forEach(field => {
8888
if (field.name?.length > limits.fields.name) throw new RangeError(`'embed.fields[${this.fields.indexOf(field)}].name' is too long: ${field.name.length} (max: ${limits.fields.name}).`);
89-
if (field.value?.length > limits.fields.value) throw new RangeError(`'embed.fields[${this.fields.indexOf(field)}].value' is too long: ${field.value.length} (max: ${limits.fields.value}).`);
89+
if (field.value?.length > limits.fields.value)
90+
throw new RangeError(`'embed.fields[${this.fields.indexOf(field)}].value' is too long: ${field.value.length} (max: ${limits.fields.value}).`);
9091
});
9192
}
92-
93+
9394
public cutIfTooLong() {
9495
function cutWithLength(text: string, maxLength: number) {
9596
return text.length > maxLength ? `${text.substring(0, maxLength - 3)}...` : text;
@@ -108,8 +109,4 @@ class BetterEmbed extends MessageEmbed {
108109
}
109110
}
110111

111-
export {
112-
BetterEmbed,
113-
templates,
114-
limits,
115-
};
112+
export {BetterEmbed, templates, limits};

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './BetterEmbed.js';
1+
export * from './BetterEmbed.js';

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"declaration": true,
44
"esModuleInterop": true,
55
"forceConsistentCasingInFileNames": true,
6-
"lib": [
7-
"ES2020"
8-
],
6+
"lib": ["ES2020"],
97
"module": "commonjs",
108
"moduleResolution": "node",
119
"noUnusedLocals": true,

0 commit comments

Comments
 (0)