jpbochi / halberd

JavaScript implementation of HAL format
Other
8 stars 3 forks source link

Example doesn't behave as expected #17

Open stigbd opened 6 years ago

stigbd commented 6 years ago

When running the ordersCollection example in README.md, I would expect the embedded orders to be written out to log. Instead this is what I get:

{ _links:
   { self: { href: '/orders' },
     next: { href: '/orders?page=2' },
     find: { href: '/orders{?id}', templated: true } },
  _embedded: { orders: [ [Object], [Object] ] },
  currentlyProcessing: 14,
  shippedToday: 20 }

When doing ordersCollection.toXML() the embedded objects are written to log as expected.

I'm on node version v10.9.0.

stigbd commented 6 years ago

When doing JSON.stringify(ordersCollection) instead of ordersCollection.toJSON() example does behave as expected.