DefinitelyTyped/types/halfred/halfred-tests.ts
2017-03-24 14:27:52 -07:00

13 lines
368 B
TypeScript

// run test with: $ tsc --noImplicitAny --target es6 --module commonjs halfred-tests.ts
import { parse } from 'halfred'; // require('halfred');
let resource = parse({foo: "bar", "_links": { "self": { href: "fooo" }}});
console.log(resource);
let allLinks = resource.allLinks();
for (let key in allLinks) {
let link = allLinks[key];
console.log(link[0].href);
}