Use equals helper
This commit is contained in:
parent
6b4258e724
commit
2393521d37
|
@ -10,29 +10,16 @@ import API from '../utils/api';
|
|||
import { Disposable } from '../utils/dispose';
|
||||
import * as fileSchemes from '../utils/fileSchemes';
|
||||
import { isTypeScriptDocument } from '../utils/languageModeIds';
|
||||
import { equals } from '../utils/objects';
|
||||
import { ResourceMap } from '../utils/resourceMap';
|
||||
|
||||
|
||||
function objsAreEqual<T>(a: T, b: T): boolean {
|
||||
let keys = Object.keys(a);
|
||||
for (const key of keys) {
|
||||
if ((a as any)[key] !== (b as any)[key]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
interface FileConfiguration {
|
||||
readonly formatOptions: Proto.FormatCodeSettings;
|
||||
readonly preferences: Proto.UserPreferences;
|
||||
}
|
||||
|
||||
function areFileConfigurationsEqual(a: FileConfiguration, b: FileConfiguration): boolean {
|
||||
return (
|
||||
objsAreEqual(a.formatOptions, b.formatOptions)
|
||||
&& objsAreEqual(a.preferences, b.preferences)
|
||||
);
|
||||
return equals(a, b);
|
||||
}
|
||||
|
||||
export default class FileConfigurationManager extends Disposable {
|
||||
|
|
Loading…
Reference in a new issue