Skip to content

Commit

Permalink
Fix reference to extractor, #1
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed May 17, 2021
1 parent dac05df commit 08ae347
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const mapsAsObjects = true
import { setExtractor } from './decode.js'
import { createRequire } from 'module'

const extractor = tryRequire('msgpackr-extract')
const extractor = tryRequire('cbor-extract')
if (extractor)
setExtractor(extractor.extractStrings)
/*
Expand All @@ -18,8 +18,8 @@ function tryRequire(moduleId) {
return require(moduleId)
} catch (error) {
if (typeof window == 'undefined')
console.warn('Native extraction module not loaded, msgpackr will still run, but with decreased performance. ' + error.message.split('\n')[0])
console.warn('Native extraction module not loaded, cbor-x will still run, but with decreased performance. ' + error.message.split('\n')[0])
else
console.warn('For browser usage, directly use msgpackr/unpack or msgpackr/pack modules. ' + error.message.split('\n')[0])
console.warn('For browser usage, directly use cbor-x/decode or cbor-x/encode modules. ' + error.message.split('\n')[0])
}
}

0 comments on commit 08ae347

Please sign in to comment.