Closed Pho3niX90 closed 1 week ago
It's a way to create objects much faster, you can ignore the NullObject part in console.log as it's behavior is the same
It's a way to create objects much faster, you can ignore the NullObject part in console.log as it's behavior is the same
The problem is, it was creating issues in middleware that rely on params and queries from headers., which then caused issues in rxjs
I am busy stepping through one of my prod apps to see where issues are, and try and resolve them as I find them
Just did some quick tests:
creating 100K objects:
{} = 18.615ms
NullObject = 16.975ms
Albeit little difference, let me see if I can fix it another way.
The below is throwing off the tests, and ultimately skewing the true comparisons.
https://github.com/dimdenGD/ultimate-express/blob/3398194b8af64c2c9ade3a20bcc99c9b7804c6af/tests/index.js#L59
Whilst doing some testing in a real prod app, I noticed some behavior which was not the same as express.
Pulling request headers, for example, produced "NullObject <[Object: null prototype] {}> {}"
Is there a reason why the type is being used, instead of just an empty object?