mirror of
https://github.com/directus/directus.git
synced 2026-02-03 10:54:55 -05:00
Change print width to 120 (#671)
* Increase line-width to 120 * Auto-fix 100->120 columns
This commit is contained in:
@@ -2,10 +2,7 @@ import useFieldsStore from '@/stores/fields';
|
||||
import displays from '@/displays';
|
||||
import { Field } from '@/stores/fields/types';
|
||||
|
||||
export default function adjustFieldsForDisplays(
|
||||
fields: readonly string[],
|
||||
parentCollection: string
|
||||
) {
|
||||
export default function adjustFieldsForDisplays(fields: readonly string[], parentCollection: string) {
|
||||
const fieldsStore = useFieldsStore();
|
||||
|
||||
const adjustedFields: string[] = fields
|
||||
@@ -20,9 +17,7 @@ export default function adjustFieldsForDisplays(
|
||||
if (!display?.fields) return fieldKey;
|
||||
|
||||
if (Array.isArray(display.fields)) {
|
||||
return display.fields.map(
|
||||
(relatedFieldKey: string) => `${fieldKey}.${relatedFieldKey}`
|
||||
);
|
||||
return display.fields.map((relatedFieldKey: string) => `${fieldKey}.${relatedFieldKey}`);
|
||||
}
|
||||
|
||||
if (typeof display.fields === 'function') {
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
export default function arraysAreEqual(
|
||||
a1: readonly (string | number)[],
|
||||
a2: readonly (string | number)[]
|
||||
) {
|
||||
export default function arraysAreEqual(a1: readonly (string | number)[], a2: readonly (string | number)[]) {
|
||||
const superSet: {
|
||||
[key: string]: number;
|
||||
} = {};
|
||||
|
||||
@@ -3,11 +3,7 @@ import getDateFNSLocale from '@/utils/get-date-fns-locale';
|
||||
|
||||
type LocalizedFormatDistance = (...a: Parameters<typeof formatDistanceOriginal>) => Promise<string>;
|
||||
|
||||
export const localizedFormatDistance: LocalizedFormatDistance = async (
|
||||
date,
|
||||
baseDate,
|
||||
options
|
||||
): Promise<string> => {
|
||||
export const localizedFormatDistance: LocalizedFormatDistance = async (date, baseDate, options): Promise<string> => {
|
||||
return formatDistanceOriginal(date, baseDate, {
|
||||
...options,
|
||||
locale: await getDateFNSLocale(),
|
||||
|
||||
@@ -20,8 +20,7 @@ export default function setFavicon(color = '#2f80ed') {
|
||||
|
||||
const string = 'data:image/svg+xml;base64,' + window.btoa(iconSerialized);
|
||||
|
||||
const link: HTMLLinkElement =
|
||||
document.querySelector("link[rel*='icon']") || document.createElement('link');
|
||||
const link: HTMLLinkElement = document.querySelector("link[rel*='icon']") || document.createElement('link');
|
||||
link.type = 'image/x-icon';
|
||||
link.rel = 'icon';
|
||||
link.href = string;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import capitalizeFirst from '@/utils/capitalize-first';
|
||||
|
||||
export default function translateShortcut(keys: string[]) {
|
||||
const isMac =
|
||||
navigator.platform.toLowerCase().startsWith('mac') || navigator.platform.startsWith('iP');
|
||||
const isMac = navigator.platform.toLowerCase().startsWith('mac') || navigator.platform.startsWith('iP');
|
||||
|
||||
if (isMac) {
|
||||
return keys
|
||||
|
||||
@@ -2,10 +2,7 @@ import uploadFile from '@/utils/upload-file';
|
||||
import notify from '@/utils/notify';
|
||||
import i18n from '@/lang';
|
||||
|
||||
export default async function uploadFiles(
|
||||
files: File[],
|
||||
onProgressChange?: (percentages: number[]) => void
|
||||
) {
|
||||
export default async function uploadFiles(files: File[], onProgressChange?: (percentages: number[]) => void) {
|
||||
const progressHandler = onProgressChange || (() => undefined);
|
||||
|
||||
const progressForFiles = files.map(() => 0);
|
||||
|
||||
Reference in New Issue
Block a user