Skip to content

Commit

Permalink
feat: update uuid to v8 (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhennann authored Jan 3, 2023
1 parent 07ca4d7 commit 878669e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 878669e

Please sign in to comment.