Skip to content
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

[Snippets] Added some helper types for Typescript #239

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

aelshinawy
Copy link
Contributor

Description

I added 10 handy Typescript helper types

1. At Least One Key
  Ensures that at least one property of an object is required.
2. Deep Partial Type
  Converts all properties of a type, including nested objects, into optional.
3. Deep Read-only Type
  Converts all properties of a type, including nested objects, into readonly.
4. Deep Required Type
  Converts all properties of a type, including nested objects, into required.
5. Keys of Type
  Extracts keys from an object type that match a specified value type.
6. Keys to Optional
  Makes only the specified keys of an object type optional.
7. Nullable Keys
  Extracts keys from an object type that allow null or undefined values.
8. Omit Keys of Type
  Removes keys of a specified type from an object type.
9. Required Keys
  Extracts required keys from an object.
10. Union to Intersection
  Converts a union type into an intersection type.

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

Copy link
Collaborator

@Mathys-Gasnier Mathys-Gasnier left a comment

Choose a reason for hiding this comment

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

Great work !

@Mathys-Gasnier Mathys-Gasnier merged commit df7dcbf into dostonnabotov:main Jan 26, 2025
4 checks passed
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