Your task is to implement a TypeScript utility type called LookupPathParser
.
This utility should take a string representing a lookup object path and produce an array of strings, parsing both dot notation
and array notation
.
Requirements:
a.b.c.d
, the result should be:['a', 'b', 'c', 'd']
a[1].b[0].c
, should be parsed correctly. The result for this case should be:['a', '1', 'b', '0', 'c']
Code