Space preferences for whether or not you see DMs in a Space (#7250)
This commit is contained in:
parent
5ee356daaa
commit
39c4b78371
22 changed files with 911 additions and 350 deletions
|
@ -184,6 +184,8 @@ export function arrayHasDiff(a: any[], b: any[]): boolean {
|
|||
}
|
||||
}
|
||||
|
||||
export type Diff<T> = { added: T[], removed: T[] };
|
||||
|
||||
/**
|
||||
* Performs a diff on two arrays. The result is what is different with the
|
||||
* first array (`added` in the returned object means objects in B that aren't
|
||||
|
@ -192,7 +194,7 @@ export function arrayHasDiff(a: any[], b: any[]): boolean {
|
|||
* @param b The second array. Must be defined.
|
||||
* @returns The diff between the arrays.
|
||||
*/
|
||||
export function arrayDiff<T>(a: T[], b: T[]): { added: T[], removed: T[] } {
|
||||
export function arrayDiff<T>(a: T[], b: T[]): Diff<T> {
|
||||
return {
|
||||
added: b.filter(i => !a.includes(i)),
|
||||
removed: a.filter(i => !b.includes(i)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue