Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: