Skip to content

Commit

Permalink
fix: setup namespace at store
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 30, 2021
1 parent 39ed95b commit 8ccbb75
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Keyv extends EventEmitter {
constructor ({ emitErrors = true, ...options } = {}) {
super()

const normalizeOptions = Object.assign(
const normalizedOptions = Object.assign(
{
namespace: 'keyv',
serialize: JSONB.stringify,
Expand All @@ -18,10 +18,12 @@ class Keyv extends EventEmitter {
options
)

Object.keys(normalizeOptions).forEach(
key => (this[key] = normalizeOptions[key])
Object.keys(normalizedOptions).forEach(
key => (this[key] = normalizedOptions[key])
)

this.store.namespace = this.namespace

if (typeof this.store.on === 'function' && emitErrors) {
this.store.on('error', error => this.emit('error', error))
}
Expand Down

0 comments on commit 8ccbb75

Please sign in to comment.