Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Allow inspecting the API default exports without erroring #152

Merged
merged 1 commit into from
Mar 28, 2017
Merged

Allow inspecting the API default exports without erroring #152

merged 1 commit into from
Mar 28, 2017

Conversation

eliperelman
Copy link
Member

No description provided.

@eliperelman
Copy link
Member Author

I tested this in the terminal:

node -e "console.log({ inspect(depth, opts) { return opts; } });"

And received the following output:

{ showHidden: false,
  depth: 2,
  colors: false,
  customInspect: true,
  showProxy: false,
  maxArrayLength: 100,
  breakLength: 60,
  seen: [ [Circular], [1]: [Circular] ],
  stylize: [Function: stylizeNoColor] }

It appears Node.js will pass some custom arguments to the inspect function:

https://nodejs.org/dist/latest-v7.x/docs/api/util.html#util_util_inspect_object_options

Basically sniffing that to see if this is run via util.inspect or an actual call.

@eliperelman eliperelman merged commit ebf7879 into neutrinojs:master Mar 28, 2017
@jefffriesen
Copy link

This will be great!

@aretecode aretecode mentioned this pull request Mar 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants