UNPKG

1.58 kBMarkdownView Raw
1# hidden
2
3```js
4// usage
5chance.cc_types()
6chance.mersenne_twister()
7chance.mersenne_twister(12345)
8chance.months()
9chance.name_prefixes()
10chance.provinces()
11chance.states()
12chance.street_suffix()
13chance.street_suffixes()
14```
15
16These aren't really hidden per se, but just utility methods intended to be used
17internally but exposed externally in case they're useful to anyone.
18
19```js
20
21// Return the list of cc types
22chance.cc_types()
23=> [{name: "American Express", short_name: 'amex', prefix: '34', length: 15}, ...]
24
25// Return a new Mersenne Twister
26chance.mersenne_twister()
27=> [object Object] // An instance of a Mersenne Twister
28
29// Optionally provide a seed for that twister
30chance.mersenne_twister(12345)
31=> [object Object] // An instance of a twister with seed 12345
32
33// Return our list of name prefixes
34chance.months();
35=> [{name: 'January', short_name 'Jan', numeric: '01'}, ...]
36
37// Return our list of name prefixes
38chance.name_prefixes();
39=> [{name: 'Doctor', abbreviation: 'Dr.'}, {name: 'Miss', abbreviation: 'Miss'}, ...]
40
41// Return the list of provinces
42chance.provinces();
43=> [{name: 'Alberta', abbreviation: 'AB'}, {name: 'British Columbia', abbreviation: 'BC'}, ...]
44
45// Return the list of states
46chance.states();
47=> [{name: 'Alabama', abbreviation: 'AL'}, {name: 'Alaska', abbreviation: 'AK'}, ...]
48
49// Return a random street suffix
50chance.street_suffix();
51=> {name: 'Street', abbreviation: 'St'}
52
53// Return the list of street suffixes
54chance.street_suffixes();
55=> [{name: 'Avenue', abbreviation: 'Ave'}, {name: 'Boulevard', abbreviation: 'Blvd'}, ...]
56
57```
58
59