``fix inconsistent quotes in code and update schema with additional fields and rules
``
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import { faker } from "@faker-js/faker";
|
||||
import { faker } from '@faker-js/faker';
|
||||
|
||||
const getId = (id) => id.padStart(15, "0");
|
||||
const getId = (id) => id.padStart(15, '0');
|
||||
|
||||
const row_array = Array.from({ length: 10 }, (_, i) => [
|
||||
getId(String(i + 1)),
|
||||
faker.person.firstName(),
|
||||
"",
|
||||
'',
|
||||
faker.internet.email(),
|
||||
faker.phone.number(),
|
||||
faker.company.name(),
|
||||
@@ -19,13 +19,11 @@ const row_array = Array.from({ length: 10 }, (_, i) => [
|
||||
},
|
||||
Math.floor(Math.random() * (100 - 0 + 1)) + 0,
|
||||
faker.location.timeZone(),
|
||||
["en", "de", "es", "fr", "ja", "ko", "zh-CN"].sort(
|
||||
() => Math.random() - 0.5
|
||||
)[0],
|
||||
['en', 'de', 'es', 'fr', 'ja', 'ko', 'zh-CN'].sort(() => Math.random() - 0.5)[0],
|
||||
faker.finance.currencyCode(),
|
||||
]);
|
||||
|
||||
import fs from "fs";
|
||||
const filePath = "output.json";
|
||||
import fs from 'fs';
|
||||
const filePath = 'output.json';
|
||||
fs.writeFileSync(filePath, JSON.stringify(row_array, null, 2));
|
||||
console.log(`Wrote ${row_array.length} records to ${filePath}`);
|
||||
|
Reference in New Issue
Block a user