Skip to content

Commit

Permalink
fix: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 25, 2022
1 parent e761aa2 commit 328d51c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
15 changes: 3 additions & 12 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,11 @@ class Keyv extends EventEmitter {
}

_getKeyPrefix (key) {
return this.namespace
? `${this.namespace}:${key}`
: (key && key.toString()) || key
return this.namespace ? `${this.namespace}:${key}` : (key && key.toString()) || key
}

_getKeyUnprefix (key) {
return this.namespace
? key
.split(':')
.splice(1)
.join(':')
: key
return this.namespace ? key.split(':').splice(1).join(':') : key
}

async get (key, { raw: asRaw = false } = {}) {
Expand All @@ -87,9 +80,7 @@ class Keyv extends EventEmitter {
}

async has (key) {
return typeof this.store.has === 'function'
? this.store.has(this._getKeyPrefix(key))
: (await this.store.get(this._getKeyPrefix(key))) !== undefined
return typeof this.store.has === 'function' ? this.store.has(this._getKeyPrefix(key)) : (await this.store.get(this._getKeyPrefix(key))) !== undefined
}

async set (key, value, ttl) {
Expand Down
4 changes: 1 addition & 3 deletions packages/redis/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ class KeyvRedis extends EventEmitter {
}

async set (key, value, ttl) {
return typeof ttl === 'number'
? this.redis.set(key, value, 'PX', ttl)
: this.redis.set(key, value)
return typeof ttl === 'number' ? this.redis.set(key, value, 'PX', ttl) : this.redis.set(key, value)
}

async delete (key) {
Expand Down

0 comments on commit 328d51c

Please sign in to comment.