-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): widen too-narrow types (#102)
* fix(types): widen too-narrow types Since many functions accept `number`, which is then coerced to `string`, we need to account for that. `Record<string, string>` for the type of `T` _would_ be fine, except: 1. `ProcessEnv` is `Record<string, undefined>`. I'm guessing since you can write `process.env.cows = undefined`. However, everything coming out of the actual environment in `process.env` is a `string`. 2. An empty object literal is not a `Record`, but it is an `object`. So we have to loosen the type arg `T` to extend `object`. * chore(test): add types to tests and add a second fixture - Renamed the existing fixture to `ts-project-module-nodenext` - Added a new fixture `ts-project-module-commonjs` which is identical except it uses the `commonjs` `module` option and thus `node` `moduleResolution`
- Loading branch information
Showing
17 changed files
with
6,499 additions
and
1,062 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var env_1 = require("@humanwhocodes/env"); | ||
var env = new env_1.Env(); | ||
var username = env.get("USERNAME"); |
File renamed without changes.
Oops, something went wrong.