mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-02 12:16:06 -04:00
17 lines
336 B
JavaScript
17 lines
336 B
JavaScript
export function useData() {
|
|
function getData(name, key) {
|
|
let obj = window[name];
|
|
|
|
return key.split(".").reduce((o, k) => {
|
|
if (o && typeof o === 'object' && k in o) {
|
|
return o[k];
|
|
}
|
|
|
|
return undefined;
|
|
}, obj);
|
|
}
|
|
|
|
return {
|
|
getData,
|
|
};
|
|
} |