We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/Microsoft/vscode/blob/fe9539a05ffb89bea781e7a4e7f7029980b30686/src/vs/base/common/uri.ts#L100
The return type of Uri.isUri being uri is Uri is problematic since it can have us write code like this:
Uri.isUri
uri is Uri
const obj = { authority: '', fragment: '', path: '', query: '', scheme: '' }; if (isUri(obj)) { console.log(obj.fsPath.length); }
TypeScript will gladly compile this without errors, yet the end result will be an NPE.
We should change that return type to simply boolean.
boolean
The text was updated successfully, but these errors were encountered:
good catch
Sorry, something went wrong.
f2e2024
jrieken
No branches or pull requests
https://github.com/Microsoft/vscode/blob/fe9539a05ffb89bea781e7a4e7f7029980b30686/src/vs/base/common/uri.ts#L100
The return type of
Uri.isUri
beinguri is Uri
is problematic since it can have us write code like this:TypeScript will gladly compile this without errors, yet the end result will be an NPE.
We should change that return type to simply
boolean
.The text was updated successfully, but these errors were encountered: