From 01381807bdbafea57d193c14eda82905082ccc97 Mon Sep 17 00:00:00 2001 From: Ricard Mallafre Date: Tue, 17 Jan 2023 05:39:30 +0100 Subject: [PATCH] Fix TypeScript types (#13) --- index.d.ts | 4 ++-- index.test-d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9545005..9276ea5 100644 --- a/index.d.ts +++ b/index.d.ts @@ -12,7 +12,7 @@ declare const lcid: { //=> 'nb_NO' ``` */ - from(lcidCode: number): string; + from(lcidCode: number): string | undefined; /** Get a [Windows locale identifier (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) from a [standard locale identifier](https://en.wikipedia.org/wiki/Locale_(computer_software)). @@ -25,7 +25,7 @@ declare const lcid: { //=> 1044 ``` */ - to(localeId: string): number; + to(localeId: string): number | undefined; /** Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](https://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms). diff --git a/index.test-d.ts b/index.test-d.ts index d9f9901..1792783 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -2,7 +2,7 @@ import {expectType} from 'tsd'; import lcid = require('.'); import lcidJson = require('./lcid.json'); -expectType(lcid.to('nb_NO')); -expectType(lcid.from(1044)); +expectType(lcid.to('nb_NO')); +expectType(lcid.from(1044)); expectType<{readonly [key: string]: string}>(lcid.all); expectType<{readonly [key: string]: string}>(lcidJson);