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

Some keys are being excluded during order #239

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JoshMcCullough
Copy link

@JoshMcCullough JoshMcCullough commented Oct 4, 2023

This PR adds a test to illustrate the problem but does not (yet) provide a fix.

Note that the expectObject function in __tests__/order.test.ts was not failing due to the expected object having keys in the wrong order. The first commit here fixes that.

The issue here appears to be that the key I was testing with contained a ., which is also the separator being used. This highlights an issue with the way the order-map is constructed. If any key ever contains the separator, then that key is not going to be included in the final object. Perhaps the solution here is to structure the order-map like an actual object, thereby alleviating the need for a separator:

{
  key1: [ "key1a", "key1b" ],
  key2: {
    key2a: [ "key2a1", ... ],
    key2b: {
      key2b1: ...
    }
  }
}

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