Skip to content

Commit

Permalink
force 'en' locale in string sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 6, 2021
1 parent 37b44c1 commit 66c102e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
10 changes: 2 additions & 8 deletions common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
exports.alphasort = alphasort
exports.alphasorti = alphasorti
exports.setopts = setopts
exports.ownProp = ownProp
exports.makeAbs = makeAbs
Expand All @@ -17,12 +15,8 @@ var minimatch = require("minimatch")
var isAbsolute = require("path-is-absolute")
var Minimatch = minimatch.Minimatch

function alphasorti (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase())
}

function alphasort (a, b) {
return a.localeCompare(b)
return a.localeCompare(b, 'en')
}

function setupIgnores (self, options) {
Expand Down Expand Up @@ -150,7 +144,7 @@ function finish (self) {
all = Object.keys(all)

if (!self.nosort)
all = all.sort(self.nocase ? alphasorti : alphasort)
all = all.sort(alphasort)

// at *some* point we statted all of these
if (self.mark) {
Expand Down
2 changes: 0 additions & 2 deletions glob.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ var assert = require('assert')
var isAbsolute = require('path-is-absolute')
var globSync = require('./sync.js')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var inflight = require('inflight')
Expand Down
2 changes: 0 additions & 2 deletions sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ var path = require('path')
var assert = require('assert')
var isAbsolute = require('path-is-absolute')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var childrenIgnored = common.childrenIgnored
Expand Down

0 comments on commit 66c102e

Please sign in to comment.