diff options
author | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
commit | 46e43f4bde4a35785b4997b81e86cd19f046b69b (patch) | |
tree | c53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/docs/finance | |
download | langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2 langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip |
Commit
Diffstat (limited to 'src/node_modules/chance/docs/finance')
-rw-r--r-- | src/node_modules/chance/docs/finance/cc.md | 37 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/cc_type.md | 42 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/currency.md | 13 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/currency_pair.md | 13 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/dollar.md | 30 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/euro.md | 28 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/exp.md | 21 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/exp_month.md | 28 | ||||
-rw-r--r-- | src/node_modules/chance/docs/finance/exp_year.md | 15 |
9 files changed, 227 insertions, 0 deletions
diff --git a/src/node_modules/chance/docs/finance/cc.md b/src/node_modules/chance/docs/finance/cc.md new file mode 100644 index 0000000..b5bf3d9 --- /dev/null +++ b/src/node_modules/chance/docs/finance/cc.md @@ -0,0 +1,37 @@ +# cc + +```js +// usage +chance.cc() +chance.cc({type: 'Mastercard'}) +``` + +<p class="pullquote" data-pullquote='Somewhat obvious warning: Do not use this to hit live payment gateways...' markdown="1"></p> + +Generate a random credit card number. This card number will pass the +[Luhn algorithm][Luhn] so it looks like a legit card. + +```js +chance.cc(); +=> '6304038511073827' +``` + +Optionally specify a particular type of card to return: + +```js +chance.cc({type: 'Mastercard'}); +=> '5171206237468496' +``` + +The type can be specified by the long name, or by the short name: + +```js +chance.cc({type: 'mc'}); +=> '5103820202214116' +``` + + +The [types][types] are enumerated below. + +[Luhn]: http://en.wikipedia.org/wiki/Luhn_algorithm +[types]: #cc_type diff --git a/src/node_modules/chance/docs/finance/cc_type.md b/src/node_modules/chance/docs/finance/cc_type.md new file mode 100644 index 0000000..538e43b --- /dev/null +++ b/src/node_modules/chance/docs/finance/cc_type.md @@ -0,0 +1,42 @@ +# cc_type + +```js +// usage +chance.cc_type() +chance.cc_type({raw: true}) +``` + +Return a random credit card type. + +```js +chance.cc_type(); +=> 'Visa' +``` + +Default returns just the name. To return the entire object (consisting of name, +short name, numeric prefix, and length), specify so with the raw flag. + +```js +chance.cc_type({raw: true}); +=> {name: 'Discover Card', short_name: 'discover', prefix: '6011', length: 16} +``` + +The available types are (name - *short_name*): + +* American Express - *amex* +* Bankcard - *bankcard* +* China UnionPay - *chinaunion* +* Diners Club Carte Blanche - *dccarte* +* Diners Club enRoute - *dcenroute* +* Diners Club International - *dcintl* +* Diners Club United States & Canada - *dcusc* +* Discover Card - *discover* +* InstaPayment - *instapay* +* JCB - *jcb* +* Laser - *laser* +* Maestro - *maestro* +* Mastercard - *mc* +* Solo - *solo* +* Switch - *switch* +* Visa - *visa* +* Visa Electron - *electron* diff --git a/src/node_modules/chance/docs/finance/currency.md b/src/node_modules/chance/docs/finance/currency.md new file mode 100644 index 0000000..03be07c --- /dev/null +++ b/src/node_modules/chance/docs/finance/currency.md @@ -0,0 +1,13 @@ +# currency + +```js +// usage +chance.currency() +``` + +Generate a random currency. + +```js +chance.currency(); +=> { code: "TVD", name: "Tuvalu Dollar" } +``` diff --git a/src/node_modules/chance/docs/finance/currency_pair.md b/src/node_modules/chance/docs/finance/currency_pair.md new file mode 100644 index 0000000..dab1151 --- /dev/null +++ b/src/node_modules/chance/docs/finance/currency_pair.md @@ -0,0 +1,13 @@ +# currency_pair + +```js +// usage +chance.currency_pair() +``` + +Generate a currency pair. Handy for simulating currency conversions. Guaranteed to return a unique pair (and not the same currency twice). + +```js +chance.currency_pair(); +=> [{ code: "ALL", name: "Albania Lek" }, { code: "ZWD", name: "Zimbabwe Dollar" }] +``` diff --git a/src/node_modules/chance/docs/finance/dollar.md b/src/node_modules/chance/docs/finance/dollar.md new file mode 100644 index 0000000..8840b00 --- /dev/null +++ b/src/node_modules/chance/docs/finance/dollar.md @@ -0,0 +1,30 @@ +# dollar + +```js +// usage +chance.dollar() +chance.dollar({max: 250}) +``` + +<p class="pullquote" data-pullquote="Dolla, dolla, bill ya'll" markdown="1"></p> + +Return a random dollar amount. + +```js +chance.dollar(); +=> "$2560.27" + +chance.dollar(); +=> "$750.99" +``` + +By default returns dollar amount no larger than 10000. Optionally specify +the max to make it larger (or smaller). + +```js +chance.dollar({max: 20}); +=> "$15.23" + +chance.dollar({max: 10000000}) +=> "$5051205.49" +``` diff --git a/src/node_modules/chance/docs/finance/euro.md b/src/node_modules/chance/docs/finance/euro.md new file mode 100644 index 0000000..553a7fe --- /dev/null +++ b/src/node_modules/chance/docs/finance/euro.md @@ -0,0 +1,28 @@ +# euro + +```js +// usage +chance.euro() +chance.euro({max: 250}) +``` + +Return a random euro amount. Formatting depends on the current locale (samples are displayed with european formatting) + +```js +chance.euro(); +=> "2.560,27€" + +chance.euro(); +=> "750.99€" +``` + +By default returns euro amount no larger than 10000. Optionally specify +the max to make it larger (or smaller). + +```js +chance.euro({max: 20}); +=> "15,23€" + +chance.euro({max: 10000000}) +=> "5.051.205,49€" +``` diff --git a/src/node_modules/chance/docs/finance/exp.md b/src/node_modules/chance/docs/finance/exp.md new file mode 100644 index 0000000..05fb59d --- /dev/null +++ b/src/node_modules/chance/docs/finance/exp.md @@ -0,0 +1,21 @@ +# exp + +```js +// usage +chance.exp() +chance.exp({raw: true}) +``` + +Generate a random credit card expiration. + +```js +chance.exp(); +=> '10/2020' +``` + +Optionally specify that a raw object be returned rather than a string + +```js +chance.exp({raw: true}); +=> {month: '11', year: '2017'} +``` diff --git a/src/node_modules/chance/docs/finance/exp_month.md b/src/node_modules/chance/docs/finance/exp_month.md new file mode 100644 index 0000000..b77ad1e --- /dev/null +++ b/src/node_modules/chance/docs/finance/exp_month.md @@ -0,0 +1,28 @@ +# exp_month + +```js +// usage +chance.exp_month() +chance.exp_month({future: true}) +``` + +Generate a random credit card expiration month. + +```js +chance.exp_month(); +=> '01' +``` + +Optionally specify that it must be a later month than the current month. + +```js +chance.exp_month({future: true}); +=> '10' +``` + +So if called in June, this would return a random month from July - Dec. If +called in October, would return November or December. + +This because many credit card sandboxes require an expiration date later +than the current date so it's necessary when generating an expiration with the +current year to generate a month later than the current month. diff --git a/src/node_modules/chance/docs/finance/exp_year.md b/src/node_modules/chance/docs/finance/exp_year.md new file mode 100644 index 0000000..3a203f9 --- /dev/null +++ b/src/node_modules/chance/docs/finance/exp_year.md @@ -0,0 +1,15 @@ +# exp_year + +```js +// usage +chance.exp_year() +``` + +Generate a random credit card expiration year. + +```js +chance.exp_year(); +=> '2018' +``` + +Returns a random year between today and 10 years in the future. |