fix: make the return type of scan function nullable#51
Open
mikavilpas wants to merge 1 commit intoeuberdeveloper:mainfrom
Open
fix: make the return type of scan function nullable#51mikavilpas wants to merge 1 commit intoeuberdeveloper:mainfrom
mikavilpas wants to merge 1 commit intoeuberdeveloper:mainfrom
Conversation
Issue ===== Looking at the return type of `scan()`, it is not nullable, which hints at it throwing an error. However, in practice it does not throw an error and returns `null` when the path does not exist. Solution ======== Make the return type of `scan()` nullable to indicate that the caller should check if it succeeded.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Author
|
This is a very minimal change - a lot of type errors are currently hidden. To see all of these errors, this change can be applied to see them: diff --git a/tsconfig.json b/tsconfig.json
index d8b18b7..7d5dced 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -8,6 +8,7 @@
"DOM"
],
"sourceMap": true,
+ "strict": true,
"declaration": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
@@ -17,4 +18,4 @@
"source",
"scripts"
]
-}
\ No newline at end of file
+}And then running |
mikavilpas
added a commit
to mikavilpas/tui-sandbox
that referenced
this pull request
Feb 15, 2025
mikavilpas
added a commit
to mikavilpas/tui-sandbox
that referenced
this pull request
Feb 15, 2025
mikavilpas
added a commit
to mikavilpas/tui-sandbox
that referenced
this pull request
Feb 15, 2025
#290) * fix: build an empty schema when trying to scan a nonexistent directory euberdeveloper/dree#51 * fixup! fix: build an empty schema when trying to scan a nonexistent directory
Author
|
@euberdeveloper what do you think? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Looking at the return type of
scan(), it is not nullable, which hints at it throwing an error. However, in practice it does not throw an error and returnsnullwhen the path does not exist.Solution
Make the return type of
scan()nullable to indicate that the caller should check if it succeeded.