Skip to content

Commit 9253212

Browse files
committed
Use lodash-id
1 parent fbdeb31 commit 9253212

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"express": "^4.9.5",
1818
"json-parse-helpfulerror": "^1.0.3",
1919
"lodash": "^4.11.2",
20+
"lodash-id": "^0.13.0",
2021
"lowdb": "^0.15.0",
2122
"method-override": "^2.1.2",
2223
"morgan": "^1.3.1",
@@ -25,7 +26,6 @@
2526
"request": "^2.72.0",
2627
"server-destroy": "^1.0.1",
2728
"shortid": "^2.2.6",
28-
"underscore-db": "^0.12.2",
2929
"update-notifier": "^1.0.2",
3030
"yargs": "^6.0.0"
3131
},

src/server/mixins.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function getRemovable (db) {
3434
}
3535

3636
// Return incremented id or uuid
37-
// Used to override underscore-db's createId with utils.createId
37+
// Used to override lodash-id's createId with utils.createId
3838
function createId (coll) {
3939
const _ = this
4040
const idProperty = _.__id()

src/server/router/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const express = require('express')
22
const methodOverride = require('method-override')
33
const _ = require('lodash')
4-
const _db = require('underscore-db')
4+
const lodashId = require('lodash-id')
55
const low = require('lowdb')
66
const fileAsync = require('lowdb/lib/storages/file-async')
77
const bodyParser = require('../body-parser')
@@ -30,8 +30,8 @@ module.exports = (source) => {
3030

3131
validateData(db.getState())
3232

33-
// Add underscore-db methods to db
34-
db._.mixin(_db)
33+
// Add lodash-id methods to db
34+
db._.mixin(lodashId)
3535

3636
// Add specific mixins
3737
db._.mixin(mixins)

test/server/mixins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
const assert = require('assert')
22
const _ = require('lodash')
3-
const _db = require('underscore-db')
3+
const lodashId = require('lodash-id')
44
const mixins = require('../../src/server/mixins')
55

66
describe('mixins', () => {
77
let db
88

99
before(() => {
10-
_.mixin(_db)
10+
_.mixin(lodashId)
1111
_.mixin(mixins)
1212
})
1313

0 commit comments

Comments
 (0)