refactor: remove pad dependency

because it can be done in vanilla JS just as easily
This commit is contained in:
Isaac 2023-02-17 14:23:51 +00:00
parent 725fdf5ac5
commit 7b632ec54b
No known key found for this signature in database
GPG Key ID: 0DE40AE37BBA5C33
3 changed files with 1 additions and 29 deletions

View File

@ -65,7 +65,6 @@
"node-dir": "^0.1.17",
"node-emoji": "^1.11.0",
"object-diffy": "^1.0.4",
"pad": "^3.2.0",
"prisma": "^4.10.1",
"semver": "^7.3.8",
"terminal-link": "^2.1.1",

View File

@ -37,7 +37,6 @@ specifiers:
node-emoji: ^1.11.0
nodemon: ^2.0.20
object-diffy: ^1.0.4
pad: ^3.2.0
prisma: ^4.10.1
semver: ^7.3.8
terminal-link: ^2.1.1
@ -71,7 +70,6 @@ dependencies:
node-dir: 0.1.17
node-emoji: 1.11.0
object-diffy: 1.0.4
pad: 3.2.0
prisma: 4.10.1
semver: 7.3.8
terminal-link: 2.1.1
@ -1106,11 +1104,6 @@ packages:
wrap-ansi: 7.0.0
dev: true
/clone/1.0.4:
resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
engines: {node: '>=0.8'}
dev: false
/clsx/1.2.1:
resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
engines: {node: '>=6'}
@ -1460,12 +1453,6 @@ packages:
resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==}
dev: true
/defaults/1.0.4:
resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
dependencies:
clone: 1.0.4
dev: false
/depd/2.0.0:
resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==}
engines: {node: '>= 0.8'}
@ -3061,13 +3048,6 @@ packages:
engines: {node: '>=6'}
dev: true
/pad/3.2.0:
resolution: {integrity: sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==}
engines: {node: '>= 4.0.0'}
dependencies:
wcwidth: 1.0.1
dev: false
/parent-module/1.0.1:
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
engines: {node: '>=6'}
@ -4125,12 +4105,6 @@ packages:
engines: {node: '>= 0.8'}
dev: false
/wcwidth/1.0.1:
resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
dependencies:
defaults: 1.0.4
dev: false
/webidl-conversions/3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
dev: true

View File

@ -6,7 +6,6 @@ const Mustache = require('mustache');
const { AttachmentBuilder } = require('discord.js');
const Cryptr = require('cryptr');
const { decrypt } = new Cryptr(process.env.ENCRYPTION_KEY);
const pad = require('pad');
module.exports = class TranscriptSlashCommand extends SlashCommand {
constructor(client, options) {
@ -84,7 +83,7 @@ module.exports = class TranscriptSlashCommand extends SlashCommand {
message.text = message.content.content?.replace(/\n/g, '\n\t') ?? '';
message.content.attachments?.forEach(a => (message.text += '\n\t' + a.url));
message.content.embeds?.forEach(() => (message.text += '\n\t[embedded content]'));
message.number = 'M' + pad(String(ticket.archivedMessages.length).length, i + 1, '0');
message.number = 'M' + String(i + 1).padStart(ticket.archivedMessages.length.toString().length, '0');
ticket.archivedMessages[i] = message;
});