Skip to content

Commit

Permalink
Change withFeatureCheck() return value to also include `PromiseLike…
Browse files Browse the repository at this point in the history
…<T>` as an anticipation
  • Loading branch information
faisalman committed Oct 29, 2024
1 parent 9890f9f commit aad163f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/ua-parser.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ declare namespace UAParser {
is(val: string): boolean;
toString(): string;
withClientHints(): PromiseLike<T> | T;
withFeatureCheck(): T;
withFeatureCheck(): PromiseLike<T> | T;
}

interface IBrowser extends IData<IBrowser> {
Expand Down
4 changes: 2 additions & 2 deletions test/dts-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ expectType<'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | '
expectType<boolean>(browser.is(''));
expectType<string>(browser.toString());
expectType<IBrowser | PromiseLike<IBrowser>>(browser.withClientHints());
expectType<IBrowser>((<IBrowser>browser.withClientHints()).withFeatureCheck());
expectType<boolean>((<IBrowser>browser.withClientHints()).withFeatureCheck().is(''));
expectType<IBrowser | PromiseLike<IBrowser>>((<IBrowser>browser.withClientHints()).withFeatureCheck());
expectType<boolean>((<IBrowser>(<IBrowser>browser.withClientHints()).withFeatureCheck()).is(''));

expectType<ICPU>(parser.getCPU());
expectType<IDevice>(parser.getDevice());
Expand Down

0 comments on commit aad163f

Please sign in to comment.