Use lodash-id

This commit is contained in:
typicode
2017-02-20 23:57:30 +01:00
parent fbdeb31794
commit 92532128da
4 changed files with 7 additions and 7 deletions

View File

@ -34,7 +34,7 @@ function getRemovable (db) {
}
// Return incremented id or uuid
// Used to override underscore-db's createId with utils.createId
// Used to override lodash-id's createId with utils.createId
function createId (coll) {
const _ = this
const idProperty = _.__id()

View File

@ -1,7 +1,7 @@
const express = require('express')
const methodOverride = require('method-override')
const _ = require('lodash')
const _db = require('underscore-db')
const lodashId = require('lodash-id')
const low = require('lowdb')
const fileAsync = require('lowdb/lib/storages/file-async')
const bodyParser = require('../body-parser')
@ -30,8 +30,8 @@ module.exports = (source) => {
validateData(db.getState())
// Add underscore-db methods to db
db._.mixin(_db)
// Add lodash-id methods to db
db._.mixin(lodashId)
// Add specific mixins
db._.mixin(mixins)