Skip to content

Commit 6c8ac19

Browse files
committed
fix(serializer): switch let to var
1 parent 68a9238 commit 6c8ac19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/serializer.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,18 +380,18 @@ function handleIncludes (resp, includes, relations, app) {
380380

381381
if (embedded.length) {
382382
// This array may contain duplicate models if the same item is referenced multiple times in 'data'
383-
let duplicate = _.flattenDeep(embedded)
383+
var duplicate = _.flattenDeep(embedded)
384384
// So begin with an empty array that will only contain unique items
385-
let unique = []
385+
var unique = []
386386
// Iterate through each item in the first array
387-
duplicate.forEach(function(d){
387+
duplicate.forEach(function (d) {
388388
// Count the number of items in the unique array with matching 'type' AND 'id'
389389
// Since we're adhering to the JSONAPI spec, both 'type' and 'id' can assumed to be present
390390
// Both 'type' and 'id' are needed for comparison because we could theoretically have objects of different
391391
// types who happen to have the same 'id', and those would not be considered duplicates
392-
let count = unique.filter(function(u){
392+
var count = unique.filter(function (u) {
393393
return (u.type === d.type) && (u.id === d.id)
394-
}).length;
394+
}).length
395395
// If there are no matching entries, then add the item to the unique array
396396
if (count === 0) {
397397
unique.push(d)

0 commit comments

Comments
 (0)