From 56759bf3f8e12ac07ebeebf313971bd04a8af53b Mon Sep 17 00:00:00 2001 From: Tao Cumplido Date: Wed, 15 Dec 2021 10:45:00 +0100 Subject: [PATCH] update es2020.intl DisplayNames#of fix return type of Intl.DisplayNames.prototype.of was typed to return always string but can actually return undefined too see spec https://tc39.es/ecma402/#sec-Intl.DisplayNames.prototype.of --- src/lib/es2020.intl.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2020.intl.d.ts b/src/lib/es2020.intl.d.ts index f0938eca850f9..67decfeae4570 100644 --- a/src/lib/es2020.intl.d.ts +++ b/src/lib/es2020.intl.d.ts @@ -299,7 +299,7 @@ declare namespace Intl { * * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/of). */ - of(code: string): string; + of(code: string): string | undefined; /** * Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current * [`Intl/DisplayNames`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames) object.