Skip to content

Commit

Permalink
Fix TypeScript types (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikensss authored Jan 17, 2023
1 parent ae02d7f commit 0138180
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)).
Expand All @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {expectType} from 'tsd';
import lcid = require('.');
import lcidJson = require('./lcid.json');

expectType<number>(lcid.to('nb_NO'));
expectType<string>(lcid.from(1044));
expectType<number | undefined>(lcid.to('nb_NO'));
expectType<string | undefined>(lcid.from(1044));
expectType<{readonly [key: string]: string}>(lcid.all);
expectType<{readonly [key: string]: string}>(lcidJson);

0 comments on commit 0138180

Please sign in to comment.