@italia-tools/faker
Version:
Italian-specific fake data generator based on Faker.js
48 lines (47 loc) • 1.4 kB
JavaScript
import { Faker, it } from '@faker-js/faker';
import { PersonModule } from './modules/person.module';
import { PlacesModule } from './modules/places.module';
import { AddressModule } from './modules/addresses.module';
import { FiscalCodeModule } from './modules/fiscalCode.module';
import { LastNameModule } from './modules/lastName.module';
export 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 LastNameModule(this);
}
return this._itFirstName;
}
}