diff --git a/index.js b/index.js index 816a15a..4d149aa 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const debug = require('debug')('koa-session'); const ContextSession = require('./lib/context'); const util = require('./lib/util'); const assert = require('assert'); -const uuid = require('uuid/v4'); +const uuid = require('uuid'); const is = require('is-type-of'); const CONTEXT_SESSION = Symbol('context#contextSession'); @@ -105,8 +105,8 @@ function formatOpts(opts) { } if (!opts.genid) { - if (opts.prefix) opts.genid = () => `${opts.prefix}${uuid()}`; - else opts.genid = uuid; + if (opts.prefix) opts.genid = () => `${opts.prefix}${uuid.v4()}`; + else opts.genid = uuid.v4; } return opts; diff --git a/package.json b/package.json index 6feecb9..87249f9 100644 --- a/package.json +++ b/package.json @@ -23,16 +23,16 @@ "mocha": "^5.2.0", "mz-modules": "^2.0.0", "pedding": "^1.1.0", - "uid-safe": "^2.1.3", "should": "8", - "supertest": "^3.3.0" + "supertest": "^3.3.0", + "uid-safe": "^2.1.3" }, "license": "MIT", "dependencies": { - "crc": "^3.4.4", - "debug": "^3.1.0", - "is-type-of": "^1.0.0", - "uuid": "^3.3.2" + "crc": "^4.0.0", + "debug": "^4.3.3", + "is-type-of": "^1.2.1", + "uuid": "^8.3.2" }, "engines": { "node": ">=7.6"