Skip to content

ts.sys.getModifiedTime has wrong return type #25667

@AviVahl

Description

@AviVahl

Tiny issue. ts.sys.getModifiedTime has the following signature:

getModifiedTime?(path: string): Date;

But it actually returns undefined for invalid paths.

TypeScript Version: 2.9.2

Search Terms:
getModifiedTime

Code

const modifiedTime = ts.sys.getModifiedTime(`/invalid/path`)

Expected behavior:
Signature should match implementation. In this case:

getModifiedTime?(path: string): Date | undefined;

Actual behavior:
Return type can be undefined
Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIRelates to the public API for TypeScriptBugA bug in TypeScriptFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions