mirror of
https://github.com/directus/directus.git
synced 2026-02-12 06:24:54 -05:00
Require curly brackets in if statements when they're multi-line (#18387)
* Enable Curly rule * Fix curly misuse
This commit is contained in:
@@ -357,8 +357,9 @@ export function applyFilter(
|
||||
if (key === '_or' || key === '_and') {
|
||||
// If the _or array contains an empty object (full permissions), we should short-circuit and ignore all other
|
||||
// permission checks, as {} already matches full permissions.
|
||||
if (key === '_or' && value.some((subFilter: Record<string, any>) => Object.keys(subFilter).length === 0))
|
||||
if (key === '_or' && value.some((subFilter: Record<string, any>) => Object.keys(subFilter).length === 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
value.forEach((subFilter: Record<string, any>) => {
|
||||
addJoins(dbQuery, subFilter, collection);
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { File, Transformation, TransformationParams } from '../types/index.
|
||||
export function resolvePreset(input: TransformationParams, file: File): Transformation[] {
|
||||
const transforms = input.transforms ? [...input.transforms] : [];
|
||||
|
||||
if (input.format || input.quality)
|
||||
if (input.format || input.quality) {
|
||||
transforms.push([
|
||||
'toFormat',
|
||||
input.format || (file.type!.split('/')[1] as any),
|
||||
@@ -11,8 +11,9 @@ export function resolvePreset(input: TransformationParams, file: File): Transfor
|
||||
quality: input.quality ? Number(input.quality) : undefined,
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
if (input.width || input.height)
|
||||
if (input.width || input.height) {
|
||||
transforms.push([
|
||||
'resize',
|
||||
{
|
||||
@@ -22,6 +23,7 @@ export function resolvePreset(input: TransformationParams, file: File): Transfor
|
||||
withoutEnlargement: input.withoutEnlargement ? Boolean(input.withoutEnlargement) : undefined,
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
return transforms;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user