Skip to content

Commit

Permalink
style(linting): apply linting
Browse files Browse the repository at this point in the history
  • Loading branch information
xibman committed Dec 11, 2024
1 parent f0989a3 commit d979802
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/runtime/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { Composer } from 'vue-i18n'

export function joinValues<T>(array: T[], separator = ' | '): string {
return array.map(val => (typeof val === 'string' ? `'${val}'` : val)).join(separator)
return array
.map(val => (typeof val === 'string' ? `'${val}'` : val))
.join(separator)
}

export function jsonStringifyReplacer<T>(_: string, value: T): T | string {
Expand Down Expand Up @@ -40,13 +42,14 @@ export function getKeyAndValues(
}

if (isRecord(param)) {
const key = 'key' in param && typeof param.key === 'string' ? param.key : defaultKey
const key
= 'key' in param && typeof param.key === 'string' ? param.key : defaultKey
const values
= 'values' in param && isRecord(param.values)
? Object.entries(param.values).reduce((acc, [key, value]) => {
acc = { ...acc, [key]: t(value as string) }
return acc
}, {})
acc = { ...acc, [key]: t(value as string) }
return acc
}, {})
: {}

return { key, values }
Expand Down

0 comments on commit d979802

Please sign in to comment.