1 | export const getIn = (obj, path) => {
|
2 | const newPath = path.slice();
|
3 | if (newPath.length > 1) {
|
4 | const key = newPath.shift();
|
5 | return getIn(obj[key], newPath);
|
6 | }
|
7 | return obj[path];
|
8 | };
|
9 |
|
10 | export const asArray = items => (Array.isArray(items) ? items : [items]);
|