Permalink
Browse files

fix(entity): do not skip empty arrays

BREAKING CHANGE: toObject and toJSON will now return empty arrays instead of skipping completely
  • Loading branch information...
RWOverdijk committed Feb 7, 2017
1 parent a813afc commit fad77ec0b5036af73dcd5747c9ff8f6fa0a70bac
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/entity.js
@@ -640,10 +640,7 @@ function asObject(entity, shallow) {
}
});
// We don't send along empty arrays.
if (asObjects.length > 0) {
pojo[propertyName] = asObjects;
}
pojo[propertyName] = asObjects;
});
return pojo;

0 comments on commit fad77ec

Please sign in to comment.