mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
* more friday any/type assertion improvements * Apply suggestions from code review Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> * Update public/app/angular/promiseToDigest.test.ts Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com> Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
15 lines
356 B
TypeScript
15 lines
356 B
TypeScript
export function assignModelProperties(
|
|
target: Record<string, unknown>,
|
|
source: Record<string, unknown>,
|
|
defaults: Record<string, unknown>,
|
|
removeDefaults?: undefined
|
|
) {
|
|
for (const key in defaults) {
|
|
if (!defaults.hasOwnProperty(key)) {
|
|
continue;
|
|
}
|
|
|
|
target[key] = source[key] === undefined ? defaults[key] : source[key];
|
|
}
|
|
}
|