Skip to content

Commit 20ca5be

Browse files
committed
fix(lint): fix ts-lint warning
1 parent 43f37b0 commit 20ca5be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/fluent-vue.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class FluentVue {
1313
format(key: string, value?: object): string {
1414
const message = this.options.bundle.getMessage(key)
1515

16-
if (message == null || message.value == null) {
16+
if (message === undefined) {
1717
warn(false, `Could not find translation for key [${key}]`)
1818
return key
1919
}

src/types/fluend.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ declare module '@fluent/bundle' {
2828
class Pattern {}
2929

3030
class MessageInfo {
31-
value: Pattern | null
31+
value: Pattern
3232
attributes: Record<string, Pattern>
3333
}
3434

3535
export class FluentBundle {
3636
constructor(locales: string | string[], options?: FluentBundleContructorOptions)
3737
locales: string[]
3838
hasMessage(id: string): boolean
39-
getMessage(id: string): MessageInfo
40-
formatPattern(message: Pattern | null, args?: object, errors?: Array<string | Error>): string
39+
getMessage(id: string): MessageInfo | undefined
40+
formatPattern(message: Pattern, args?: object, errors?: Array<string | Error>): string
4141
addResource(res: FluentResource): string[]
4242
}
4343
}

0 commit comments

Comments
 (0)