window.lofig = { folder: 'config/default.json', get: query => { return fetch(lofig.folder) .then(response => { return response.json(); }).then(json => { query.split('.') .forEach(property => { json = json[property]; }); return json; }).catch(err => { console.log('parsing failed', err); }); }, has: query => { return fetch(lofig.folder) .then(response => { return response.json(); }).then(json => { query.split('.') .forEach(property => { json = json[property]; }); return json; }).catch(err => { console.log('parsing failed', err); }); } };