diff --git a/types/toposort/index.d.ts b/types/toposort/index.d.ts index c2c9940c3a..ed94597140 100644 --- a/types/toposort/index.d.ts +++ b/types/toposort/index.d.ts @@ -1,7 +1,8 @@ // Type definitions for toposort 2.0 // Project: https://github.com/marcelklehr/toposort // Definitions by: Daniel Byrne +// Prokop Simek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function toposort(graph: ReadonlyArray<[string, string]>): ReadonlyArray; +declare function toposort(graph: Array<[string, string | undefined]>): string[]; export = toposort; diff --git a/types/toposort/toposort-tests.ts b/types/toposort/toposort-tests.ts index 84f554033b..9dcd4fa10d 100644 --- a/types/toposort/toposort-tests.ts +++ b/types/toposort/toposort-tests.ts @@ -1,10 +1,11 @@ import toposort = require('toposort'); -const testGraph: ReadonlyArray<[string, string]> = [ - ["string1", "string2"], - ["string2", "string3"], - ["string3", "string1"] +const testGraph: Array<[string, string | undefined]> = [ + ['string1', 'string2'], + ['string2', 'string3'], + ['string3', 'string1'], + ['string4', undefined], ]; -// $ExpectType ReadonlyArray +// $ExpectType string[] toposort(testGraph);