Skip to content

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