Skip to content

Commit

Permalink
Whitespace changes to make happy the new version of standardize
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCinelli committed Nov 20, 2018
1 parent 66909f2 commit 072ac11
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ function isStale (self, hit) {
function trim (self) {
if (self[LENGTH] > self[MAX]) {
for (var walker = self[LRU_LIST].tail;
self[LENGTH] > self[MAX] && walker !== null;) {
self[LENGTH] > self[MAX] && walker !== null;) {
// We know that we're about to delete this one, and also
// what the next least recently used key will be, so just
// go ahead and set it now.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"scripts": {
"test": "tap test/*.js --100 -J",
"posttest": "standard test/*.js index.js",
"lintfix": "standard --fix test/*.js index.js",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
Expand Down
6 changes: 3 additions & 3 deletions test/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if (global.NoSymbol) global.Symbol = false
var LRU = require('../')

test('basic', function (t) {
var cache = new LRU({max: 10})
var cache = new LRU({ max: 10 })
cache.set('key', 'value')
t.equal(cache.get('key'), 'value')
t.equal(cache.get('nada'), undefined)
Expand Down Expand Up @@ -102,7 +102,7 @@ test('basic with weighed length', function (t) {
return item.size
}
})
cache.set('key', {val: 'value', size: 50})
cache.set('key', { val: 'value', size: 50 })
t.equal(cache.get('key').val, 'value')
t.equal(cache.get('nada'), undefined)
t.equal(cache.lengthCalculator(cache.get('key'), 'key'), 50)
Expand All @@ -119,7 +119,7 @@ test('weighed length item too large', function (t) {
t.equal(cache.max, 10)

// should fall out immediately
cache.set('key', {val: 'value', size: 50})
cache.set('key', { val: 'value', size: 50 })

t.equal(cache.length, 0)
t.equal(cache.get('key'), undefined)
Expand Down
2 changes: 1 addition & 1 deletion test/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ l.set({ foo: 'bar' }, 'baz')
inspect()

l.maxAge = 0
l.set(1, {a: {b: {c: {d: {e: {f: {}}}}}}})
l.set(1, { a: { b: { c: { d: { e: { f: {} } } } } } })
inspect()

l.allowStale = true
Expand Down
12 changes: 6 additions & 6 deletions test/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ test('load basic cache', function (t) {
})

test('load staled cache', function (t) {
var cache = new LRU({maxAge: 100})
var copy = new LRU({maxAge: 100})
var cache = new LRU({ maxAge: 100 })
var copy = new LRU({ maxAge: 100 })
var arr

// expires at 50
Expand All @@ -138,8 +138,8 @@ test('load staled cache', function (t) {
})

test('load to other size cache', function (t) {
var cache = new LRU({max: 2})
var copy = new LRU({max: 1})
var cache = new LRU({ max: 2 })
var copy = new LRU({ max: 1 })

cache.set('a', 'A')
cache.set('b', 'B')
Expand All @@ -158,8 +158,8 @@ test('load to other size cache', function (t) {
})

test('load to other age cache', function (t) {
var cache = new LRU({maxAge: 250})
var aged = new LRU({maxAge: 500})
var cache = new LRU({ maxAge: 250 })
var aged = new LRU({ maxAge: 500 })
var simple = new LRU()
var arr

Expand Down

0 comments on commit 072ac11

Please sign in to comment.