-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
147 lines (117 loc) · 3.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import boolean from '@fakerjs/boolean';
import integer from '@fakerjs/integer';
import float from '@fakerjs/float';
import age from '@fakerjs/age';
import animal from '@fakerjs/animal';
import gender from '@fakerjs/gender';
import ip from '@fakerjs/ip';
import letter from '@fakerjs/letter';
import string from '@fakerjs/string';
import profession from '@fakerjs/profession';
import superhero from '@fakerjs/superhero';
import word from '@fakerjs/word';
import sentence from '@fakerjs/sentence';
import paragraph from '@fakerjs/paragraph';
import domain from '@fakerjs/domain';
import url from '@fakerjs/url';
import tld from '@fakerjs/tld';
import browser from '@fakerjs/browser';
import email from '@fakerjs/email';
import firstName from '@fakerjs/firstname';
import lastName from '@fakerjs/lastname';
import game from '@fakerjs/game';
import house from '@fakerjs/house';
import sport from '@fakerjs/sport';
import blood from '@fakerjs/blood';
import computer from '@fakerjs/computer';
import camera from '@fakerjs/camera';
class Faker {
_options = {};
constructor(options) {
this._options = options || {};
}
boolean() {
return boolean();
}
integer(options) {
return integer(options);
}
float(options) {
return float(options);
}
age(options) {
return age(options);
}
gender(options) {
return gender({locale: this._options.locale || 'en_US', ...options});
}
ip() {
return ip();
}
letter(options) {
return letter({locale: this._options.locale || 'en_US', ...options});
}
string(options) {
return string(options);
}
profession(options) {
return profession({locale: this._options.locale || 'en_US', ...options});
}
animal(options) {
return animal({locale: this._options.locale || 'en_US', ...options});
}
game(options) {
return game({locale: this._options.locale || 'en_US', ...options});
}
house(options) {
return house({locale: this._options.locale || 'en_US', ...options});
}
sport(options) {
return sport({locale: this._options.locale || 'en_US', ...options});
}
superhero() {
return superhero();
}
blood() {
return blood();
}
word(options) {
return word(options);
}
sentence(options) {
return sentence(options);
}
paragraph(options) {
return paragraph(options);
}
domain(options) {
return domain(options);
}
email(options) {
return email(options);
}
firstName(options) {
return firstName({locale: this._options.locale || 'en_US', ...options});
}
lastName(options) {
return lastName({locale: this._options.locale || 'en_US', ...options});
}
computer(options) {
return computer({locale: this._options.locale || 'en_US', ...options});
}
camera(options) {
return camera({locale: this._options.locale || 'en_US', ...options});
}
browser() {
return browser();
}
url(options) {
return url(options);
}
tld() {
return tld();
}
}
export default function faker(options) {
return new Faker(options);
}