-
Notifications
You must be signed in to change notification settings - Fork 11
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
add an option to render functions as their body #61
Comments
Thanks for the issue @scarf005. I think this is a reasonable suggestion. Perhaps we could make this the default, provided that the functions body fits within the remaining export default function inspectFunction(func, options) {
const source = func.toString()
if (source.length < options.truncate - 12) {
return options.stylize(`[Function: ${source}]`, 'special')
}
const name = getFunctionName(func)
if (!name) {
return options.stylize('[Function]', 'special')
}
return options.stylize(`[Function ${truncate(name, options.truncate - 11)}]`, 'special')
} |
alright, could i create a PR for it? |
Please do! That would be awesome! A robust set of tests against this would be excellent too! |
alright. also out of context, will chai (and its related packages) consider migrating to typescript? |
It's indeed on the radar, alongside making it a first class citizen of Deno. Any help in either direction is very welcome! |
for example:
The text was updated successfully, but these errors were encountered: