mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Reformat all files with Prettier
This commit is contained in:
parent
0cde0d46d2
commit
ac79eb09f5
206 changed files with 727 additions and 888 deletions
|
@ -1,24 +1,24 @@
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
try {
|
||||
fs.accessSync(path.resolve(__dirname, 'bot.env'));
|
||||
require('dotenv').config({ path: path.resolve(__dirname, 'bot.env') });
|
||||
fs.accessSync(path.resolve(__dirname, "bot.env"));
|
||||
require("dotenv").config({ path: path.resolve(__dirname, "bot.env") });
|
||||
} catch {
|
||||
try {
|
||||
fs.accessSync(path.resolve(__dirname, 'api.env'));
|
||||
require('dotenv').config({ path: path.resolve(__dirname, 'api.env') });
|
||||
fs.accessSync(path.resolve(__dirname, "api.env"));
|
||||
require("dotenv").config({ path: path.resolve(__dirname, "api.env") });
|
||||
} catch {
|
||||
throw new Error("bot.env or api.env required");
|
||||
}
|
||||
}
|
||||
|
||||
const moment = require('moment-timezone');
|
||||
moment.tz.setDefault('UTC');
|
||||
const moment = require("moment-timezone");
|
||||
moment.tz.setDefault("UTC");
|
||||
|
||||
const entities = path.relative(process.cwd(), path.resolve(__dirname, 'dist/backend/src/data/entities/*.js'));
|
||||
const migrations = path.relative(process.cwd(), path.resolve(__dirname, 'dist/backend/src/migrations/*.js'));
|
||||
const migrationsDir = path.relative(process.cwd(), path.resolve(__dirname, 'src/migrations'));
|
||||
const entities = path.relative(process.cwd(), path.resolve(__dirname, "dist/backend/src/data/entities/*.js"));
|
||||
const migrations = path.relative(process.cwd(), path.resolve(__dirname, "dist/backend/src/migrations/*.js"));
|
||||
const migrationsDir = path.relative(process.cwd(), path.resolve(__dirname, "src/migrations"));
|
||||
|
||||
module.exports = {
|
||||
type: "mysql",
|
||||
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
username: process.env.DB_USER,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.DB_DATABASE,
|
||||
charset: 'utf8mb4',
|
||||
charset: "utf8mb4",
|
||||
supportBigNumbers: true,
|
||||
bigNumberStrings: true,
|
||||
dateStrings: true,
|
||||
|
@ -39,13 +39,13 @@ module.exports = {
|
|||
// Pool options
|
||||
extra: {
|
||||
typeCast(field, next) {
|
||||
if (field.type === 'DATETIME') {
|
||||
if (field.type === "DATETIME") {
|
||||
const val = field.string();
|
||||
return val != null ? moment.utc(val).format('YYYY-MM-DD HH:mm:ss') : null;
|
||||
return val != null ? moment.utc(val).format("YYYY-MM-DD HH:mm:ss") : null;
|
||||
}
|
||||
|
||||
return next();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// Migrations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue