mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
18 lines
421 B
JavaScript
18 lines
421 B
JavaScript
/**
|
|
* Generic config storage object
|
|
*/
|
|
|
|
export function buildConfig(defaultConfigs = {}) {
|
|
const storage = Object.assign({}, defaultConfigs);
|
|
|
|
return new Proxy(storage, {
|
|
get(target, propName) {
|
|
if (propName in target) {
|
|
return target[propName];
|
|
} else {
|
|
console.warn("Requested missing config prop", propName);
|
|
}
|
|
},
|
|
});
|
|
}
|