UNPKG
nba
Version:
latest (4.15.0)
4.15.0
4.14.0
4.13.0
4.12.0
4.11.1
4.11.0
4.10.2
4.10.1
4.10.0
4.9.0
4.8.0
4.7.0
4.6.0
4.5.0
4.4.0
4.3.2
4.3.1
4.3.0
4.2.2
4.2.1
4.2.0
4.1.0
4.0.1
4.0.0
3.7.0
3.5.1
3.2.6
3.2.4
3.2.3
3.2.1
3.2.0
3.1.1
3.0.0
2.0.1
2.0.0
1.2.0
1.0.1
1.0.0
0.4.1
0.4.0
0.3.0
0.2.0
0.1.0
JavaScript client for the NBA's stats API
github.com/bttmly/nba
bttmly/nba
nba
/
src
/
util
/
merge-collections.js
9 lines
(7 loc)
•
254 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
const
findWhere =
require
(
"lodash.findwhere"
);
module
.
exports
=
function
mergeCollections
(
idProp, a, b
) {
return
a.
map
(
function
(
itemA
) {
var
itemB =
findWhere
(b, { [idProp]: itemA[idProp] });
return
Object
.
assign
({}, itemA, itemB); }); };