Improve performance of mock tests

This commit is contained in:
Jamie Kyle 2024-02-29 14:01:12 -08:00 committed by GitHub
parent ea9a7385d6
commit 9c072c5bc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 18 additions and 64 deletions

View file

@ -8,7 +8,6 @@ import type { FormatXMLElementFn } from 'intl-messageformat';
import type { LocalizerType } from '../types/Util';
import type { ReplacementValuesType } from '../types/I18N';
import * as log from '../logging/log';
import { strictAssert } from '../util/assert';
export type FullJSXType =
| FormatXMLElementFn<JSX.Element | string>
@ -36,16 +35,6 @@ export function Intl({
return null;
}
strictAssert(
!localizer.isLegacyFormat(id),
`Legacy message format is no longer supported ${id}`
);
strictAssert(
!Array.isArray(components),
`components cannot be an array for ICU message ${id}`
);
const intl = localizer.getIntl();
return <>{intl.formatMessage({ id }, components, {})}</>;
}