UNPKG
@typed/lenses
Version:
latest (4.1.1)
4.1.1
4.1.0
4.0.0
3.0.0
2.3.0
2.2.0
2.1.0
2.0.0
1.1.0
1.0.0
Strongly-typed functional lenses
@typed/lenses
/
esm
/
PathLens.js
5 lines
•
240 B
JavaScript
View Raw
1
2
3
4
5
import
{
Lens
}
from
'./Lens'
;
import
{ pipe2 }
from
'./pipe2'
;
import
{ fromProp }
from
'./PropLens'
;
export
const
fromPath
= (
keys
) => keys.
reduce
(
(
lens, key
) =>
pipe2
(lens,
fromProp
(key)),
Lens
.
id
());
//# sourceMappingURL=PathLens.js.map