Closed rtweeks closed 2 years ago
Ideally, JavaScript values could be interpolated within square brackets for more complicated values, including customized steps:
const customStep = new lens.Step(...);
const lensOrig = lens(customStep);
const lensTT = A`$[${customStep}]`;
This would facilitate use of the tagged template construction with ES6 Map
containers using non-string
keys. This also suggests it might be good to expose an A
on the lens.Factory
to fully facilitate use of Map
containers.
To some library consumers, it would be convenient if
natural-lenses
supported construction of a lens from JSONPath syntax.Example:
The syntax for constructing the lens looks like the JavaScript that would be used for getting or setting (if on the left hand side of
=
) the target slot if it could be assumed all intermediate containers existed and were JSON types.