summaryrefslogtreecommitdiff
path: root/src/node_modules/chance/docs/location/state.md
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
commit46e43f4bde4a35785b4997b81e86cd19f046b69b (patch)
treec53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/docs/location/state.md
downloadlangdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip
Commit
Diffstat (limited to 'src/node_modules/chance/docs/location/state.md')
-rw-r--r--src/node_modules/chance/docs/location/state.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/node_modules/chance/docs/location/state.md b/src/node_modules/chance/docs/location/state.md
new file mode 100644
index 0000000..81a200b
--- /dev/null
+++ b/src/node_modules/chance/docs/location/state.md
@@ -0,0 +1,62 @@
+# state
+
+```js
+// usage
+chance.state()
+chance.state({ full: true })
+chance.state({ territories: true })
+chance.state({ armed_forces: true })
+chance.state({ us_states_and_dc: false })
+chance.state({ country: 'us' })
+```
+
+Return a random state.
+
+```js
+chance.state();
+=> 'AK'
+```
+
+By default, returns only the 2 letter abbreviation for state.
+
+Optionally specify that it ought to return a full state name.
+
+```js
+chance.state({ full: true });
+=> 'Florida'
+```
+
+Optionally add U.S. Territories ('American Samoa', 'Federated States of Micronesia', 'Guam', 'Marshall Islands', 'Northern Mariana Islands', 'Puerto Rico', 'Virgin Islands, U.S.') to the mix of randomly selected items:
+
+```js
+chance.state({ territories: true, full: true })
+=> 'Guam'
+```
+
+Optionally add Armed Forces to the list as well:
+
+```js
+chance.state({ armed_forces: true, full: true })
+=> 'Armed Forces Pacific'
+```
+
+For all U.S. states, territories, and armed forces, specify all of them:
+
+```js
+chance.state({ armed_forces: true, territories: true })
+=> 'NY'
+```
+
+For just territories or armed forces, specify that it ought not return U.S. states:
+
+```js
+chance.state({ territories: true, us_states_and_dc: false })
+=> 'PR'
+```
+
+Optionally specify a country (US specific options are ignored if country is specified and different from `'us'`):
+
+```js
+chance.state({ country: 'it', full: true })
+=> 'Toscana'
+```