refactor(database): use `_.isFunction(x)` instead of `typeof x === 'function'`