From b1f8f28f4ef4d82f62e4d1f9e67e3d5257b4c53b Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Mon, 7 Nov 2022 20:08:29 +0700 Subject: [PATCH] rel fix much again --- commands/botuser.js | 2 +- commands/botvisibility.js | 6 +- commands/cloop.js | 94 +++++++++---------------------- commands/cowsay.js | 6 +- commands/entity.js | 4 +- commands/eval.js | 8 +-- commands/help.js | 16 +++--- commands/list.js | 4 +- commands/music.js | 28 ++++----- commands/time.js | 6 +- commands/translate.js | 2 +- commands/uptime.js | 2 +- commands/urban.js | 4 +- index.js | 6 +- plugins/self_care.js | 2 +- util/colors/minecraft.js | 2 +- util/containsIllegalCharacters.js | 2 +- util/file-exists.js | 2 +- 18 files changed, 77 insertions(+), 119 deletions(-) diff --git a/commands/botuser.js b/commands/botuser.js index 6e7de84..e14cf3f 100644 --- a/commands/botuser.js +++ b/commands/botuser.js @@ -7,7 +7,7 @@ module.exports = { usage: '', trusted: 0, execute: function(bot) { - bot.tellraw('@a', ['', {text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]); + bot.tellraw('@a', [{text: 'The bot\'s username is: ', color: 'white'}, {text: `${bot.username}`, color: 'gold', clickEvent: {action: 'copy_to_clipboard', value: `${bot.username}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the username to your clipboard', color: 'green'}]}}, {text: ' and the UUID is: '}, {text: `${bot.uuid}`, color: 'aqua', clickEvent: {action: 'copy_to_clipboard', value: `${bot.uuid}`}, hoverEvent: {action: 'show_text', contents: [{text: 'Click here to copy the uuid to your clipboard', color: 'green'}]}}]); }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { const Embed = new MessageEmbed() diff --git a/commands/botvisibility.js b/commands/botvisibility.js index 63e21d5..576a5c8 100644 --- a/commands/botvisibility.js +++ b/commands/botvisibility.js @@ -11,11 +11,11 @@ module.exports = { if (args[1] === 'true') { bot.visibility = true; bot.chat('/essentials:vanish disable'); - bot.tellraw('@a', ['', {text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]); + bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'visible', color: 'green'}]); } else if (args[1] === 'false') { bot.visibility = false; bot.chat('/essentials:vanish enable'); - bot.tellraw('@a', ['', {text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]); + bot.tellraw('@a', [{text: 'The bot\'s visibility is now ', color: 'white'}, {text: 'invisible', color: 'gold'}]); } else { throw new SyntaxError('Invalid argument'); } @@ -24,7 +24,7 @@ module.exports = { } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { - if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { + if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { if (args[0] === 'true') { bot.visibility = true; bot.chat('/essentials:vanish disable'); diff --git a/commands/cloop.js b/commands/cloop.js index 6a8b561..eeaeeea 100644 --- a/commands/cloop.js +++ b/commands/cloop.js @@ -63,87 +63,48 @@ module.exports = { execute: function(bot, username, usernameraw, sender, prefix, args) { if (!bot.cloops) bot.cloops = []; - if (args[1] === 'add') { - if (args[0] === bot.hash) { - if (args[3]) { - if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval'); - add(args.slice(3).join(' '), args[2], bot); - bot.tellraw('@a', [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]); - } - } else { - throw new Error('Invalid hash'); - } - return; - } - if (args[1] === 'list') { - if (args[0] === bot.hash) { + if (args[0] === bot.hash) { + if (args[1] === 'add' && args[3]) { + if (!Number(args[2]) && Number(args[2]) !== 0) throw new SyntaxError('Invalid interval'); + add(args.slice(3).join(' '), args[2], bot); + bot.tellraw('@a', [{text: 'Added command ', color: 'white'}, {text: `${args.slice(3).join(' ')}`, color: 'aqua'}, {text: ' with interval ', color: 'white'}, {text: `${args[2]}`, color: 'green'}, {text: ' to the cloops', color: 'white'}]); + } else if (args[1] === 'list') { list(bot); - } else { - throw new Error('Invalid hash'); - } - return; - } - if (args[1] === 'remove') { - if (args[0] === bot.hash) { + } else if (args[1] === 'remove') { remove(args[2]); - bot.tellraw('@a', ['', {text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]); - } else { - throw new Error('Invalid hash'); - } - return; - } - if (args[1] === 'removeall') { - if (args[0] === bot.hash) { + bot.tellraw('@a', [{text: 'Removed cloop '}, {text: args[2], color: 'aqua'}]); + } else if (args[1] === 'removeall') { clear(); - bot.tellraw('@a', ['', {text: 'Removed all looped commands', color: 'white'}]); + bot.tellraw('@a', [{text: 'Removed all looped commands', color: 'white'}]); } else { - throw new Error('Invalid hash'); + throw new SyntaxError('Invalid argument'); } - return; + } else { + throw new Error('Invalid hash'); } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { if (!bot.cloops) bot.cloops = []; - if (args[0] === 'add') { - if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { - if (args[2]) { - if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval'); - add(args.slice(2).join(' '), args[1], bot); - const Embed = new MessageEmbed() - .setColor('#FFFF00') - .setTitle('Cloop') - .setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`); - channeldc.send({embeds: [Embed]}); - } - } else { - throw new Error('You\'re not in the trusted role!'); - } - return; - } - if (args[0] === 'list') { - if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { + if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { + if (args[0] === 'add' && args[2]) { + if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval'); + add(args.slice(2).join(' '), args[1], bot); + const Embed = new MessageEmbed() + .setColor('#FFFF00') + .setTitle('Cloop') + .setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`); + channeldc.send({embeds: [Embed]}); + } else if (args[0] === 'list') { list(bot, true, channeldc); - } else { - throw new Error('You\'re not in the trusted role!'); - } - return; - } - if (args[0] === 'remove') { - if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { + } else if (args[0] === 'remove') { remove(args[1]); const Embed = new MessageEmbed() .setColor('#FFFF00') .setTitle('Cloop') .setDescription(`Removed cloop \`${args[1]}\``); channeldc.send({embeds: [Embed]}); - } else { - throw new Error('You\'re not in the trusted role!'); - } - return; - } - if (args[0] === 'removeall') { - if (message.member.roles.cache.some((role) => role.name === 'Trusted')) { + } else if (args[0] === 'removeall') { clear(); const Embed = new MessageEmbed() .setColor('#FFFF00') @@ -151,9 +112,10 @@ module.exports = { .setDescription('Removed all looped commands'); channeldc.send({embeds: [Embed]}); } else { - throw new Error('You\'re not in the trusted role!'); + throw new Error('Invalid argument'); } - return; + } else { + throw new Error('You\'re not in the trusted role!'); } }, }; diff --git a/commands/cowsay.js b/commands/cowsay.js index a2a3926..ff31879 100644 --- a/commands/cowsay.js +++ b/commands/cowsay.js @@ -8,9 +8,7 @@ module.exports = { usage: ' ', trusted: 0, execute: function(bot, username, usernameraw, sender, prefix, args) { - if (args[0]!=='list') { - bot.tellraw('@a', {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`}); - } else { + if (args[0]==='list') { let color = '§6'; let message = ''; @@ -23,6 +21,8 @@ module.exports = { message += color + value + ' '; }); bot.tellraw('@a', [{text: 'Cows: ', color: 'green'}, '\n', {text: message, color: 'red'}]); + } else { + bot.tellraw('@a', {text: `${cowsay.say(args.slice(1).join(' '), {cow: cows[args[0]]})}`}); } }, }; diff --git a/commands/entity.js b/commands/entity.js index 3f7e804..70bd127 100644 --- a/commands/entity.js +++ b/commands/entity.js @@ -15,10 +15,10 @@ module.exports = { // if (!entity) throw new SyntaxError('Invalid entity'); // if (!args[1]) { // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at @r[\'limit\'=10] run summon minecraft:' + entity.name); - // bot.tellraw('@a', ['', {text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]); + // bot.tellraw('@a', [{text: 'Entity ', color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at everyone...', color: 'white'}]); // } else if (args[1] === 'specific' && args[2]) { // bot.core.run('minecraft:execute unless entity @s[name= run ] run execute as @a at ' + args[2] + ' run summon minecraft:' + entity.name); - // bot.tellraw('@a', ['', {text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]); + // bot.tellraw('@a', [{text: `Entity `, color: 'white'}, {text: entity.displayName, color: 'green'}, {text: ' spawning at ', color: 'white'}, {text: `${args[2]}`, color: 'aqua'}]); // } }, }; diff --git a/commands/eval.js b/commands/eval.js index 214436d..71bf6c8 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -60,11 +60,9 @@ module.exports = { } catch (err) { throw err; } - } - if (args[0] === 'reset') { + } else if (args[0] === 'reset') { bot.vm = new VM(bot.vmoptions); - } - if (args[0] === 'server') { + } else if (args[0] === 'server') { axios .post(config.eval.serverUrl, querystring.stringify({ html: false, @@ -79,6 +77,8 @@ module.exports = { }).catch((err) => { throw err; }); + } else { + throw new SyntaxError('Invalid argument'); } }, }; diff --git a/commands/help.js b/commands/help.js index eaa932a..64b2dfb 100644 --- a/commands/help.js +++ b/commands/help.js @@ -12,18 +12,18 @@ module.exports = { let trustedCommands = ''; let ownerCommands = ''; for (const command of bot.command_handler.commands) { - if (command.trusted!==0) continue; + if (command.trusted !== 0) continue; generalCommands += ' ' + command.name; } for (const command of bot.command_handler.commands) { - if (command.trusted!==1) continue; + if (command.trusted !== 1) continue; trustedCommands += ' ' + command.name; } for (const command of bot.command_handler.commands) { - if (command.trusted!==2) continue; + if (command.trusted !== 2) continue; ownerCommands += ' ' + command.name; } - if (typeof args[0]!=='undefined') { + if (typeof args[0] !== 'undefined') { for (const command of bot.command_handler.commands) { function m() { let discordSupported; @@ -33,7 +33,7 @@ module.exports = { } else { discordSupported = 'true'; } - if (command.alias.toString()!=='') { + if (command.alias.toString() !== '') { alias = command.alias.join(', '); } bot.tellraw('@a', [{text: prefix + command.name, color: 'gold'}, {text: ` (${alias})`, color: 'white'}, {text: ' - ', color: 'gray'}, {text: command.description, color: 'gray'}]); @@ -53,7 +53,7 @@ module.exports = { } }, discordExecute: async function(bot, username, usernameraw, sender, prefix, args, channeldc) { - if (typeof args[0]!=='undefined') { + if (typeof args[0] !== 'undefined') { for (const command of bot.command_handler.commands) { function m() { let discordSupported; @@ -63,7 +63,7 @@ module.exports = { } else { discordSupported = 'true'; } - if (command.alias.toString()!=='') { + if (command.alias.toString() !== '') { alias = command.alias.join(', '); } const Embed = new MessageEmbed() @@ -89,7 +89,7 @@ module.exports = { supportedCommands += command.name + ' '; } for (const command of bot.command_handler.commands) { - if (typeof command.discordExecute!=='undefined') continue; + if (typeof command.discordExecute !== 'undefined') continue; unsupportedCommands += command.name + ' '; } const Embed = new MessageEmbed() diff --git a/commands/list.js b/commands/list.js index 5f13c27..7b1957a 100644 --- a/commands/list.js +++ b/commands/list.js @@ -9,11 +9,11 @@ module.exports = { trusted: 0, execute: async function(bot) { try { - bot.tellraw('@a', ['', {text: 'Players:', color: 'green'}]); + bot.tellraw('@a', [{text: 'Players:', color: 'green'}]); await sleep(60); for (const property of bot.players.list) { // if (property.match.startsWith('@')) continue; - bot.tellraw('@a', ['', {text: `${property.name}`, color: 'yellow'}, {text: ' › ', color: 'aqua'}, {text: `${property.UUID}`, color: 'aqua'}]); + bot.tellraw('@a', [{text: `${property.name}`, color: 'yellow'}, {text: ' › ', color: 'aqua'}, {text: `${property.UUID}`, color: 'aqua'}]); } } catch (e) { return; diff --git a/commands/music.js b/commands/music.js index 1e76cfe..d740f90 100644 --- a/commands/music.js +++ b/commands/music.js @@ -136,45 +136,41 @@ module.exports = { execute: function(bot, username, usernameraw, sender, prefix, args) { if (args[0] === 'play') { play(bot, args.slice(1)); - } - if (args[0] === 'playurl') { + } else if (args[0] === 'playurl') { playUrl(bot, args.slice(1)); - } - if (args[0] === 'stop') { + } else if (args[0] === 'stop') { try { bot.tellraw('@a', {text: 'Cleared the song queue'}); } catch (e) { return; } bot.music.stop(); - } - if (args[0] === 'skip') { + } else if (args[0] === 'skip') { try { bot.tellraw('@a', [{text: 'Skipping '}, {text: bot.music.song.name, color: 'gold'}]); bot.music.skip(); } catch (e) { throw new Error('No music is currently playing!'); } - } - if (args[0] === 'loop') { + } else if (args[0] === 'loop') { if (args[1] === 'off') { bot.music.loop = 0; bot.tellraw('@a', [{text: 'Looping is now '}, {text: 'disabled', color: 'red'}]); - } - if (args[1] === 'current') { + } else if (args[1] === 'current') { bot.music.loop = 1; bot.tellraw('@a', [{text: 'Now Looping '}, {text: song.name, color: 'gold'}]); - } - if (args[1] === 'all') { + } else if (args[1] === 'all') { bot.music.loop = 2; bot.tellraw('@a', {text: 'Now looping every song in the queue'}); + } else { + throw new SyntaxError('Invalid argument'); } - } - if (args[0] === 'list') { + } else if (args[0] === 'list') { list(bot); - } - if (args[0] === 'nowplaying') { + } else if (args[0] === 'nowplaying') { bot.tellraw('@a', [{text: 'Now playing '}, {text: bot.music.song.name, color: 'gold'}]); + } else { + throw new SyntaxError('Invalid argument'); } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { diff --git a/commands/time.js b/commands/time.js index ea5e56a..d6897b8 100644 --- a/commands/time.js +++ b/commands/time.js @@ -10,14 +10,14 @@ module.exports = { execute: function(bot, username, usernameraw, sender, prefix, args) { const timezone = args.join(' '); const momented = moment().tz(`${timezone}`).format('dddd, MMMM Do, YYYY, hh:mm:ss A'); - const command = 'minecraft:tellraw @a ' + JSON.stringify(['', {text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}]); + const component = [{text: 'The current date and time for the timezone ', color: 'white'}, {text: timezone, color: 'aqua'}, {text: ' is: ', color: 'white'}, {text: `${momented}`, color: 'green'}]; if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { - bot.core.run(command); + bot.tellraw('@a', component); return; } else if (momented === moment().format('dddd, MMMM Do, YYYY, hh:mm:ss A')) { throw new SyntaxError('Invalid timezone'); } else { - bot.core.run(command); + bot.tellraw('@a', component); } }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc) { diff --git a/commands/translate.js b/commands/translate.js index 0fe7b99..94c08fa 100644 --- a/commands/translate.js +++ b/commands/translate.js @@ -10,7 +10,7 @@ module.exports = { execute: async function(bot, username, usernameraw, sender, prefix, args) { try { const res = await translate(args.slice(2).join(' '), {from: args[0], to: args[1]}); - bot.tellraw('@a', ['', {text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]); + bot.tellraw('@a', [{text: 'Result: ', color: 'gold'}, {text: res.text, color: 'green'}]); } catch (e) { bot.tellraw('@a', {text: String(e), color: 'red'}); } diff --git a/commands/uptime.js b/commands/uptime.js index 9b4a11a..fb85450 100644 --- a/commands/uptime.js +++ b/commands/uptime.js @@ -8,7 +8,7 @@ module.exports = { usage: '', trusted: 0, execute: function(bot) { - bot.tellraw('@a', ['', {text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]); + bot.tellraw('@a', [{text: 'The bot\'s uptime is ', color: 'white'}, {text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green'}]); }, discordExecute: function(bot, username, usernameraw, sender, prefix, args, channeldc, message) { const Embed = new MessageEmbed() diff --git a/commands/urban.js b/commands/urban.js index dfec2b6..48c855a 100644 --- a/commands/urban.js +++ b/commands/urban.js @@ -9,11 +9,11 @@ module.exports = { execute: function(bot, username, usernameraw, sender, prefix, args) { urban.autocompleteExtra(args[0], (error, results) => { if (error) { - bot.tellraw('@a', ['', {text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]); + bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: error.message, color: 'red'}]); return; } results.forEach(({preview, term}) => { - bot.tellraw('@a', ['', {text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]); + bot.tellraw('@a', [{text: '[', color: 'dark_red'}, {text: 'Urban', color: 'red'}, {text: '] ', color: 'dark_red'}, {text: term, color: 'white'}, {text: ' - ', color: 'white'}, {text: preview, color: 'white'}]); }); }); }, diff --git a/index.js b/index.js index 8046dc8..82af73d 100644 --- a/index.js +++ b/index.js @@ -233,7 +233,7 @@ function main() { crypto, colorConvert, bruhifyText: function(message) { - if (typeof message!=='string') throw new SyntaxError('message must be a string'); + if (typeof message !== 'string') throw new SyntaxError('message must be a string'); bot.bruhifyText = message.substring(0, 1000); }, generateEaglerUsername, @@ -259,7 +259,7 @@ function main() { if (parsedMessage.translate === 'translation.test.invalid') return; // down here it prevents command set message if (parsedMessage.translate === 'advMode.setCommand.success') return; - if (parsedMessage.extra!==undefined) { + if (parsedMessage.extra !== undefined) { if (parsedMessage.extra[0].text === 'Command set: ') return; } // prevent braille cuz it CRASHES THE ENTIRE LAPTOP @@ -374,7 +374,7 @@ dcclient.on('ready', async () => { } if (line === '.kill') process.exit(); if (line.startsWith('.')) return bot.command_handler.run('Console', '§a§lConsole§r', '*' + line.substring(1), 'c0ns0le-uuid'); - bot.tellraw('@a', ['', {'text': '[', 'color': 'dark_gray'}, {'text': `${bot.username} Console`, 'color': 'gray'}, {'text': '] ', 'color': 'dark_gray'}, {'text': 'chayapak ', 'color': 'green'}, {'text': '› ', 'color': 'dark_gray'}, chatMessage.MessageBuilder.fromString('&7' + line)]); + bot.tellraw('@a', [{'text': '[', 'color': 'dark_gray'}, {'text': `${bot.username} Console`, 'color': 'gray'}, {'text': '] ', 'color': 'dark_gray'}, {'text': 'chayapak ', 'color': 'green'}, {'text': '› ', 'color': 'dark_gray'}, chatMessage.MessageBuilder.fromString('&7' + line)]); } catch (e) { console.log(e); } diff --git a/plugins/self_care.js b/plugins/self_care.js index 4ea7762..9e0a5d7 100644 --- a/plugins/self_care.js +++ b/plugins/self_care.js @@ -54,7 +54,7 @@ function inject(bot, dcclient, config) { }); const interval = setInterval(() => { - if (bot.options.host!=='0.tcp.ap.ngrok.io') { + if (bot.options.host !== '0.tcp.ap.ngrok.io') { if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]'); if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]'); if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on'); diff --git a/util/colors/minecraft.js b/util/colors/minecraft.js index 4811a2d..00b542c 100644 --- a/util/colors/minecraft.js +++ b/util/colors/minecraft.js @@ -16,7 +16,7 @@ const styles = { function stylize(str, styleType) { const style = styles[styleType]; - if (style !== undefined) return `${style}${str}\xa7r`; + if (style !== undefined) return `${style}${str}\xa7r`; return str; } diff --git a/util/containsIllegalCharacters.js b/util/containsIllegalCharacters.js index fd48d95..e0c8010 100644 --- a/util/containsIllegalCharacters.js +++ b/util/containsIllegalCharacters.js @@ -1,6 +1,6 @@ /* eslint-disable max-len */ function isAllowedCharacter(character) { - return character !== '\xa7' && character >= ' ' && character !== '\x7f'; + return character !== '\xa7' && character >= ' ' && character !== '\x7f'; } function containsIllegalCharacters(string) { for (let i = 0; i < string.length; i++) if (!isAllowedCharacter(string[i])) return true; diff --git a/util/file-exists.js b/util/file-exists.js index f472d1d..e91418f 100644 --- a/util/file-exists.js +++ b/util/file-exists.js @@ -5,7 +5,7 @@ async function fileExists (filepath) { await fs.access(filepath) return true } catch (error) { - if (error.code !== 'ENOENT') throw error + if (error.code !== 'ENOENT') throw error return false }