-
-
Notifications
You must be signed in to change notification settings - Fork 0
v1.0.0 #2
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
v1.0.0 #2
Conversation
Expands type parameterization in the data descriptor class to support configurability, enumerability, and writability as generic types. Enables more precise type inference and usage in complex scenarios.
… of generic type variables., use `StrictPropertyDescriptor` instead of any.
…static `guard()`, validate on instantiation, update docs.
…static `create()`. Add `K` and `V` generic.
…tor`, set properly generic type variables for extended descriptor.
…ertyDescriptor` instead of strict, and update docs.
…ned by `ThisAccessorPropertyDescriptor`, and update docs.
…for chaining, remove `constructor()`.
…and add `index` to descriptor.
…rrentIndex()` method. Update docs.
…ntIndex()` instance method.
…` assignments, return void iin the `get` if enabled === false, remove the use of `Object.assign` in the `set`.
…ed object and key.
…pe of `get` and `set` in guard, update documentation.
…update the static `from()` method generic type variable, add `create()` static method, change the `pick()` static method param name to `object`. Update documentation.
… the `constructor`.
…r` and its assignation.
… the `constructor`.
…of the attributes in the `constructor`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR releases version 1.0.0 with major refactoring of the property descriptor classes to enhance type safety and generics. The changes introduce more specific generic type parameters, add new static factory methods, and improve validation logic.
- Refactored generic type parameters to use single letters (O, K, V, C, E, W) for better consistency
- Added static
create()methods to descriptor classes for instance creation - Enhanced validation with stricter type checking and improved guard methods
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib/accessor-descriptor.class.ts |
Enhanced with new generics, added create/define methods, improved guard validation |
src/lib/data-descriptor.class.ts |
Updated generics, added create method, enhanced constructor validation |
src/lib/descriptor.class.ts |
Major refactoring with new generics, added create/define methods, improved type safety |
src/lib/common-descriptor.abstract.ts |
Added generic type parameters for configurable and enumerable properties |
src/test/*.spec.ts |
Updated test files to use new APIs and Person class |
package.json |
Updated peer dependencies to stable versions |
README.md |
Updated documentation with new features and support information |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
AccessorDescriptorC- configurable andE- enumerable toCommonDescriptor.ObjecttoO,PropertyNametoK,ValuetoVand addC, andEin theAccessorDescriptor.getandsetagainstfunctiontype inAccessorDescriptor.guard()static method.static create()method to create a new instance ofAccessorDescriptor.onGuardtoonValidateindefinestatic method inAccessorDescriptor.DataDescriptorValuetoV, and addOobject,Kobject keyC,E, andW.static create()method to create a new instance ofDataDescriptor.onValidateparam in theconstructorto validate the data descriptor.DescriptorValuetoV,ObjecttoOobject,PropertyNametoKobject key, and addC,E, andW.static create()method to create a new instance ofDescriptor.staticdefine(),defineAccessor(),defineData(), andguard()methods.