Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement URI fragment link relations and fix dereferencing #5

Merged
merged 1 commit into from Mar 11, 2016

Conversation

danielgtaylor
Copy link
Contributor

This fixes the bug introduced with the 1.0.1 release, as well as adding in the new link relation uri-fragment which contains the unique URL-safe ID as its href value. E.g.

let element = {
  element: 'string',
  meta: {
    id: 'My Special String'
  },
  content: 'Hello!'
};

abagnale.forge(element);

console.log(element.meta.id);
// => My Special String
console.log(element.meta.links[0].href);
// => my-special-string

Obviously you shouldn't assume links[0] but you get the idea! 馃槃 Object members get separated by / instead of . for the URI fragment, so you get pieces like my-object/member-name. Both separator types are configurable and the README is updated to reflect that.

cc @Baggz

@Baggz Baggz self-assigned this Mar 11, 2016
Baggz pushed a commit that referenced this pull request Mar 11, 2016
Implement URI fragment link relations and fix dereferencing
@Baggz Baggz merged commit b535173 into master Mar 11, 2016
@Baggz Baggz deleted the daniel/uri-fragment branch March 11, 2016 08:21
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.

None yet

2 participants