mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
changelog-parser: switch the callback params (#34204)
* changelog-parser: switch the callback params * changelog-parser: stricter tests
This commit is contained in:
parent
8358bee6b8
commit
5033db6098
@ -5,12 +5,20 @@ const options = {
|
||||
removeMarkdown: false
|
||||
};
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result, error) => {});
|
||||
const fn = (obj: object): void => {};
|
||||
|
||||
parseChangelog(options, (result, error) => {});
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error, result) => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (result) => {});
|
||||
fn(result);
|
||||
});
|
||||
|
||||
parseChangelog(options);
|
||||
parseChangelog(options, (error, result) => {});
|
||||
|
||||
parseChangelog('path/to/CHANGELOG.md');
|
||||
parseChangelog({filePath: 'path/to/CHANGELOG.md'}, (error) => {});
|
||||
|
||||
parseChangelog(options).then((result) => {});
|
||||
|
||||
parseChangelog('path/to/CHANGELOG.md').then((result) => {});
|
||||
|
||||
3
types/changelog-parser/index.d.ts
vendored
3
types/changelog-parser/index.d.ts
vendored
@ -19,6 +19,7 @@ interface Options {
|
||||
/**
|
||||
* Change log parser for node.
|
||||
*/
|
||||
declare function parseChangelog(options: Partial<Options>|string, callback?: (result: object, error: string|null) => void): Promise<object>;
|
||||
declare function parseChangelog(options: Partial<Options>|string,
|
||||
callback?: (error: string|null, result: object) => void): Promise<object>;
|
||||
|
||||
export = parseChangelog;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user