codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

Tight loop in inspect() with cyclic references #120

Closed panrafal closed 8 years ago

panrafal commented 8 years ago

Whenever a structure has a cyclic reference and it does not match a type, inspect() will try to print it's contents and run into a tight loop.

What do you think about limiting maximum depth of inspection, to let's say 4? For readability sake, it would be also beneficial to limit amount of keys to iterate over too, in case there's a huge array/object to print.