Skip to content

Type predicate missing on isOrderedSet function type declaration #1947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andyk opened this issue Aug 1, 2023 · 0 comments · Fixed by #1948
Closed

Type predicate missing on isOrderedSet function type declaration #1947

andyk opened this issue Aug 1, 2023 · 0 comments · Fixed by #1948

Comments

@andyk
Copy link

andyk commented Aug 1, 2023

What happened

The type definition for the type guard function isOrderedSet inside is missing the is OrderedSet<unknown> type predicate here inside the namespace OrderedSet

function isOrderedSet(maybeOrderedSet: unknown): boolean;

The type predicated exists on the ValueObject definition of the function, as you can see here:

function isOrderedSet(
maybeOrderedSet: unknown
): maybeOrderedSet is OrderedSet<unknown>;

Seems like a small oversight and quick fix?

I checked that other guards do have the type predicate in both declarations, e.g. OrderedMap:

function isOrderedMap(
maybeOrderedMap: unknown
): maybeOrderedMap is OrderedMap<unknown, unknown>;

function isOrderedMap(
maybeOrderedMap: unknown
): maybeOrderedMap is OrderedMap<unknown, unknown>;

How to reproduce

@andyk andyk changed the title Type predicate missing on isOrderedSet function declaration Type predicate missing on isOrderedSet function type declaration Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants