From 01f693c75dc8fbb4e42f2ecbcd837f70e6c6ee9f Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 29 Aug 2020 08:39:25 +0800 Subject: [PATCH] fix test implementation of function `t` --- types.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types.ts b/types.ts index a9715d2..7c278c2 100644 --- a/types.ts +++ b/types.ts @@ -21,8 +21,10 @@ export let site_name = 'Blessing Skin' export let version: string export let route: string -export function t(key: string, params?: object) { - return `${key}(${JSON.stringify(params)})` +export function t(key: string, params?: object): string { + const data = params ? `(${JSON.stringify(params)})` : '' + + return key + data } export const fetch = {