-
Notifications
You must be signed in to change notification settings - Fork 10
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
inspect( 1n )
=> no joy
#40
Comments
Update the below repeated as #42 Also, dependency https://github.com/sorensen/get-function-name.js is broken; it apparently results in these lines in the build: var getFunctionName = function(fn) {
if (toString$1.call(fn) !== '[object Function]') return null
if (fn.name) return fn.name
var name = /^\s*function\s*([^\(]*)/im.exec(fn.toString())[1];
return name || 'anonymous'
}; This code does not deal with anonymous arrow function and does not even honor the fact that the |
🎉 This issue has been resolved in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Title says it all.
I tried to fix it and jeez you guys should clean up your code.
There's a serious systematic fault here at play in that execution for unknown types will hit
if ( 'constructor' in value )
around line 1161 which causes an exception e.g. withbigint
s. Fix is of course to add that one to the list of known types, but this won't prevent an exception for any new types that get added to JS. For what it does (and it worked well for me so far) the code is much too convoluted IMHO. Also unnecessarily 'abstracty' where abstraction doesn't buy you anything. Case in point, you return fancy formatting handlers forundefined
,null
,true
,false
, when the representations for these values are just these very strings and you're done. All types have aliases with lower and upper case. Type checking is wrapped inside a CSJS polyfill. There is a section dedicated toHTMLTableHeaderCellElement
. Wat, seriously. Some code meant to be used by Chai objects only is thrown in, in no meaningful way separated from the general-purpose stuff (this almost made me toss loupe altogether).Here I donate you some code:
IMO these are good starts to radically simplify the type checking stuff. Have fun.
The text was updated successfully, but these errors were encountered: