You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

db.ts 603B

1234567891011121314151617181920212223
  1. import { faker } from '@faker-js/faker'
  2. interface FakeData {
  3. id: number;
  4. name: string;
  5. color: string;
  6. price: string;
  7. company: string;
  8. }
  9. module.exports = () => {
  10. const items:FakeData[] = [];
  11. for (let id = 1; id <= 500; id++) {
  12. items.push({
  13. id: id,
  14. name: `${faker.commerce.productAdjective()} ${faker.commerce.productMaterial()} ${faker.commerce.product()}`,
  15. color: faker.commerce.color(),
  16. price: `$${faker.commerce.price()}`,
  17. company: faker.company.companyName(),
  18. });
  19. }
  20. return { items };
  21. };