SB-6.1-PRE
This commit is contained in:
1 parent
690169a409
commit
358a25f522
3760 files changed
+300059
-36
No files matched your search
+31
@@ -0,0 +1,31 @@
|
||||
# aadhar
|
||||
|
||||
_Aadhar_ (English: Foundation) is a 12-digit unique identity number that can be obtained by residents of India, based on their biometric and demographic data.
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.aadhar()
|
||||
chance.aadhar({ onlyLastFour: true }) // false by default
|
||||
chance.aadhar({ separatedByWhiteSpace: false }) // true by default
|
||||
```
|
||||
|
||||
Generate a random aadhar.
|
||||
|
||||
```js
|
||||
chance.aadhar();
|
||||
=> '8506 7820 9696'
|
||||
```
|
||||
|
||||
Optionally provide option of getting only the last four
|
||||
|
||||
```js
|
||||
chance.aadhar({ onlyLastFour: true });
|
||||
=> '1851'
|
||||
```
|
||||
|
||||
Optionally specify dashes be removed
|
||||
|
||||
```js
|
||||
chance.aadhar({ separatedByWhiteSpace: false });
|
||||
'873300307032'
|
||||
```
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# age
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.age()
|
||||
chance.age({ type: 'child' })
|
||||
```
|
||||
|
||||
Generate a random age
|
||||
|
||||
```js
|
||||
chance.age();
|
||||
=> 45
|
||||
```
|
||||
|
||||
Default range is between 1 and 120
|
||||
|
||||
Optionally specify one of a handful of enumerated age types:
|
||||
|
||||
```js
|
||||
chance.age({type: 'child'});
|
||||
=> 9
|
||||
```
|
||||
|
||||
Allowed types are: `child`, `teen`, `adult`, `senior`
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
# birthday
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.birthday()
|
||||
chance.birthday({ string: true })
|
||||
chance.birthday({ type: 'child' })
|
||||
```
|
||||
|
||||
Generate a random birthday
|
||||
|
||||
```js
|
||||
chance.birthday();
|
||||
=> Fri Aug 16 1985 00:00:00 GMT-0400 (EDT)
|
||||
```
|
||||
|
||||
By default, returns an actual JavaScript [Date][Date] object.
|
||||
|
||||
Optionally specify it be returned as a string.
|
||||
|
||||
```js
|
||||
chance.birthday({string: true});
|
||||
=> '4/1/1968'
|
||||
```
|
||||
|
||||
By default returns in MM/DD/YYYY format. Can specify DD/MM/YYYY as follows:
|
||||
|
||||
```js
|
||||
chance.birthday({string: true, american: false});
|
||||
=> '28/6/1993'
|
||||
```
|
||||
|
||||
For more complex date formats, use the [Moment][Moment] library.
|
||||
|
||||
Can also specify the type, same types as with [age](#age).
|
||||
|
||||
```js
|
||||
chance.birthday({type: 'child'});
|
||||
=> Sat Sep 08 2001 00:00:00 GMT-0400 (EDT)
|
||||
```
|
||||
|
||||
You can also compose with `chance.year` for interesting combinations. For example, let's say we want to get the birthdays of some renaissance artists (born between 1450 and 1500). We can generate a year and then get a birthday from that year:
|
||||
|
||||
```js
|
||||
var year = chance.year({ min: 1450, max: 1500 });
|
||||
chance.birthday({ year: year });
|
||||
=> Wed Aug 27 1484 11:24:14 GMT-0400 (EDT)
|
||||
|
||||
// Could be simplified down to one line
|
||||
chance.birthday({ year: chance.year({ min: 1450, max: 1500 }) });
|
||||
=> Fri Nov 26 1469 09:17:13 GMT-0500 (EST)
|
||||
```
|
||||
|
||||
[Date]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
|
||||
[Moment]: http://momentjs.com
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
# cf
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.cf()
|
||||
```
|
||||
Generate a random Italian social security number (Codice Fiscale).
|
||||
|
||||
```js
|
||||
chance.cf();
|
||||
=> 'BRSMRT87S49A988X'
|
||||
```
|
||||
|
||||
Optionally specify any or all components: first name, last name, gender, birth date, place of birth (using ISTAT geocodes for Italian cities).
|
||||
|
||||
```js
|
||||
chance.cf({first: 'Sergio', last: 'Leone'});
|
||||
=> 'LNESRG93P28F067V'
|
||||
|
||||
chance.cf({first: 'Sophia', last: 'Loren', gender: 'Female', birthday: new Date(1934,8,20), city: 'h501'});
|
||||
|
||||
=> 'LRNSPH34P60H501G'
|
||||
```
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
# cpf
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.cpf()
|
||||
```
|
||||
|
||||
Generate a random Brazilian tax id.
|
||||
|
||||
```js
|
||||
chance.cpf();
|
||||
=> '607.116.899-62'
|
||||
```
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
# first
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.first()
|
||||
chance.first({ nationality: 'us' })
|
||||
```
|
||||
|
||||
Generate a random first name
|
||||
|
||||
```js
|
||||
Chance.first();
|
||||
=> 'Leila'
|
||||
```
|
||||
|
||||
Optionally specify a gender to limit first names to that gender
|
||||
|
||||
```js
|
||||
Chance.first({ gender: "female" });
|
||||
=> 'Emma'
|
||||
```
|
||||
|
||||
Optionally specify a nationality to limit first names to those most common of that nationality
|
||||
|
||||
```js
|
||||
Chance.first({ nationality: "it" });
|
||||
=> 'Alberto'
|
||||
```
|
||||
|
||||
Note, currently support for nationality is limited to: `'us', 'it'`.
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
# gender
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.gender()
|
||||
```
|
||||
|
||||
Generate a random gender
|
||||
|
||||
```js
|
||||
Chance.gender();
|
||||
=> 'Female'
|
||||
```
|
||||
|
||||
Extra genders can be provided using the `extraGenders` key in the optional options argument:
|
||||
|
||||
```js
|
||||
Chance.gender({
|
||||
extraGenders: ['Agender', 'Genderqueer', 'Trans', 'Pangender']
|
||||
});
|
||||
```
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
# last
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.last()
|
||||
chance.last({ nationality: 'en' })
|
||||
```
|
||||
|
||||
Generate a random last name
|
||||
|
||||
```js
|
||||
Chance.last();
|
||||
=> 'Mago'
|
||||
```
|
||||
|
||||
Optionally specify a nationality to limit first names to those most common of that nationality
|
||||
|
||||
```js
|
||||
Chance.last({ nationality: 'it' });
|
||||
=> 'Giovannini'
|
||||
```
|
||||
|
||||
Note, currently support for nationality is limited to: `'en', 'it', 'nl', 'uk', 'de', 'jp', 'es', 'fr'`.
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
# name
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.name()
|
||||
chance.name({ middle: true })
|
||||
chance.name({ middle_initial: true })
|
||||
chance.name({ prefix: true })
|
||||
chance.name({ nationality: 'en' })
|
||||
```
|
||||
|
||||
Generate a random name
|
||||
|
||||
```js
|
||||
chance.name();
|
||||
=> 'Dafi Vatemi'
|
||||
```
|
||||
|
||||
Optionally include the middle name
|
||||
|
||||
```js
|
||||
chance.name({ middle: true });
|
||||
=> 'Nelgatwu Powuku Heup'
|
||||
```
|
||||
|
||||
|
||||
Optionally include the middle initial
|
||||
|
||||
```js
|
||||
chance.name({ middle_initial: true });
|
||||
=> 'Ezme I Iza'
|
||||
```
|
||||
|
||||
Optionally include the prefix
|
||||
|
||||
```js
|
||||
chance.name({ prefix: true });
|
||||
=> 'Doctor Suosat Am'
|
||||
```
|
||||
|
||||
Optionally include the suffix
|
||||
|
||||
```js
|
||||
chance.name({ suffix: true });
|
||||
=> 'Fanny Baker Esq.'
|
||||
```
|
||||
|
||||
Optionally specify a gender
|
||||
|
||||
```js
|
||||
chance.name({ gender: 'male' });
|
||||
=> "Patrick Copeland"
|
||||
```
|
||||
|
||||
Optionally specify a nationality
|
||||
|
||||
```js
|
||||
chance.name({ nationality: 'it' });
|
||||
=> "Roberta Mazzetti"
|
||||
```
|
||||
|
||||
Note, currently support for nationality is limited to: `'en', 'it'`.
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# prefix
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.prefix()
|
||||
chance.prefix({ full: true })
|
||||
```
|
||||
|
||||
Generate a random name prefix
|
||||
|
||||
```js
|
||||
chance.prefix();
|
||||
=> 'Mrs.'
|
||||
```
|
||||
|
||||
By default, returns the shorter version.
|
||||
|
||||
Optionally get back the full version.
|
||||
|
||||
```js
|
||||
chance.prefix({ full: true });
|
||||
=> 'Mister'
|
||||
```
|
||||
|
||||
Optionally specify a gender. Valid options are `male`, `female`, or `all` (the default).
|
||||
|
||||
```js
|
||||
chance.prefix({ gender: "male" });
|
||||
=> 'Mr.'
|
||||
|
||||
chance.prefix({ gender: "female" });
|
||||
=> 'Miss'
|
||||
```
|
||||
|
||||
*To maintain legacy support, this also responds to chance.name_prefix().*
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
# ssn
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.ssn()
|
||||
chance.ssn({ ssnFour: true })
|
||||
chance.ssn({ dashes: false })
|
||||
```
|
||||
|
||||
Generate a random social security number.
|
||||
|
||||
```js
|
||||
chance.ssn();
|
||||
=> '411-90-0070'
|
||||
```
|
||||
|
||||
Optionally provide option of getting only the last four
|
||||
|
||||
```js
|
||||
chance.ssn({ ssnFour: true });
|
||||
=> '2938'
|
||||
```
|
||||
|
||||
Optionally specify dashes be removed
|
||||
|
||||
```js
|
||||
chance.ssn({ dashes: false });
|
||||
=> '293839295'
|
||||
```
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# suffix
|
||||
|
||||
```js
|
||||
// usage
|
||||
chance.suffix()
|
||||
chance.suffix({ full: true })
|
||||
```
|
||||
|
||||
Generate a random name suffix
|
||||
|
||||
```js
|
||||
chance.suffix();
|
||||
=> 'Sr.'
|
||||
```
|
||||
|
||||
By default, returns the shorter version.
|
||||
|
||||
Optionally get back the full version.
|
||||
|
||||
```js
|
||||
chance.suffix({ full: true });
|
||||
=> 'Juris Doctor'
|
||||
```
|
||||
|
||||
*To maintain legacy support, this also responds to chance.name_suffix().*
|
||||
Reference in new issue
Block a user