Skip to content

Commit

Permalink
fix(lint): fix ts-lint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Aug 7, 2019
1 parent 43f37b0 commit 20ca5be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fluent-vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class FluentVue {
format(key: string, value?: object): string {
const message = this.options.bundle.getMessage(key)

if (message == null || message.value == null) {
if (message === undefined) {
warn(false, `Could not find translation for key [${key}]`)
return key
}
Expand Down
6 changes: 3 additions & 3 deletions src/types/fluend.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ declare module '@fluent/bundle' {
class Pattern {}

class MessageInfo {
value: Pattern | null
value: Pattern
attributes: Record<string, Pattern>
}

export class FluentBundle {
constructor(locales: string | string[], options?: FluentBundleContructorOptions)
locales: string[]
hasMessage(id: string): boolean
getMessage(id: string): MessageInfo
formatPattern(message: Pattern | null, args?: object, errors?: Array<string | Error>): string
getMessage(id: string): MessageInfo | undefined
formatPattern(message: Pattern, args?: object, errors?: Array<string | Error>): string
addResource(res: FluentResource): string[]
}
}

0 comments on commit 20ca5be

Please sign in to comment.