File: hidden.md

package info (click to toggle)
node-chance 2.2.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,612 kB
  • sloc: javascript: 16,572; makefile: 4
file content (59 lines) | stat: -rw-r--r-- 1,577 bytes parent folder | download | duplicates (2)
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
# hidden

```js
// usage
chance.cc_types()
chance.mersenne_twister()
chance.mersenne_twister(12345)
chance.months()
chance.name_prefixes()
chance.provinces()
chance.states()
chance.street_suffix()
chance.street_suffixes()
```

These aren't really hidden per se, but just utility methods intended to be used
internally but exposed externally in case they're useful to anyone.

```js

// Return the list of cc types
chance.cc_types()
=> [{name: "American Express", short_name: 'amex', prefix: '34', length: 15}, ...]

// Return a new Mersenne Twister
chance.mersenne_twister()
=> [object Object] // An instance of a Mersenne Twister

// Optionally provide a seed for that twister
chance.mersenne_twister(12345)
=> [object Object] // An instance of a twister with seed 12345

// Return our list of name prefixes
chance.months();
=> [{name: 'January', short_name 'Jan', numeric: '01'}, ...]

// Return our list of name prefixes
chance.name_prefixes();
=> [{name: 'Doctor', abbreviation: 'Dr.'}, {name: 'Miss', abbreviation: 'Miss'}, ...]

// Return the list of provinces
chance.provinces();
=> [{name: 'Alberta', abbreviation: 'AB'}, {name: 'British Columbia', abbreviation: 'BC'}, ...]

// Return the list of states
chance.states();
=> [{name: 'Alabama', abbreviation: 'AL'}, {name: 'Alaska', abbreviation: 'AK'}, ...]

// Return a random street suffix
chance.street_suffix();
=> {name: 'Street', abbreviation: 'St'}

// Return the list of street suffixes
chance.street_suffixes();
=> [{name: 'Avenue', abbreviation: 'Ave'}, {name: 'Boulevard', abbreviation: 'Blvd'}, ...]

```