mirror of
https://github.com/typicode/json-server.git
synced 2025-07-29 21:23:41 +08:00
Use lodash-id
This commit is contained in:
@ -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()
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user