You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-26 22:41:17 +02:00
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user