Skip to content

Commit

Permalink
move outside class
Browse files Browse the repository at this point in the history
  • Loading branch information
asiloisad committed Jan 14, 2025
1 parent 810bce6 commit 3cf22af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/tree-view/lib/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class Directory {
this.destroyed = false
this.emitter = new Emitter()
this.subscriptions = new CompositeDisposable()
this.compareFn = Intl.Collator(undefined, {numeric: true, sensitivity: 'base'}).compare

if (atom.config.get('tree-view.squashDirectoryNames') && !this.isRoot) {
fullPath = this.squashDirectoryNames(fullPath)
Expand Down Expand Up @@ -347,7 +346,7 @@ class Directory {
}

compareEntries(a, b) {
return this.compareFn(a, b)
return compareFn(a, b)
}

// Public: Perform a synchronous reload of the directory.
Expand Down Expand Up @@ -458,3 +457,5 @@ function throttle(func, timeout) {
}, timeout)
}
}

const compareFn = Intl.Collator(undefined, {numeric: true, sensitivity: 'base'}).compare

0 comments on commit 3cf22af

Please sign in to comment.