Skip to content

Commit 5901a35

Browse files
author
roman.vasilev
committed
Docs: Updated API docs
1 parent 49c3075 commit 5901a35

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# git-last-changed-files
22
Get last changed files from git history commits
3+
Uses `git diff-tree` under the hood.
34

45
INSTALL
56
---
@@ -10,9 +11,40 @@ npm install git-last-changed-files
1011
USAGE
1112
---
1213
```ts
13-
import { lastChangesFilesSync } from 'git-last-changed-files';
14+
import { lastChangesSync } from 'git-last-changed-files';
1415

15-
lastChangesFilesSync({ test, size = 10, from = size, to = 0, count = countCommits() })
16+
lastChangesSync(options: Options): string[]
17+
```
18+
19+
API
20+
---
21+
```ts
22+
type Options = {
23+
/**
24+
* Filter files by this anymatch.Matcher.
25+
* If not set match to any file.
26+
* https://github.com/micromatch/anymatch#anymatch-matchers-teststring-returnindex-startindex-endindex
27+
* Default: null
28+
*/
29+
test?: anymatch.Matcher;
30+
/**
31+
* Page size for checking git history.
32+
* Default: 10
33+
*/
34+
size?: number;
35+
/**
36+
* Begin from commit.
37+
*/
38+
from?: number;
39+
/**
40+
* End to commit.
41+
*/
42+
to?: number;
43+
/**
44+
* See changes recursively (flag `-r`)
45+
*/
46+
recursive?: boolean;
47+
};
1648
```
1749

1850
CHANGELOG

src/index.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,32 @@ function countCommits() {
99
}
1010

1111
type Options = {
12+
/**
13+
* Filter files by this anymatch.Matcher.
14+
* If not set match to any file.
15+
* https://github.com/micromatch/anymatch#anymatch-matchers-teststring-returnindex-startindex-endindex
16+
* Default: null
17+
*/
1218
test?: anymatch.Matcher;
19+
/**
20+
* Page size for checking git history.
21+
* Default: 10
22+
*/
1323
size?: number;
24+
/**
25+
* Begin from commit.
26+
*/
1427
from?: number;
28+
/**
29+
* End to commit.
30+
*/
1531
to?: number;
16-
count?: number;
32+
/**
33+
* See changes recursively (flag `-r`)
34+
*/
1735
recursive?: boolean;
36+
/** @internal */
37+
count?: number;
1838
};
1939

2040
export function lastChangesSync({ test, size = 10, from = size, to = 0, count = countCommits(), recursive = true }: Options = {}): string[] {

0 commit comments

Comments
 (0)