UNPKG

@italia-tools/faker

Version:

Italian-specific fake data generator based on Faker.js

52 lines (49 loc) 1.5 kB
import { Faker, it } from '@faker-js/faker'; import { PersonModule } from './modules/person.module.mjs'; import { PlacesModule } from './modules/places.module.mjs'; import { AddressModule } from './modules/addresses.module.mjs'; import { FiscalCodeModule } from './modules/fiscalCode.module.mjs'; import { LastNameModule } from './modules/lastName.module.mjs'; import { FirstNameModule } from './modules/firstName.module.mjs'; class ItFaker extends Faker { constructor() { super({ locale: [it] }); } get itPerson() { if (!this._itPerson) { this._itPerson = new PersonModule(this); } return this._itPerson; } get itPlace() { if (!this._itPlace) { this._itPlace = new PlacesModule(this); } return this._itPlace; } get itAddress() { if (!this._itAddress) { this._itAddress = new AddressModule(this); } return this._itAddress; } get itFiscalCode() { if (!this._itFiscalCode) { this._itFiscalCode = new FiscalCodeModule(this); } return this._itFiscalCode; } get itLastName() { if (!this._itLastName) { this._itLastName = new LastNameModule(this); } return this._itLastName; } get itFirstName() { if (!this._itFirstName) { this._itFirstName = new FirstNameModule(this); } return this._itFirstName; } } export { ItFaker };