Commit af2cd776 by Ryan McKinley Committed by GitHub

Units: support farenheit (existing misspelling) (#21249)

parent e031cbb1
...@@ -123,4 +123,12 @@ describe('valueFormats', () => { ...@@ -123,4 +123,12 @@ describe('valueFormats', () => {
expect(str).toBe('186'); expect(str).toBe('186');
}); });
}); });
describe('Resolve old units', () => {
it('resolve farenheit', () => {
const fmt0 = getValueFormat('farenheit');
const fmt1 = getValueFormat('fahrenheit');
expect(fmt0).toEqual(fmt1);
});
});
}); });
...@@ -164,6 +164,14 @@ function buildFormats() { ...@@ -164,6 +164,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; hasBuiltIndex = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment