Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Faker from 'faker';
import { define } from 'typeorm-seeding';
import { Chapter } from '../models/Chapter';
import { User } from '../models/User';
import { Location } from '../models/Location';
define(Chapter, (
faker: typeof Faker,
params: { creator: User; location: Location },
) => {
const { creator, location } = params;
const name = faker.company.companyName();
const description = faker.lorem.words();
const category = faker.lorem.word();
const details = {
email: faker.internet.email(),
};
const chapter = new Chapter({
name,
description,
category,
import Faker from 'faker';
import { define } from 'typeorm-seeding';
import { User } from '../models/User';
define(User, (faker: typeof Faker) => {
const user = new User({
email: faker.internet.email(),
first_name: faker.name.firstName(),
last_name: faker.name.lastName(),
});
return user;
});