js-temporal / temporal-polyfill

Polyfill for Temporal (under construction)
ISC License
529 stars 28 forks source link

Support Deno.customInspect for better debugging in Deno #226

Closed lionel-rowe closed 1 year ago

lionel-rowe commented 1 year ago

Deno.customInspect is not currently supported, which causes logging of Temporal objects in Deno to be pretty unhelpful. Before:

console.log(Temporal.Now.instant())
// Temporal.Instant {}

This PR adds support for this in the same way as nodejs.util.inspect.custom is supported for Node. After:

console.log(Temporal.Now.instant())
// Temporal.Instant <2023-02-28T12:00:20.232618577Z>