From 9dbca95dbdf4d9b2ba4b0a5e603d9373eeba1642 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 21:59:19 +0200 Subject: [PATCH 1/3] Node-Polyglot: Added method has to interface --- types/node-polyglot/index.d.ts | 2 ++ types/node-polyglot/node-polyglot-tests.ts | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index 7587f77640..dac678b7c6 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -38,6 +38,8 @@ declare class Polyglot { locale(): string; locale(locale: string): void; + + has(phrase: string): boolean; } export = Polyglot; diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index bfb18339c0..0c84a3dea1 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -46,7 +46,10 @@ function translate(): void { polyglot.t("i_like_to_write_in_language", { _: "I like to write in %{language}.", language: "Javascript" - }); + }); + + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey", From 7a85f1ee36d7fad06041c1f83a8f57e40bc789fd Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 22:02:39 +0200 Subject: [PATCH 2/3] Bumped version --- types/node-polyglot/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-polyglot/index.d.ts b/types/node-polyglot/index.d.ts index dac678b7c6..3133def496 100644 --- a/types/node-polyglot/index.d.ts +++ b/types/node-polyglot/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for node-polyglot v0.4.1 +// Type definitions for node-polyglot v0.4.2 // Project: https://github.com/airbnb/polyglot.js // Definitions by: Tim Jackson-Kiely // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0ebbe5bd157a8aeffdd10eb1dd45cdf796d28060 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 29 Mar 2018 22:13:15 +0200 Subject: [PATCH 3/3] Added tabs again --- types/node-polyglot/node-polyglot-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/node-polyglot/node-polyglot-tests.ts b/types/node-polyglot/node-polyglot-tests.ts index 0c84a3dea1..14efa8ad30 100644 --- a/types/node-polyglot/node-polyglot-tests.ts +++ b/types/node-polyglot/node-polyglot-tests.ts @@ -46,10 +46,10 @@ function translate(): void { polyglot.t("i_like_to_write_in_language", { _: "I like to write in %{language}.", language: "Javascript" - }); + }); - polyglot.has("hello"); - polyglot.has("world"); + polyglot.has("hello"); + polyglot.has("world"); polyglot.replace({ "hello": "hey",