@podium/utils
Advanced tools
Changelog
4.4.0 (2020-10-12)
Co-authored-by: Trygve Lie trygve.lie@finn.no
Changelog
5.0.0-next.3 (2020-07-27)
We've been using Symbols to define private properties in classes up until now. This has the downside that they are not true private and in later versions of node.js one would see these Symbols when inspecting an object. What we want is proper private properties.
This PR does also add a pretty printer which outputs an object literal or the object so when debugging one can see the getters and setters of the object.
Example: printing a object with console.log()
would previously print the following:
PodiumHttpIncoming {
[Symbol(podium:httpincoming:development)]: false,
[Symbol(podium:httpincoming:response)]: {},
[Symbol(podium:httpincoming:request)]: {},
[Symbol(podium:httpincoming:context)]: {},
[Symbol(podium:httpincoming:params)]: {},
[Symbol(podium:httpincoming:proxy)]: false,
[Symbol(podium:httpincoming:name)]: '',
[Symbol(podium:httpincoming:view)]: {},
[Symbol(podium:httpincoming:url)]: {},
[Symbol(podium:httpincoming:css)]: [],
[Symbol(podium:httpincoming:js)]: []
}
Now the following will be printed:
{
development: false,
response: {},
request: {},
context: {},
params: {},
proxy: false,
name: '',
view: {},
url: {},
css: [],
js: []
}
Co-authored-by: Trygve Lie trygve.lie@finn.no