-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementSome improvementsSome improvements
Description
Document
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference
Target
Lines 121 to 138 in 0530fc2
| export function diffKeys<T extends IndexKey>(oldList: T[], newList: T[]) { | |
| const map = {} as Record<T, DiffStatus>; | |
| for (const item of oldList) map[item] = DiffStatus.Old; | |
| for (const item of newList) { | |
| map[item] ||= 0; | |
| map[item] += DiffStatus.New; | |
| } | |
| return { | |
| map, | |
| group: groupBy( | |
| Object.entries<DiffStatus>(map), | |
| ([key, status]) => status | |
| ) | |
| }; | |
| } |
Metadata
Metadata
Assignees
Labels
enhancementSome improvementsSome improvements
Type
Projects
Status
To do