Repository navigation
Type process.env and fs.rm options with undefined, as @types/node does - #60193
Merged
Merged
Conversation
…ode` does Summary: X-link: react/metro#2261 The Node library definitions typed `process.env` values as `string | void`, and the optional `RmOptions` fields as `T | void`. `types/node` uses `undefined` in both places: ``` env: {[key: string]: string | undefined, ...}; force?: boolean | undefined, ``` Library definitions accept `undefined` without any `.flowconfig` option, and Flow treats it the same as `void`, so this changes nothing for code that checks against these definitions today. It matters for projects that give `void` TypeScript's meaning, where `undefined` is the type of a missing value and `void` is not. Metro's copy of these definitions gets the same change, so the two stay identical. Changelog: [Internal] Differential Revision: D133561233
|
@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133561233. |
Collaborator
|
This pull request was successfully merged by @SamChou19815 in 32a5aa6 When will my fix make it into a release? | How to file a pick request? |
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.
Summary:
X-link: react/metro#2261
The Node library definitions typed
process.envvalues asstring | void, and the optionalRmOptionsfields asT | void.types/nodeusesundefinedin both places:Library definitions accept
undefinedwithout any.flowconfigoption, and Flow treats it the same asvoid, so this changes nothing for code that checks against these definitions today. It matters for projects that givevoidTypeScript's meaning, whereundefinedis the type of a missing value andvoidis not.Metro's copy of these definitions gets the same change, so the two stay identical.
Changelog: [Internal]
Differential Revision: D133561233