Skip to content

Commit 66c102e

Browse files
committed
force 'en' locale in string sorting
Re: npm/cli#2829
1 parent 37b44c1 commit 66c102e

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

common.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
exports.alphasort = alphasort
2-
exports.alphasorti = alphasorti
31
exports.setopts = setopts
42
exports.ownProp = ownProp
53
exports.makeAbs = makeAbs
@@ -17,12 +15,8 @@ var minimatch = require("minimatch")
1715
var isAbsolute = require("path-is-absolute")
1816
var Minimatch = minimatch.Minimatch
1917

20-
function alphasorti (a, b) {
21-
return a.toLowerCase().localeCompare(b.toLowerCase())
22-
}
23-
2418
function alphasort (a, b) {
25-
return a.localeCompare(b)
19+
return a.localeCompare(b, 'en')
2620
}
2721

2822
function setupIgnores (self, options) {
@@ -150,7 +144,7 @@ function finish (self) {
150144
all = Object.keys(all)
151145

152146
if (!self.nosort)
153-
all = all.sort(self.nocase ? alphasorti : alphasort)
147+
all = all.sort(alphasort)
154148

155149
// at *some* point we statted all of these
156150
if (self.mark) {

glob.js

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ var assert = require('assert')
5151
var isAbsolute = require('path-is-absolute')
5252
var globSync = require('./sync.js')
5353
var common = require('./common.js')
54-
var alphasort = common.alphasort
55-
var alphasorti = common.alphasorti
5654
var setopts = common.setopts
5755
var ownProp = common.ownProp
5856
var inflight = require('inflight')

sync.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ var path = require('path')
1111
var assert = require('assert')
1212
var isAbsolute = require('path-is-absolute')
1313
var common = require('./common.js')
14-
var alphasort = common.alphasort
15-
var alphasorti = common.alphasorti
1614
var setopts = common.setopts
1715
var ownProp = common.ownProp
1816
var childrenIgnored = common.childrenIgnored

0 commit comments

Comments
 (0)