Skip to content

Commit

Permalink
fix: add string return type to i18n._ (#1081)
Browse files Browse the repository at this point in the history
Co-authored-by: Tanner Lyons <tanner.lyons@smartsheet.com>
  • Loading branch information
tannerlyons and Tanner Lyons committed Jun 9, 2021
1 parent 8e6b07c commit 68d32d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class I18n extends EventEmitter<Events> {


// hack for parsing unicode values inside a string to get parsed in react native environments
if (isString(translation) && /\\u[a-fA-F0-9]{4}/g.test(translation)) return JSON.parse(`"${translation}"`)
if (isString(translation) && /\\u[a-fA-F0-9]{4}/g.test(translation)) return JSON.parse(`"${translation}"`) as string;
if (isString(translation)) return translation

return interpolate(
Expand Down

1 comment on commit 68d32d6

@vercel
Copy link

@vercel vercel bot commented on 68d32d6 Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.