Comments (2)
Oh wow, let me take a look at this. Ping me if I forget. I can at least reproduce it so that's something:
1) assert
lengthOf doesn't crash:
RangeError: Maximum call stack size exceeded
at inspectObject (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/object.js:2:23)
at inspectClass (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/class.js:13:20)
at Object.inspect (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/index.js:118:14)
at inspectProperty (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/helpers.js:144:19)
at inspectList (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/helpers.js:108:28)
at inspectObject (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/object.js:14:28)
at inspectClass (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/class.js:13:20)
at Object.inspect (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/index.js:118:14)
at inspectProperty (file:///Users/cr91ew/src/koddsson/chai/node_modules/loupe/lib/helpers.js:144:19)
from loupe.
When generating the preview, would it make sense to automatically limit the size?
For example it's useful to see the message Expected [0, 2, 8] to have length 4
, but it becomes unreadable when the array is huge or when it contains large objects.
An example limit for this specific case could look like arr.length * Object.keys(arr[0]).length < 20
, although I know it might be difficult to translate it into real code. This might also be a choice of the caller rather than loupe
's itself.
I know that Node's inspect won't try to go too deep into objects, so such a limit alone should solve circular references permanently.
from loupe.
Related Issues (20)
- Time representation difference in Chai.js HOT 6
- Loupe doesn't work correctly for buffers HOT 2
- Return value for number 0 HOT 6
- `inspect( 1n )` => no joy HOT 2
- broken dependency `get-function-name` HOT 2
- Handle circular references HOT 1
- Quote complex keys in objects HOT 1
- The automated release is failing 🚨 HOT 1
- IE9+ not supported since 4.3.5 because of loupe HOT 4
- inspect of Object with null prototype causes primitive value error
- Invalid Date object will throw a TypeError HOT 5
- add an option to render functions as their body HOT 5
- Package `loupe` seems to be an ES Module but shipped in a CommonJS package HOT 1
- `depth` option HOT 1
- vulnerability in loupe HOT 1
- New release for Dependabot Fix? HOT 1
- prevent `playwright` installation HOT 2
- Is the custom `inspect()` still needed?
- Loupe is creating wrongly-formed strings when inspecting some strings HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loupe.