1 | const _ = require('lodash');
|
2 |
|
3 | module.exports = () => {
|
4 | function hasSameGames(list1, list2) {
|
5 | if (!list1 || !list2) {
|
6 | return false;
|
7 | }
|
8 |
|
9 | list1 = list1 || [];
|
10 | list2 = list2 || [];
|
11 |
|
12 | const list1ids = list1.map(a => a.gameId);
|
13 | const list2ids = list2.map(a => a.gameId);
|
14 |
|
15 | return _.isEmpty(_.xor(list1ids, list2ids));
|
16 | }
|
17 |
|
18 | return {
|
19 | hasSameGames
|
20 | }
|
21 | } |
\ | No newline at end of file |