grafana/public/app/core/utils/model_utils.ts

10 lines
260 B
TypeScript
Raw Normal View History

export function assignModelProperties(target, source, defaults, removeDefaults?) {
2018-08-29 07:26:50 -05:00
for (const key in defaults) {
if (!defaults.hasOwnProperty(key)) {
continue;
}
target[key] = source[key] === undefined ? defaults[key] : source[key];
}
}