Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

peerDependencies WARNING crc@^4.0.0 requires a peer of buffer@>=6.0.3 but none was installed

I will downgrade crc to v3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"debug": "^4.3.3",
"is-type-of": "^1.2.1",
"uuid": "^8.3.2"
},
"engines": {
"node": ">=7.6"
Expand Down