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

Add concerns #6

Merged
merged 424 commits into from
Mar 5, 2024
Merged

Add concerns #6

merged 424 commits into from
Mar 5, 2024

Conversation

aedart
Copy link
Owner

@aedart aedart commented Mar 5, 2024

Adds "concerns" submodule in @aedart/support, which offer an alternative to mixins. The mechanism is heavily inspired by PHP's traits, traditional JavaScript mixins and a few concepts from dependency injection.

Furthermore, in order to develop this feature / submodule, several reflection-like utilities have been added, all of which are documented in the docs directory.

Details

Details are available in the CHANGELOG.md and in the docs.

aedart and others added 30 commits February 19, 2024 16:43
Took a bit of tinkering to find a good enough way to decide when to convert values into an array. However, it a nutshell this should be fine for most use-cases. Anything beyond that, the developer must provide own merge callback.
Will now invoke clone() method and use resulting object to merge.
IDE / TypeScript complained about these being nullable, which is true - but in practice these should never result in null values.
Refactored to allow developers to disable the cloneable behavior.
Previous version was named isWeakrefereneKind()
This is so much cleaner to read - even though a bit complex. Module functions should be small, and not contain too many exports, so this way developers can freely extend the new Objects Merger and create their own merge util method(s).
Regardless of what keys might be provided, dangerous keys should always be skipped. Developers should not be allowed to circumvent this - at least not in any easy way!
@aedart aedart added the enhancement New feature or request label Mar 5, 2024
@aedart aedart self-assigned this Mar 5, 2024
@aedart aedart merged commit 00d2163 into main Mar 5, 2024
2 checks passed
@aedart aedart deleted the add-concerns branch March 5, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant