Open voxpelli opened 3 months ago
Something to keep in mind if one unifies is that .
, [
, ]
are all valid property names of an object, which breaks the text based paths: https://github.com/sindresorhus/type-fest/issues/864
(Also: Symbols are valid properties as well but can't be expressed in any of the two current paths implementations)
Its a bit odd that we have
Get
which accepts three styles of specifying paths, but doesn't usePaths
, and also havePickDeep
etc which usePaths
and only accepts a single style of specifying paths.Paths
is used to validate that the specified paths are valid options + used to give intellisense, both which are handy.Paths
only supports thefoo.0.bar
style of paths whereasGet
also supportsfoo[0].bar
and['foo', '0', 'bar']
, is that maybe overkill forGet
? Or, if useful, shouldPaths
etc be extended with the same functionality?Desired outcome:
Ideally
Get
andPaths
/PickDeep
etc should behave the same when it comes to paths and use the same fundamentals.Random notes
PickDeep
andGet
feels fairly similar in other ways as well – maybe one could adapt the internals ofPickDeep
to also serveGet
?I gave it a look and a try but got a headache and needs to bang my head against something right now.
Upvote & Fund