mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
* @types/traverson - adding missing method to the builder interface * @types/traverson - adding missing methods to the builder interface * @types/traverson - Updating the project url and adding myself to the definition author * @types/traverson - run prettier on traverson-tests * @types/traverson - bugfix added missing walk() arguments * @types/traverson - apparenlty prettier adds a space before the opening brace when used with the function keyword, this seems to break the test. * @types/traverson - added misssing methods.
21 lines
561 B
TypeScript
21 lines
561 B
TypeScript
import traverson = require('traverson');
|
|
|
|
function testTraverson() {
|
|
var mediaTypeHandler: any = {};
|
|
|
|
traverson.registerMediaType('application/some-fancy+json', mediaTypeHandler);
|
|
|
|
traverson
|
|
.from('http://example.api.com/')
|
|
.follow('link_to')
|
|
.withTemplateParameters({ id: 1 })
|
|
.get((error, document, traversal) => {
|
|
traversal
|
|
.continue()
|
|
.follow('link_back')
|
|
.get((error, document, traversal) => {
|
|
///
|
|
});
|
|
});
|
|
}
|