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 logging S.Nothing in deno #711

Open
jceb opened this issue May 4, 2021 · 0 comments
Open

Support logging S.Nothing in deno #711

jceb opened this issue May 4, 2021 · 0 comments

Comments

@jceb
Copy link

jceb commented May 4, 2021

The current implementation of sanctuary leads deno to show S.Nothing as {}. Example code to trigger the behavior by storing it in file issue.js and executing it with deno run issue.js:

import sanctuary from "https://cdn.skypack.dev/[email protected]?dts";
console.log(sanctuary.Nothing);

The issue stems from Deno not supporting the hook Node.js provides for logging.

Solution: Define a custom inspect function as described here https://doc.deno.land/builtin/stable#Deno.inspect

Deno can be detected as follows: typeof Deno === 'object' && typeof Deno.customInspect === 'symbol'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant