exports.normalizeSlashes = function normalizeSlashes(path) {
return path.split(sep).join('/');
};
So I have immediately jumped to jsPerf and wanted to compare this to alternative methods (for speed).
Unlucky as always, I have run into several nonsense tests:
- http://jsperf.com/split-join-vs-replace-47 - Both revisions 1,2 are wrong not comparing the same things
- http://jsperf.com/regexp-vs-split-join2 - another treasure
BTW: there is enough room for fiddling elsewhere. On of the tips: "http://jsfiddle.net"
Of course split/join is much slower then intuitive replace. At least with browsers and JSPerf