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

Export deepEqual and UnorderedArray as part of the utils namespace #60

Merged
merged 3 commits into from
Jan 10, 2024

Conversation

pipex
Copy link
Collaborator

@pipex pipex commented Jan 8, 2024

The deepEqual function is a key piece of how the distance to a target is calculated, as it allows to compare between the current and target state. This function is flexible to allow users to define their own comparison operations by providing an equals function on their models.

This function may also come handy for users of the library, so we export it as part of the mahler/utils namespace

We also export a new type UnorderedArray that can be used as part of the data model to indicate the planner that array comparison should not take into account the order of elements when comparing state.

Change-type: minor

@flowzone-app flowzone-app bot enabled auto-merge January 8, 2024 21:09
pipex added 2 commits January 10, 2024 10:52
The `deepEqual` function is a key piece of how the distance to a target
is calculated, as it allows to compare between the current and target
state. This function is flexible to allow users to define their own
comparison operations by providing an `equals` function on their models.

This function may also come handy for users of the library, so we export
it as part of the `mahler/utils` namespace

Change-type: minor
@pipex pipex changed the title Export deepEqual as part of the utils namespace Export deepEqual and UnorderedArray as part of the utils namespace Jan 10, 2024
This is helpful for including lists of items in a state model but
changes in the array order should not be considered as a state change.

Change-type: minor
@pipex
Copy link
Collaborator Author

pipex commented Jan 10, 2024

I self-certify!

@flowzone-app flowzone-app bot merged commit 73d9365 into main Jan 10, 2024
48 checks passed
@flowzone-app flowzone-app bot deleted the deep-equal branch January 10, 2024 20:34
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.

1 participant