mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 13:37:35 +00:00
Fix nodegit Tree#getEntry return type (#38276)
As per the documentation, Tree#getEntry is an async function and thus returns a Promise. See: https://www.nodegit.org/api/tree/#getEntry
This commit is contained in:
parent
7cc4e18aed
commit
c56d400a17
1
types/nodegit/index.d.ts
vendored
1
types/nodegit/index.d.ts
vendored
@ -3,6 +3,7 @@
|
||||
// Definitions by: Dolan Miu <https://github.com/dolanmiu>,
|
||||
// Tobias Nießen <https://github.com/tniessen>,
|
||||
// Pierre Vigier <https://github.com/pvigier>
|
||||
// Jibril Saffi <https://github.com/IGI-111>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export { AnnotatedCommit } from './annotated-commit';
|
||||
|
||||
@ -14,6 +14,9 @@ const ref = new Git.Reference();
|
||||
const tree = new Git.Tree();
|
||||
|
||||
tree.walk().start();
|
||||
tree.getEntry("/").then(entry => {
|
||||
// Use entry
|
||||
});
|
||||
|
||||
// AnnotatedCommit Tests
|
||||
|
||||
|
||||
2
types/nodegit/tree.d.ts
vendored
2
types/nodegit/tree.d.ts
vendored
@ -50,7 +50,7 @@ export class Tree {
|
||||
/**
|
||||
* Get an entry at a path. Unlike by name, this takes a fully qualified path, like /foo/bar/baz.javascript
|
||||
*/
|
||||
getEntry(filePath: string): TreeEntry;
|
||||
getEntry(filePath: string): Promise<TreeEntry>;
|
||||
/**
|
||||
* Return an array of the entries in this tree (excluding its children).
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user