Dot syntax for accessing deeply nested properties.
ryardley opened this issue · 1 comments
ryardley commented
It could be useful to have a dot syntax for deeply nested objects:
const isAdmin = p`{ user.roles: [? "admin" ] }`
isAdmin({
user: {
roles: [ "editor", "admin" ]
}
}); // true
ryardley commented
With optional properties no need for optional coalescing as the property is explorative.
const isAdmin = p`{ user.roles?: [? "admin" ] }`