Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
Remove node specific code from fuzzysort
Browse files Browse the repository at this point in the history
  • Loading branch information
eoger committed Jul 1, 2018
1 parent ea98418 commit 3d97f64
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/sidebar/lib/fuzzysort.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function UMD() { function fuzzysortNew(instanceOptions) {

if(iCurrent%1000/*itemsPerCheck*/ === 0) {
if(Date.now() - startMs >= 10/*asyncInterval*/) {
isNode?setImmediate(step):setTimeout(step)
setTimeout(step)
return
}
}
Expand Down Expand Up @@ -208,7 +208,7 @@ function UMD() { function fuzzysortNew(instanceOptions) {

if(iCurrent%1000/*itemsPerCheck*/ === 0) {
if(Date.now() - startMs >= 10/*asyncInterval*/) {
isNode?setImmediate(step):setTimeout(step)
setTimeout(step)
return
}
}
Expand All @@ -231,7 +231,7 @@ function UMD() { function fuzzysortNew(instanceOptions) {

if(iCurrent%1000/*itemsPerCheck*/ === 0) {
if(Date.now() - startMs >= 10/*asyncInterval*/) {
isNode?setImmediate(step):setTimeout(step)
setTimeout(step)
return
}
}
Expand All @@ -245,7 +245,7 @@ function UMD() { function fuzzysortNew(instanceOptions) {
resolve(results)
}

isNode?setImmediate(step):step()
step()
})
p.cancel = function() { canceled = true }
return p
Expand Down Expand Up @@ -549,8 +549,6 @@ function UMD() { function fuzzysortNew(instanceOptions) {
return fuzzysort
} // fuzzysortNew

// This stuff is outside fuzzysortNew, because it's shared with instances of fuzzysort.new()
var isNode = typeof require !== 'undefined' && typeof window === 'undefined'
// var MAX_INT = Number.MAX_SAFE_INTEGER
// var MIN_INT = Number.MIN_VALUE
var preparedCache = new Map()
Expand Down

0 comments on commit 3d97f64

Please sign in to comment.