mirror of
https://github.com/directus/directus.git
synced 2026-02-08 20:15:13 -05:00
Prevent nested ternary expressions (#18376)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
@@ -32,11 +32,11 @@ const knexConfig = {
|
||||
|
||||
const allowedLogLevels = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
|
||||
|
||||
const logLevel = process.env.TEST_SAVE_LOGS
|
||||
? allowedLogLevels.includes(process.env.TEST_SAVE_LOGS)
|
||||
? process.env.TEST_SAVE_LOGS
|
||||
: 'info'
|
||||
: 'error';
|
||||
let logLevel = 'error';
|
||||
|
||||
if (process.env.TEST_SAVE_LOGS) {
|
||||
logLevel = allowedLogLevels.includes(process.env.TEST_SAVE_LOGS) ? process.env.TEST_SAVE_LOGS : 'info';
|
||||
}
|
||||
|
||||
const directusAuthConfig = {
|
||||
AUTH_PROVIDERS: 'saml',
|
||||
|
||||
@@ -30,13 +30,16 @@ describe('schema', () => {
|
||||
const currentTzOffset = new Date().getTimezoneOffset();
|
||||
const isWindows = ['win32', 'win64'].includes(process.platform);
|
||||
const newTzOffset = currentTzOffset !== 180 ? 180 : 360;
|
||||
let newTz: string;
|
||||
|
||||
// Different timezone format for Windows
|
||||
const newTz = isWindows
|
||||
? String(newTzOffset * 60)
|
||||
: newTzOffset === 180
|
||||
? 'America/Sao_Paulo'
|
||||
: 'America/Mexico_City';
|
||||
if (isWindows) {
|
||||
newTz = String(newTzOffset * 60);
|
||||
} else if (newTzOffset === 180) {
|
||||
newTz = 'America/Sao_Paulo';
|
||||
} else {
|
||||
newTz = 'America/Mexico_City';
|
||||
}
|
||||
|
||||
const sampleDates: SchemaTimezoneTypesObject[] = [];
|
||||
|
||||
|
||||
@@ -31,9 +31,16 @@ describe('schema', () => {
|
||||
const isWindows = ['win32', 'win64'].includes(process.platform);
|
||||
|
||||
const newTzOffset = currentTzOffset !== -540 ? -540 : -240;
|
||||
let newTz: string;
|
||||
|
||||
// Different timezone format for Windows
|
||||
const newTz = isWindows ? String(newTzOffset * 60) : newTzOffset === -540 ? 'Asia/Seoul' : 'Asia/Dubai';
|
||||
if (isWindows) {
|
||||
newTz = String(newTzOffset * 60);
|
||||
} else if (newTzOffset === -540) {
|
||||
newTz = 'Asia/Seoul';
|
||||
} else {
|
||||
newTz = 'Asia/Dubai';
|
||||
}
|
||||
|
||||
const sampleDates: SchemaTimezoneTypesObject[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user