From 41d8e4d28b68bb0ec61f2adf3152025086c1cc7c Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Wed, 10 Feb 2021 21:22:48 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20default=20$json=20type=20?= =?UTF-8?q?to=20any?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Formatting.md | 10 ---------- src/runtime/stores/formatters.ts | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/Formatting.md b/docs/Formatting.md index 2d3f858..a68e09b 100644 --- a/docs/Formatting.md +++ b/docs/Formatting.md @@ -142,16 +142,6 @@ Returns the raw JSON value of the specified `messageId` for the current locale. ``` -If you're using TypeScript, you can define the returned type as well: - -```html - -``` - ### Formats `svelte-i18n` comes with a default set of `number`, `time` and `date` formats: diff --git a/src/runtime/stores/formatters.ts b/src/runtime/stores/formatters.ts index 2645db4..d580527 100644 --- a/src/runtime/stores/formatters.ts +++ b/src/runtime/stores/formatters.ts @@ -82,7 +82,7 @@ const formatNumber: NumberFormatter = (n, options) => { return getNumberFormatter(options).format(n); }; -const getJSON: JSONGetter = (id: string, locale = getCurrentLocale()) => { +const getJSON: JSONGetter = (id: string, locale = getCurrentLocale()) => { return lookup(id, locale) as T; };