Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support Deno.inspect #33

Merged
merged 1 commit into from
May 13, 2021
Merged

support Deno.inspect #33

merged 1 commit into from
May 13, 2021

Conversation

davidchambers
Copy link
Member

@davidchambers davidchambers requested a review from a team May 4, 2021 12:46
Comment on lines +78 to +83
/* istanbul ignore if */
if (typeof Deno !== 'undefined') {
if (Deno != null && typeof Deno.customInspect === 'symbol') {
prototype[Deno.customInspect] = Identity$prototype$show;
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using nested if statements, /* istanbul ignore if */ permits the second portion of the condition to be untested (as it is within the ignored block).

Deno != null handles the pathological case in which Deno is defined globally but its value is null.

typeof Deno.customInspect === 'symbol' is not strictly necessary, but seems sensible.

@davidchambers davidchambers merged commit 7e4d07b into master May 13, 2021
@davidchambers davidchambers deleted the davidchambers/deno-inspect branch May 13, 2021 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants