I've noticed that this could be useful, i.e. if you trying to generate some files that then would land in version control systems, like git.
If we sort object by keys, then each time when we run gulp we could expect that diff tools will show only what really have changed. Currently each time I run gulp on three files I've got different result and my git is shouting on me that I've changed whole file, when I didn't touch JSON files at all.
I know that by definition JS Objects don't have an order, but in practice V8 implementation is keeping keys in the order they were added.
I've noticed that this could be useful, i.e. if you trying to generate some files that then would land in version control systems, like git.
If we sort object by keys, then each time when we run gulp we could expect that diff tools will show only what really have changed. Currently each time I run gulp on three files I've got different result and my git is shouting on me that I've changed whole file, when I didn't touch JSON files at all.
I know that by definition JS Objects don't have an order, but in practice V8 implementation is keeping keys in the order they were added.