theo icon indicating copy to clipboard operation
theo copied to clipboard

Use OrderedMap to maintain YML input file props order.

Open tomger opened this issue 5 years ago • 1 comments

In our token setup the order of the YML props has a meaning. e.g. colors are grouped by hue.

As far as I can tell without this patch the order of the output is nondeterministic/scrambled. This is because Immutable.fromJS, at least in our case, converts the input JS array into a non-ordered Map instead of an OrderedMap.

Example.yml

  • colorYellow
  • colorDarkYellow
  • colorGreen

Example.output (without patch)

  • $yellow
  • $green
  • $darkYellow

Example.output (with patch)

  • $yellow
  • $darkYellow
  • $green

tomger avatar Feb 10 '20 15:02 tomger

@tomger, the failing test just needs a done() in the r func:

lib/tests/effects.js, line 103.

r => { done(); }

worked for me, anyway.

KITSStuCoe avatar Aug 26 '21 15:08 KITSStuCoe