Skip to content

feat(shared): valita methods for working directly with AbstractTypes#2899

Merged
darkgnotic merged 4 commits intomainfrom
darkgnotic/advanced-valita
Nov 1, 2024
Merged

feat(shared): valita methods for working directly with AbstractTypes#2899
darkgnotic merged 4 commits intomainfrom
darkgnotic/advanced-valita

Conversation

@darkgnotic
Copy link
Contributor

@darkgnotic darkgnotic commented Nov 1, 2024

i.e. Optional

This will facilitate more esoteric valita usage such as #2894

@darkgnotic darkgnotic requested a review from arv November 1, 2024 19:17
@vercel
Copy link

vercel bot commented Nov 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 7:25pm
zbugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2024 7:25pm

}

// eslint-disable-next-line @typescript-eslint/naming-convention
const AbstractType = Object.getPrototypeOf(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could also export this directly (and remove the instanceOfAbstractType() method) if you think that's better.

lmk.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe export a isAbstractType(v: unknown): v is AbstractType since that is what we actually want to test.

We could maybe even upstream something like that.

Copy link
Contributor

@arv arv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

// eslint-disable-next-line @typescript-eslint/naming-convention
const AbstractType = Object.getPrototypeOf(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe export a isAbstractType(v: unknown): v is AbstractType since that is what we actually want to test.

We could maybe even upstream something like that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments