Skip to content

Commit

Permalink
v1.2.1: Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
eartharoid committed Oct 26, 2022
1 parent cede78e commit 8c239fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eartharoid/i18n",
"version": "1.2.0",
"version": "1.2.1",
"description": "Simple and lightweight message localisation",
"main": "dist/index.js",
"types": "types.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module.exports = class I18n {
* @returns {(message: string, ...args: MessageArgs) => string | undefined}
*/
public getLocale(
locale: string | undefined = this.default_locale
locale: string = this.default_locale
): (message: string, ...args: MessageArgs) => string | undefined {
return (message: string, ...args: MessageArgs) => this.getMessage(locale, message, ...args);
}
Expand All @@ -97,7 +97,7 @@ module.exports = class I18n {
* @returns {string|undefined}
*/
public getMessage(
locale: string | undefined = this.default_locale,
locale: string = this.default_locale,
message: string,
...args: MessageArgs
): string | undefined {
Expand Down
4 changes: 2 additions & 2 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ declare module '@eartharoid/i18n' {
) => Messages;

public getLocale: (
locale: string | undefined
locale?: string
) => (message: string, ...args: MessageArgs) => string | undefined;

public getMessage: (
locale: string | undefined,
locale: string | null | undefined,
message: string,
...args: MessageArgs
) => string | undefined;
Expand Down

0 comments on commit 8c239fb

Please sign in to comment.