Skip to content

Commit 84d9892

Browse files
aitypicode
authored andcommitted
Replace shortid to nanoid (typicode#655)
1 parent 3707376 commit 84d9892

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
"lowdb": "^0.15.0",
2323
"method-override": "^2.1.2",
2424
"morgan": "^1.3.1",
25+
"nanoid": "^0.2.2",
2526
"object-assign": "^4.0.1",
2627
"please-upgrade-node": "^3.0.1",
2728
"pluralize": "^3.0.0",
2829
"request": "^2.72.0",
2930
"server-destroy": "^1.0.1",
30-
"shortid": "^2.2.6",
3131
"update-notifier": "^1.0.2",
3232
"yargs": "^6.0.0"
3333
},

src/server/mixins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const shortid = require('shortid')
1+
const nanoid = require('nanoid')
22
const pluralize = require('pluralize')
33

44
module.exports = {
@@ -48,7 +48,7 @@ function createId(coll) {
4848
let id = _(coll).maxBy(idProperty)[idProperty]
4949

5050
// Increment integer id or generate string id
51-
return _.isFinite(id) ? ++id : shortid.generate()
51+
return _.isFinite(id) ? ++id : nanoid(7)
5252
}
5353
}
5454

0 commit comments

Comments
 (0)