mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
move getValue to utils
This commit is contained in:
parent
eb47b05fe4
commit
33b340b6bb
@ -12,6 +12,7 @@ import { useAddMarker, useAddPopup, useLeafletRefs } from './hooks/useLeafletRef
|
||||
import { Popup } from 'leaflet'
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useAssetApi } from '../AppShell/hooks/useAssets'
|
||||
import { getValue } from '../../Utils/GetValue'
|
||||
|
||||
export const Layer = (props: LayerProps) => {
|
||||
|
||||
@ -170,14 +171,4 @@ export const Layer = (props: LayerProps) => {
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
function getValue(obj, path) {
|
||||
if (obj) {
|
||||
for (var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
|
||||
obj = obj[path[i]];
|
||||
};
|
||||
return obj;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user