Skip to content

Allow setting fixed first properties to be sorted first #860

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thodor12
Copy link

Add a new option called xmlSortAttributesFirst, this allows to sort attributes in a fixed way.
For example if I were to have an id field on my XML and I always want this attribute to be sorted first, I can put xmlSortAttributesFirst: ["id"] to force this property to come first.

The attributes in this list are sorted in the order they are listed, even if certain are not present.

I've added 2 tests to ensure the functionality works as intended.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant