diff --git a/package.json b/package.json index 49d9128..8686bcf 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ "debug": "^3.1.0", "delegates": "^1.0.0", "koa-compose": "^4.1.0", + "nanoid": "^2.0.1", "only": "^0.0.2", - "serialize-error": "^3.0.0", - "shortid": "^2.2.12" + "serialize-error": "^3.0.0" } } diff --git a/src/context.js b/src/context.js index a60052d..a9f9be3 100644 --- a/src/context.js +++ b/src/context.js @@ -1,5 +1,5 @@ import delegate from "delegates"; -import shortid from "shortid"; +import nanoid from "nanoid"; /** * Context class. @@ -12,7 +12,7 @@ export default class Context { session; constructor() { - this.id = shortid.generate(); + this.id = nanoid(); this.state = {}; // for additional data store } } diff --git a/src/session.js b/src/session.js index 37eb7d7..ceef536 100644 --- a/src/session.js +++ b/src/session.js @@ -2,7 +2,7 @@ import Stream from "stream"; import util from "util"; import Debugger from "debug"; -import shortid from "shortid"; +import nanoid from "nanoid"; const debug = new Debugger("whisper"); @@ -19,7 +19,7 @@ export default class Session { constructor() { this.createdAt = new Date(); - this.id = shortid.generate(); + this.id = nanoid(); this._lastSeq = 0; this.state = {}; // for additional data store } diff --git a/yarn.lock b/yarn.lock index 295ec07..32578c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4629,9 +4629,9 @@ nan@^2.9.2: version "2.11.1" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" -nanoid@^1.0.7: - version "1.2.6" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-1.2.6.tgz#5b9427cabf41f5df1fc371b14c969ffcd3b095aa" +nanoid@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.0.1.tgz#deb55cac196e3f138071911dabbc3726eb048864" nanomatch@^1.2.9: version "1.2.13" @@ -6176,12 +6176,6 @@ shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" -shortid@^2.2.12: - version "2.2.13" - resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.13.tgz#b2441e71c664ace458a341d343959f677910ef5b" - dependencies: - nanoid "^1.0.7" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"