Skip to content

Conversation

@chadkouse
Copy link

fixes #7

hal.js Outdated
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you could do linkGroupPlus(self._links[link.rel], [link]) and get rid of the forceArray. This way you wouldn't even have to change implementation of linkGroupPlus.

@chadkouse
Copy link
Author

Do you think we should handle the case where an array of links with different rels get passed ?

@chadkouse
Copy link
Author

Nevermind - been a long night :) PR coming.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two ternaries in the same expression are hard to follow.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe something like var links = (arguments.length === 1) ? link : extractLinks.apply(this, arguments);

and extractLinks would always receive two arguments. A relation and an href (or array of hrefs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What do you think about allowing the server to force a link to be an array

2 participants