Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async seed(factory: Factory, connection: Connection): Promise {
const em = connection.createEntityManager();
await times(10, async (n) => {
const pet = await factory(Pet)().seed();
const user = await factory(User)().make();
user.pets = [pet];
return await em.save(user);
});
}