UNPKG
@bookbox/core
Version:
latest (0.4.0)
0.4.0
0.3.2
0.3.1
0.3.0
0.2.0
0.1.1
0.1.0
Bookbox — e-book format
@bookbox/core
/
build
/
esm
/
utils
/
path.js
4 lines
(3 loc)
•
163 B
JavaScript
View Raw
1
2
3
4
export
function
getByPath
(
path, obj
) {
return
path.
reduce
(
(
elems, name
) =>
{
var
_a;
return
(_a = elems[name]) !==
null
&& _a !==
void
0
? _a : {}; }, obj); }