Skip to content

Commit 8c239fb

Browse files
committed
v1.2.1: Fix types
1 parent cede78e commit 8c239fb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@eartharoid/i18n",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Simple and lightweight message localisation",
55
"main": "dist/index.js",
66
"types": "types.d.ts",

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = class I18n {
8484
* @returns {(message: string, ...args: MessageArgs) => string | undefined}
8585
*/
8686
public getLocale(
87-
locale: string | undefined = this.default_locale
87+
locale: string = this.default_locale
8888
): (message: string, ...args: MessageArgs) => string | undefined {
8989
return (message: string, ...args: MessageArgs) => this.getMessage(locale, message, ...args);
9090
}
@@ -97,7 +97,7 @@ module.exports = class I18n {
9797
* @returns {string|undefined}
9898
*/
9999
public getMessage(
100-
locale: string | undefined = this.default_locale,
100+
locale: string = this.default_locale,
101101
message: string,
102102
...args: MessageArgs
103103
): string | undefined {

types.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ declare module '@eartharoid/i18n' {
3232
) => Messages;
3333

3434
public getLocale: (
35-
locale: string | undefined
35+
locale?: string
3636
) => (message: string, ...args: MessageArgs) => string | undefined;
3737

3838
public getMessage: (
39-
locale: string | undefined,
39+
locale: string | null | undefined,
4040
message: string,
4141
...args: MessageArgs
4242
) => string | undefined;

0 commit comments

Comments
 (0)