Remove needless async/await
This commit is contained in:
parent
26c9d8ff6f
commit
29b000e03c
|
@ -17,11 +17,11 @@ export type IBlocking = {
|
||||||
blockerId: mongo.ObjectID;
|
blockerId: mongo.ObjectID;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
blockings: (string | mongo.ObjectID | IBlocking)[],
|
blockings: (string | mongo.ObjectID | IBlocking)[],
|
||||||
me?: string | mongo.ObjectID | IUser
|
me?: string | mongo.ObjectID | IUser
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(blockings.map(x => pack(x, me))));
|
return Promise.all(blockings.map(x => pack(x, me)));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const pack = (
|
export const pack = (
|
||||||
|
|
|
@ -73,13 +73,13 @@ export function validateFileName(name: string): boolean {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
files: any[],
|
files: any[],
|
||||||
options?: {
|
options?: {
|
||||||
detail: boolean
|
detail: boolean
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(files.map(f => pack(f, options))));
|
return Promise.all(files.map(f => pack(f, options)));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,11 +16,11 @@ export type IFavorite = {
|
||||||
noteId: mongo.ObjectID;
|
noteId: mongo.ObjectID;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
favorites: any[],
|
favorites: any[],
|
||||||
me: any
|
me: any
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(favorites.map(f => pack(f, me))));
|
return Promise.all(favorites.map(f => pack(f, me)));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -17,11 +17,11 @@ export interface IMute {
|
||||||
muteeId: mongo.ObjectID;
|
muteeId: mongo.ObjectID;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
mutes: (string | mongo.ObjectID | IMute)[],
|
mutes: (string | mongo.ObjectID | IMute)[],
|
||||||
me?: string | mongo.ObjectID | IUser
|
me?: string | mongo.ObjectID | IUser
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(mutes.map(x => pack(x, me))));
|
return Promise.all(mutes.map(x => pack(x, me)));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const pack = (
|
export const pack = (
|
||||||
|
|
|
@ -164,7 +164,7 @@ export const hideNote = async (packedNote: any, meId: mongo.ObjectID) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
notes: (string | mongo.ObjectID | INote)[],
|
notes: (string | mongo.ObjectID | INote)[],
|
||||||
me?: string | mongo.ObjectID | IUser,
|
me?: string | mongo.ObjectID | IUser,
|
||||||
options?: {
|
options?: {
|
||||||
|
@ -172,7 +172,7 @@ export const packMany = async (
|
||||||
skipHide?: boolean;
|
skipHide?: boolean;
|
||||||
}
|
}
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(notes.map(n => pack(n, me, options))));
|
return Promise.all(notes.map(n => pack(n, me, options)));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -51,10 +51,10 @@ export interface INotification {
|
||||||
isRead: Boolean;
|
isRead: Boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const packMany = async (
|
export const packMany = (
|
||||||
notifications: any[]
|
notifications: any[]
|
||||||
) => {
|
) => {
|
||||||
return (await Promise.all(notifications.map(n => pack(n))));
|
return Promise.all(notifications.map(n => pack(n)));
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue