bump sqlite from 5.1.4 to 5.1.6 #82

Merged
Anri merged 1 commit from audit/sqlite into main 2023-03-15 13:25:01 +01:00
2 changed files with 9 additions and 7 deletions
Showing only changes of commit 2de89abb4e - Show all commits

6
package-lock.json generated
View file

@ -3570,9 +3570,9 @@
} }
}, },
"node_modules/sqlite3": { "node_modules/sqlite3": {
"version": "5.1.4", "version": "5.1.6",
"resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.4.tgz", "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz",
"integrity": "sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==", "integrity": "sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@mapbox/node-pre-gyp": "^1.0.0", "@mapbox/node-pre-gyp": "^1.0.0",

View file

@ -228,9 +228,11 @@ export const checkOwnershipReminder = async (
userId: string, userId: string,
guildId: string guildId: string
) => { ) => {
type returnData = { [key: string]: number };
const data = (await new Promise((ok, ko) => { const data = (await new Promise((ok, ko) => {
// Check the ownership // Check the ownership
client.db.all( client.db.all<returnData>(
"SELECT EXISTS ( \ "SELECT EXISTS ( \
SELECT 1 FROM reminder \ SELECT 1 FROM reminder \
WHERE id = ? \ WHERE id = ? \
@ -247,7 +249,7 @@ export const checkOwnershipReminder = async (
ok(row[0]); ok(row[0]);
} }
); );
})) as { [key: string]: number }; })) as returnData;
return Object.keys(data).map((key) => data[key])[0] === 0 ? true : false; return Object.keys(data).map((key) => data[key])[0] === 0 ? true : false;
}; };
@ -259,7 +261,7 @@ export const checkOwnershipReminder = async (
export const getReminderInfo = async (client: Client, id: number) => { export const getReminderInfo = async (client: Client, id: number) => {
return (await new Promise((ok, ko) => { return (await new Promise((ok, ko) => {
// Check the ownership // Check the ownership
client.db.all( client.db.all<dbReminder>(
"SELECT * FROM reminder \ "SELECT * FROM reminder \
WHERE id = ?", WHERE id = ?",
[id], [id],
@ -329,7 +331,7 @@ export const updateReminder = (client: Client, data: dbReminder) => {
const listReminders = async (client: Client, userId: string, guildId: string | null) => { const listReminders = async (client: Client, userId: string, guildId: string | null) => {
return (await new Promise((ok, ko) => { return (await new Promise((ok, ko) => {
// Check the ownership // Check the ownership
client.db.all( client.db.all<dbReminder>(
"SELECT data, creation_date, expiration_date, id FROM reminder \ "SELECT data, creation_date, expiration_date, id FROM reminder \
WHERE user_id = ? AND (guild_id = ? OR guild_id = 0)", WHERE user_id = ? AND (guild_id = ? OR guild_id = 0)",
[userId, guildId ?? 0], [userId, guildId ?? 0],