https://github.com/valtech-ch/hateoas-parser
Javascript HATEOAS parser
https://github.com/valtech-ch/hateoas-parser
hateoas hateoas-client javascript javascript-library
Last synced: 6 months ago
JSON representation
Javascript HATEOAS parser
- Host: GitHub
- URL: https://github.com/valtech-ch/hateoas-parser
- Owner: valtech-ch
- License: mit
- Created: 2019-03-11T15:18:27.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-05-07T14:41:51.000Z (over 6 years ago)
- Last Synced: 2025-02-10T20:13:31.731Z (8 months ago)
- Topics: hateoas, hateoas-client, javascript, javascript-library
- Language: JavaScript
- Size: 9.77 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hateoas-parser
Javascript HATEOAS parser


### API
This library exposes 4 methods.
`getEndpoint(index, rel, params, version)`
Pick the "rel" endpoint from the "index" dictionary and resolve it with the provided "params" and "version".
`parseLinks(result)`
Simple function to convert a raw HATEOAS index result to a more usable key-value Hash
`parseUrl(url, params)`
Does the same as getEndpoint() but with a URL without solving the index-rel-version puzzle before. parseUrl() is internally called by getEndpoint().
`getCleanEndpoint(index, rel)`
Format an endpoint by simply removing all optional or required paramaters in the querystring