'use strict';

const store = require('./store-27073b3b.js');

async function findUser(db, id) {
  const data = await db.find("users", id);
  store.state.users = { ...store.state.users, [id]: data };
  if (!data)
    return null;
  return { ...data, id };
}

exports.findUser = findUser;
