Skip to content

Commit e97a001

Browse files
committed
Animal 2.1.0
1 parent cb7e44b commit e97a001

File tree

8 files changed

+50
-29
lines changed

8 files changed

+50
-29
lines changed

.editorconfig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# EditorConfig: http://EditorConfig.org
1+
# EditorConfig is awesome: https://EditorConfig.org
22

3-
# top-most EditorConfig file
43
root = true
54

6-
# Unix-style newlines with a newline ending every file
75
[*]
8-
charset = utf-8
96
end_of_line = lf
10-
trim_trailing_whitespace = true
117
insert_final_newline = true
8+
9+
[*.{js,d.ts,ts}]
10+
charset = utf-8
11+
trim_trailing_whitespace = true
1212
indent_style = space
1313
indent_size = 4
1414

15-
# 2 space indentation
16-
[*.yaml, *.yml]
15+
[package.json,*.yaml]
1716
indent_style = space
1817
indent_size = 2

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<a name="2.1.0"></a>
2+
# [2.1.0](https://github.com/faker-javascript/animal) (2022-01-11)
3+
* Added xo, tsd, c8.
4+
* Improved tests.
5+
16
<a name="2.0.1"></a>
27
# [2.0.1](https://github.com/faker-javascript/animal) (2022-01-10)
38
* GitHub docs updates.

index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
interface Options {
2+
type?: string;
3+
locale?: string;
4+
}
5+
export default function animal(options?: Options): string;

index.js

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.test-d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {expectType} from 'tsd';
2+
import animal from './index.js';
3+
4+
expectType<string>(animal());
5+
expectType<string>(animal({type: 'zoo'}));
6+
expectType<string>(animal({locale: 'en_US'}));
7+
expectType<string>(animal({type: 'zoo', locale: 'en_US'}));

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fakerjs/animal",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Animal package provides functionality to generate a fake animal value.",
55
"license": "MIT",
66
"repository": "faker-javascript/animal",
@@ -15,14 +15,17 @@
1515
"node": ">=12"
1616
},
1717
"scripts": {
18-
"test": "c8 ava"
18+
"test": "c8 ava; xo --space 4; tsd;"
1919
},
2020
"devDependencies": {
21-
"ava": "^3.15.0",
22-
"c8": "^7.11.0"
21+
"ava": "^4.0.0",
22+
"c8": "^7.11.0",
23+
"tsd": "^0.19.1",
24+
"xo": "^0.47.0"
2325
},
2426
"files": [
25-
"index.js"
27+
"index.js",
28+
"index.d.ts"
2629
],
2730
"keywords": [
2831
"fakerjs",

test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import animal from './index.js';
21
import test from 'ava';
2+
import animal from './index.js';
33

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

88
test('animal with type and locale return type to be string', t => {
9-
t.is(typeof animal({type: 'zoo', locale: 'en_US'}), 'string');
10-
});
9+
t.is(typeof animal({type: 'zoo', locale: 'en_US'}), 'string');
10+
});

0 commit comments

Comments
 (0)