1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +02:00

All: Resolves #483: Add trash folder (#9671)

This commit is contained in:
Laurent Cozic
2024-03-02 14:25:27 +00:00
committed by GitHub
parent 07fbd547dc
commit f19b1c5364
112 changed files with 2322 additions and 966 deletions

View File

@@ -1,10 +1,10 @@
export const unique = function(array: any[]) {
export const unique = function<T extends any>(array: T[]): T[] {
return array.filter((elem, index, self) => {
return index === self.indexOf(elem);
});
};
export const removeElement = function(array: any[], element: any) {
export const removeElement = function<T extends any>(array: T[], element: T): T[] {
const index = array.indexOf(element);
if (index < 0) return array;
const newArray = array.slice();