Skip to content

Commit

Permalink
Switch back to async
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Nov 14, 2018
1 parent 59ef199 commit 33fcd71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/router/index.js
Expand Up @@ -4,7 +4,7 @@ const _ = require('lodash')
const lodashId = require('lodash-id')
const low = require('lowdb')
const Memory = require('lowdb/adapters/Memory')
const FileSync = require('lowdb/adapters/FileSync')
const FileAsync = require('lowdb/adapters/FileAsync')
const bodyParser = require('../body-parser')
const validateData = require('./validate-data')
const plural = require('./plural')
Expand All @@ -14,7 +14,7 @@ const mixins = require('../mixins')

module.exports = (db, opts = { foreignKeySuffix: 'Id' }) => {
if (typeof db === 'string') {
db = low(new FileSync(db))
db = low(new FileAsync(db))
} else if (!_.has(db, '__chain__') || !_.has(db, '__wrapped__')) {
db = low(new Memory()).setState(db)
}
Expand Down

0 comments on commit 33fcd71

Please sign in to comment.