Units: support farenheit (existing misspelling) (#21249)
(cherry picked from commit af2cd77655)
This commit is contained in:
committed by
Andrej Ocenas
parent
a8707bbc0e
commit
54044155a5
@@ -53,4 +53,12 @@ describe('valueFormats', () => {
|
||||
expect(str).toBe('1.200 s');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Resolve old units', () => {
|
||||
it('resolve farenheit', () => {
|
||||
const fmt0 = getValueFormat('farenheit');
|
||||
const fmt1 = getValueFormat('fahrenheit');
|
||||
expect(fmt0).toEqual(fmt1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -142,6 +142,14 @@ function buildFormats() {
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve units pointing to old IDs
|
||||
[{ from: 'farenheit', to: 'fahrenheit' }].forEach(alias => {
|
||||
const f = index[alias.to];
|
||||
if (f) {
|
||||
index[alias.from] = f;
|
||||
}
|
||||
});
|
||||
|
||||
hasBuiltIndex = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user