logoalt Hacker News

TimTheTinkertoday at 8:52 PM0 repliesview on HN

Updating JSON.parse() to automatically create Temporal objects (from what shape of JSON value?) without a custom reviver would be a step too far, in my opinion.

This is effectively no different from Date:

  serialize: date.toJSON()
  deserialize: new Date(jsonDate)
in Temporal:

  serialize: instant.toJSON()
  deserialize: Temporal.Instant.from(jsonDate)