aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinigami <[email protected]>2022-01-10 18:44:24 +0100
committerGitHub <[email protected]>2022-01-10 12:44:24 -0500
commitdd10cc612fdc9ac9621e10dc95c7b298882fc40a (patch)
treef7a093b35520c70efe3ca881d769a5fc1cc6fca0
parent6ed9f0efe2bd4d73a89c5eaf75a4028d81dea142 (diff)
downloadfaker-dd10cc612fdc9ac9621e10dc95c7b298882fc40a.tar.xz
faker-dd10cc612fdc9ac9621e10dc95c7b298882fc40a.zip
chore: format root files (#64)
-rw-r--r--.eslintrc5
-rw-r--r--.prettierignore3
-rw-r--r--CHANGELOG_old.md (renamed from CHANGELOG.md)68
-rw-r--r--CONTRIBUTING.md10
-rw-r--r--README.md (renamed from Readme.md)106
-rw-r--r--conf.json4
-rw-r--r--gulpfile.js6
-rw-r--r--index.js2
8 files changed, 101 insertions, 103 deletions
diff --git a/.eslintrc b/.eslintrc
index e68befa3..63314bc5 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -20,10 +20,7 @@
"no-eval": 0,
"no-unused-expressions": 0,
"guard-for-in": 0,
- "wrap-iife": [
- 2,
- "any"
- ],
+ "wrap-iife": [2, "any"],
"no-use-before-define": [
2,
{
diff --git a/.prettierignore b/.prettierignore
index 2e7c9157..a731c5df 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,5 +1,6 @@
-package-lock.json
coverage/
dist/
doc/
examples/browser/js/
+CHANGELOG.md
+package-lock.json
diff --git a/CHANGELOG.md b/CHANGELOG_old.md
index c90bd6d9..91036b0e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG_old.md
@@ -6,15 +6,18 @@ http://github.com/marak/faker.js
## v4.0.0
### Dist
+
- Update to latest gulp and mocha
### Docs
+
- `seed()` is on `faker`, not `random`
- Add section for setting seed
- Add Patreon campaign
- Fix demo URL in Readme
### API
+
- Add dataUri method
- Add additional https option for imageUrl
- Add exports for `az` locality
@@ -29,6 +32,7 @@ http://github.com/marak/faker.js
- Add IBAN and BIC generator functions
### Fix
+
- Fix amount and price argument dec for case = 0
- Default shuffle value
- Fix dec for amount in finance
@@ -43,6 +47,7 @@ http://github.com/marak/faker.js
- Correct spelling
### Locale
+
- Azerbaijani localization has been added
- Realistic Dutch city naming components
- Add `CZ` Czech
@@ -57,7 +62,7 @@ http://github.com/marak/faker.js
[fix] Prevent apostrophes in return value of internet#domainWords
[Fix] Display first month as 1 not 0.
[fix] random.uuid not using seeded number generator
-[fix] image api size check
+[fix] image api size check
[fix] update bower
[fix] implement street suffix
[fix] hacker.phrase - generate random string for each lexical instance
@@ -69,61 +74,60 @@ http://github.com/marak/faker.js
[api] Added randomness to image generation
[api] adjust findName method to allow for gender based prefixes
[api] [locale] Added basic support for generating UK postcodes
-[api] [locale] Added LV (Latvian) locale
+[api] [locale] Added LV (Latvian) locale
[api] [locale] Added date for Swedish locale
[api] Added better lorem methods
[api] Added system module
[api] Added finance.bitcoinAddress
```
-
## v3.0.0 - v2.0.0 - Missing
- See commit history on Github for change history
- http://github.com/marak/faker.js
+See commit history on Github for change history
+http://github.com/marak/faker.js
## v2.0.0
-* Adds i18n internalization of fake data sets
+- Adds i18n internalization of fake data sets
- contributed by Marak
-* Reduces surface of API, removes redundant API calls
+- Reduces surface of API, removes redundant API calls
- contributed by Marak
-* Replaces legacy build system with GulpJS
+- Replaces legacy build system with GulpJS
- contributed by Marak
-* Replaces legacy browserifying system with Browserify
+- Replaces legacy browserifying system with Browserify
- contributed by Marak
-* Adds basic financial generators
- - contributed by josefsalyer
-* Adds internet.userAgent using `random-ua` library
+- Adds basic financial generators
+ - contributed by josefsalyer
+- Adds internet.userAgent using `random-ua` library
- contributed by Marak
-* Adds currency codes and symbols using `random-ua` library
+- Adds currency codes and symbols using `random-ua` library
- contributed by MQuy
-* Replaces use of Math.random in favor of `node-mersenne` package
- - contributed by Marak
-* Adds bower support
- - contributed by daytonn
-* avatarUrl optimization
- - contributed by MQuy
-* Fix - Remove `this` scope
- - contributed by goliatone
-* Fix - IE9 charAt() bug
+- Replaces use of Math.random in favor of `node-mersenne` package
+ - contributed by Marak
+- Adds bower support
+ - contributed by daytonn
+- avatarUrl optimization
+ - contributed by MQuy
+- Fix - Remove `this` scope
+ - contributed by goliatone
+- Fix - IE9 charAt() bug
- contributed by beastlike
-* Fix - faker.date now returns a Date object instead of JSON
- - contributed by Marak
+- Fix - faker.date now returns a Date object instead of JSON
+ - contributed by Marak
-##v1.1.0
+## v1.1.0
-* Fixes random date functions that did not distribute results.
+- Fixes random date functions that did not distribute results.
- contributed by pmalouin
-* Fixes context of findName
+- Fixes context of findName
- contributed by juampi92
-* Updates to switch changes over to using 2 args to support min/max
+- Updates to switch changes over to using 2 args to support min/max
- contributed by avanderhoorn & edshadi
-* Added ISO 3166 countries
+- Added ISO 3166 countries
- contributed by MaerF0x0
-* UMD support
+- UMD support
- contributed by xaka
-* Uk Postal Codes
+- Uk Postal Codes
- contributed by schmtw
-* Undefined global object for webworker fix
+- Undefined global object for webworker fix
- contributed by dnbard
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c35c403f..ee788cf2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,7 +4,7 @@ welcome! If you can make `faker.js` better, please read the following contributi
# Important
-* Please make sure that you run both `gulp` and tests before making a PR.
+- Please make sure that you run both `gulp` and tests before making a PR.
## Support
@@ -13,13 +13,13 @@ browsers. Keep this in mind, when modifying and/or extending the sources.
## Automation
-* The project is being built by [gulp](http://gulpjs.com/) (see [gulpfile](build/gulpfile.js)), destination directory is [build/build](build/build)
-* The documentation is auto-generated, based on [build/src](build/src) markdown sources. If you modify the main [Readme.md](Readme.md) file, the Pull Request will be rejected, since it will be overwritten by the upcoming `gulp` execution
-* The tests are executing `mocha` against all js contents of [test](test) directory
+- The project is being built by [gulp](http://gulpjs.com/) (see [gulpfile](build/gulpfile.js)), destination directory is [build/build](build/build)
+- The documentation is auto-generated, based on [build/src](build/src) markdown sources. If you modify the main [Readme.md](Readme.md) file, the Pull Request will be rejected, since it will be overwritten by the upcoming `gulp` execution
+- The tests are executing `mocha` against all js contents of [test](test) directory
## Architecture
The sources are located in the [lib](lib) directory. All fake data generators are
divided into namespaces (each namespace being a separate module). Most of the
-generators use the *definitions*, which are just plain JavaScript
+generators use the _definitions_, which are just plain JavaScript
objects/arrays/strings that are separate for each [locale](lib/locales).
diff --git a/Readme.md b/README.md
index 1659df99..1d255427 100644
--- a/Readme.md
+++ b/README.md
@@ -30,7 +30,7 @@ Coming soon!
### Node.js
```js
-var faker = require("faker");
+var faker = require('faker');
var randomName = faker.name.findName(); // Rowan Nikolaus
var randomEmail = faker.internet.email(); // [email protected]
var randomCard = faker.helpers.createCard(); // random contact card containing many properties
@@ -271,7 +271,6 @@ var randomCard = faker.helpers.createCard(); // random contact card containing m
- vrm
- bicycle
-
### Faker.fake()
faker.js contains a super useful generator method `Faker.fake` for combining faker API methods using a mustache string format.
@@ -280,7 +279,7 @@ faker.js contains a super useful generator method `Faker.fake` for combining fak
```js
console.log(
- faker.fake("{{name.lastName}}, {{name.firstName}} {{name.suffix}}")
+ faker.fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}')
);
```
@@ -296,56 +295,55 @@ Setting a new locale is simple:
```js
// sets locale to de
-faker.locale = "de";
+faker.locale = 'de';
```
- - az
- - ar
- - cz
- - de
- - de_AT
- - de_CH
- - en
- - en_AU
- - en_AU_ocker
- - en_BORK
- - en_CA
- - en_GB
- - en_IE
- - en_IND
- - en_US
- - en_ZA
- - es
- - es_MX
- - fa
- - fi
- - fr
- - fr_CA
- - fr_CH
- - ge
- - hy
- - hr
- - id_ID
- - it
- - ja
- - ko
- - nb_NO
- - ne
- - nl
- - nl_BE
- - pl
- - pt_BR
- - pt_PT
- - ro
- - ru
- - sk
- - sv
- - tr
- - uk
- - vi
- - zh_CN
- - zh_TW
-
+- az
+- ar
+- cz
+- de
+- de_AT
+- de_CH
+- en
+- en_AU
+- en_AU_ocker
+- en_BORK
+- en_CA
+- en_GB
+- en_IE
+- en_IND
+- en_US
+- en_ZA
+- es
+- es_MX
+- fa
+- fi
+- fr
+- fr_CA
+- fr_CH
+- ge
+- hy
+- hr
+- id_ID
+- it
+- ja
+- ko
+- nb_NO
+- ne
+- nl
+- nl_BE
+- pl
+- pt_BR
+- pt_PT
+- ro
+- ru
+- sk
+- sv
+- tr
+- uk
+- vi
+- zh_CN
+- zh_TW
### Individual Localization Packages
@@ -357,7 +355,7 @@ In a production environment, you may only want to include the locale data for a
```js
// loads only de locale
-var faker = require("faker/locale/de");
+var faker = require('faker/locale/de');
```
## Setting a randomness seed
@@ -421,8 +419,8 @@ http://github.com/marak/faker.js/
faker.js was inspired by and has used data definitions from:
- * <https://github.com/stympy/faker/> - Copyright (c) 2007-2010 Benjamin Curtis
- * <http://search.cpan.org/~jasonk/Data-Faker-0.07/> - Copyright 2004-2005 by Jason Kohles
+- <https://github.com/stympy/faker/> - Copyright (c) 2007-2010 Benjamin Curtis
+- <http://search.cpan.org/~jasonk/Data-Faker-0.07/> - Copyright 2004-2005 by Jason Kohles
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/conf.json b/conf.json
index 03d1141e..e4fd230b 100644
--- a/conf.json
+++ b/conf.json
@@ -8,7 +8,5 @@
"exclude": ["./lib/locales"]
},
- "plugins": [
- "plugins/markdown"
- ]
+ "plugins": ["plugins/markdown"]
}
diff --git a/gulpfile.js b/gulpfile.js
index a7a60ff3..99276c1a 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,11 +1,11 @@
function defaultTask(cb) {
// place code for your default task here
- console.log('please run gulp --tasks to see available tasks for faker.js')
- console.log('you can then try running a command like `gulp jsdoc`')
+ console.log('please run gulp --tasks to see available tasks for faker.js');
+ console.log('you can then try running a command like `gulp jsdoc`');
cb();
}
exports.browser = require('./build/gulp-tasks/browser');
exports.jsdoc = require('./build/gulp-tasks/jsdoc');
-exports.default = defaultTask \ No newline at end of file
+exports.default = defaultTask;
diff --git a/index.js b/index.js
index 828f061d..789fefd6 100644
--- a/index.js
+++ b/index.js
@@ -1,4 +1,4 @@
// since we are requiring the top level of faker, load all locales by default
var Faker = require('./lib');
var faker = new Faker({ locales: require('./lib/locales') });
-module['exports'] = faker; \ No newline at end of file
+module['exports'] = faker;