mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* First stab at new page layouts behind feature toggle * Simplifying PageHeader * Progress on a new model that can more easily support new and old page layouts * Progress * rename folder * Progress * Minor change * fixes * Fixing tests * Make breadcrumbs work * Add tests for old Page component * Adding tests for new Page component and behavior * fixing page header test * Fixed test * AppChrome outside route * Renaming folder * Minor fix * Updated * Fixing StoragePage * Fix for banners Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
30 lines
592 B
TypeScript
30 lines
592 B
TypeScript
// From https://github.com/streamich/fast-shallow-equal
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
export function isShallowEqual(a: any, b: any) {
|
|
if (a === b) {
|
|
return true;
|
|
}
|
|
|
|
if (!(a instanceof Object) || !(b instanceof Object)) {
|
|
return false;
|
|
}
|
|
|
|
var keys = Object.keys(a);
|
|
var length = keys.length;
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
if (!(keys[i] in b)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
if (a[keys[i]] !== b[keys[i]]) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return length === Object.keys(b).length;
|
|
}
|