Skip to content

Conversation

@sciborrudnicki
Copy link
Contributor

@sciborrudnicki sciborrudnicki commented Aug 14, 2025

AccessorDescriptor

  • Add generic C - configurable and E - enumerable to CommonDescriptor.
  • Change the generic names Object to O, PropertyName to K, Value to V and add C, and E in the AccessorDescriptor.
  • Check get and set against function type in AccessorDescriptor.guard() static method.
  • Add static create() method to create a new instance of AccessorDescriptor.
  • Change the param onGuard to onValidate in define static method in AccessorDescriptor.

DataDescriptor

  • Change the generic type variable Value to V, and add O object, K object key C, E, and W.
  • Add static create() method to create a new instance of DataDescriptor.
  • Add onValidate param in the constructor to validate the data descriptor.

Descriptor

  • Change the generic type variable Value to V, Object to O object, PropertyName to K object key, and add C, E, and W.
  • Add static create() method to create a new instance of Descriptor.
  • Add generic type variables to static define() , defineAccessor(), defineData(), and guard() methods.

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.
…` assignments, return void iin the `get` if enabled === false, remove the use of `Object.assign` in the `set`.
…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.
@sciborrudnicki sciborrudnicki requested a review from Copilot August 14, 2025 17:04
Copy link

Copilot AI left a 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.

@sciborrudnicki sciborrudnicki merged commit 1b611dc into main Aug 14, 2025
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