Skip to content

Commit 6d9b3a2

Browse files
committed
Profession 2.0.0
1 parent 7982802 commit 6d9b3a2

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<a name="2.0.0"></a>
2+
# [2.0.0](https://github.com/faker-javascript/profession) (2022-01-09)
3+
4+
### BREAKING CHANGES
5+
6+
* New function `profession` istead of `fakeProfession`
7+
18
<a name="1.0.0"></a>
29
# [1.0.0](https://github.com/faker-javascript/profession) (2022-01-09)
310
* Initial release

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ $ npm install --save @fakerjs/profession
1515
## Usage
1616

1717
```js
18-
import fakeProfession from '@fakerjs/profession';
18+
import profession from '@fakerjs/profession';
1919

20-
fakeProfession();
20+
profession();
2121
//=> Software Engineer
2222

23-
fakeProfession({rank: true});
23+
profession({rank: true});
2424
//=> Lead Software Engineer
2525

26-
fakeProfession({rank: true, locale: 'en_US'});
26+
profession({rank: true, locale: 'en_US'});
2727
//=> Lead Software Engineer
2828

29-
// Allowed ranks: true, false
30-
// Allowed locales: en_US
29+
// Allowed rank: true, false
30+
// Allowed locale: en_US
3131
```
3232

3333
## Tests

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default function fakeProfession(options) {
1+
export default function profession(options) {
22
options = options || {};
33
let ranks = {
44
"en_US": [
@@ -401,7 +401,7 @@ export default function fakeProfession(options) {
401401
"Warehouse Manager"
402402
]
403403
};
404-
let locale = ((options.locale === undefined) ? 'en_US' : options.locale);
404+
let locale = options.locale || 'en_US';
405405
let randomProfession = professions[locale][Math.floor(Math.random() * professions[locale].length)];
406406
if (options.rank) {
407407
return ranks[locale][Math.floor(Math.random() * ranks[locale].length)] + ' ' + randomProfession;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fakerjs/profession",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Profession package provides functionality to generate a fake profession value.",
55
"license": "MIT",
66
"repository": "faker-javascript/profession",
@@ -25,6 +25,7 @@
2525
],
2626
"keywords": [
2727
"fakerjs",
28+
"faker",
2829
"fake",
2930
"random",
3031
"profession",

test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import fakeProfession from './index.js';
1+
import profession from './index.js';
22
import test from 'ava';
33

4-
test('fakeProfession return type to be string', t => {
5-
t.is(typeof fakeProfession(), 'string');
4+
test('profession return type to be string', t => {
5+
t.is(typeof profession(), 'string');
66
});
77

8-
test('fakeProfession with rank return type to be string', t => {
9-
t.is(typeof fakeProfession({rank: true}), 'string');
8+
test('profession with rank return type to be string', t => {
9+
t.is(typeof profession({rank: true}), 'string');
1010
});

0 commit comments

Comments
 (0)