Adds type safety for schema roles and refines generic signatures#75
Open
montmorill wants to merge 4 commits intoshigma:mainfrom
Open
Adds type safety for schema roles and refines generic signatures#75montmorill wants to merge 4 commits intoshigma:mainfrom
montmorill wants to merge 4 commits intoshigma:mainfrom
Conversation
Introduces a `Roles` interface to define valid role strings for each schema type, enforcing type safety when setting the `role` meta property. Updates the `Schema` generic to include a `Type` parameter, allowing the `meta.role` to be constrained to the specific roles permitted for that schema type. This prevents invalid role assignments and improves developer experience with better IDE autocompletion and error checking.
Corrects inconsistent indentation in commented-out code block to maintain consistent formatting throughout the file.
Standardizes code style by removing extraneous semicolons and fixing indentation in array iteration and property assignment patterns
The explicit type cast was redundant as TypeScript can infer the correct return type from the function implementation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a
Rolesinterface to define valid role strings for each schema type, enforcing type safety when setting therolemeta property. Updates theSchemageneric to include aTypeparameter, allowing themeta.roleto be constrained to the specific roles permitted for that schema type. This prevents invalid role assignments and improves developer experience with better IDE autocompletion and error checking.