Skip to content

2022 03 30 Sort package member

Sebastien edited this page Mar 30, 2022 · 1 revision

2022 03 30 Sort package member

  • Status: accepted
  • Date: 2022-03-30

Technical Story: #279

Context and Problem Statement

Issue where raised #278 about having a different package member order when executing the command on Windows vs Linux

The code were sorting using sort() without passing comparison method.

Decision Drivers

  • sort consistently accross environment
  • performance

Considered Options

  • use Intl.Compare
  • use localeCompare

Decision Outcome

Chosen option: "use Ìntl.Compare", because it is better in term of performance, more portable and it handles the locale as localeCompare`.

Positive Consequences

  • Package member generation is consistent
  • Issue is fixed

Negative Consequences

None

Pros and Cons of the Options

use Intl.Compare

  • Good, because it has better performance
  • Good, because it is more portable
  • Good, because of locale handling

use localeCompare

  • Good, because of locale handling
  • Bad, because of portability
  • Bad, because of performance

Links