Skip to content

Commit aed19a2

Browse files
committed
fix(react-intl): use indexOf instead of includes
1 parent 245301f commit aed19a2

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/react-intl/examples/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ ts_project(
3333
declaration_map = True,
3434
extends = "//:tsconfig.json",
3535
out_dir = "lib",
36+
resolve_json_module = True,
3637
tsconfig = "//:tsconfig.esm.json",
37-
resolve_json_module=True,
3838
deps = SRC_DEPS,
3939
)
4040

packages/react-intl/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const FormattedTime: React.FC<
7373
value: string | number | Date | undefined
7474
}
7575
> = createFormattedComponent('formatTime')
76+
// @ts-ignore issue w/ TS Intl types
7677
export const FormattedNumber: React.FC<
7778
NumberFormatOptions &
7879
CustomFormatConfig & {

packages/react-intl/src/components/relative.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const INCREMENTABLE_UNITS: RelativeTimeFormatSingularUnit[] = [
7878
function canIncrement(
7979
unit: RelativeTimeFormatSingularUnit = 'second'
8080
): boolean {
81-
return INCREMENTABLE_UNITS.includes(unit)
81+
return INCREMENTABLE_UNITS.indexOf(unit) > -1
8282
}
8383

8484
const SimpleFormattedRelativeTime: React.FC<

0 commit comments

Comments
 (0)