-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add concerns #6
Conversation
This file contains 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
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.
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!
Also, extracted each util function into own page. This was needed because some of the submodule docs where getting very large and unmaintainable.
Also, fixed shown results for isKeyUnsafe() - ups!
Also, corrected the custom merge callback example. Now showing how to provide as "callback: ..." option, as well as the shorthand version.
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.
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.