Hi,
Issue #58 allows empty arrays of embedded entities, but I can't see how to use it where I need to map objects that have self-refs defined by their own properties (eg. '/people/{id}') in an array that might be empty.
I think I'm looking for rep.embed to support an array-arg based variant (like rep.link) such as embed(rel, embeddables) where toEmbed is an object with self and entity properties. Then, I can call
rep.embed('friends', rawFriendsArray.map(function(friend) {
var selfHref = '/people/'+friend.id;
delete friend.id;
return {self: selfHref, entity: friend};
}));
...and rawFriendsArray happens to be empty it'll just embed an empty array.
Happy to submit a PR for this if I'm not missing a better way to do it already!