-
-
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: use TypeScript overloading (#99)
TS v5 introduced `@overload` in JavaScript, so we can now do this. In addition, created an (optional--non-breaking) generic `T` which is the `source` prop of `Env`, which provides a narrower type if desired. - Fixed a couple problems around incompatible use of `PropertyKey` - Added `@types/node` for `process.env` type - Added `@tsconfig/node16` to use a reasonable configuration targeting Node.js v16.x
- Loading branch information
Showing
4 changed files
with
99 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
{ | ||
"include": [ | ||
"extends": "@tsconfig/node16/tsconfig.json", | ||
"files": [ | ||
"src/env.js" | ||
], | ||
"compilerOptions": { | ||
"declaration": true, | ||
"emitDeclarationOnly": true, | ||
"allowJs": true, | ||
"checkJs": true, | ||
"target": "ES2015", | ||
"outDir": "dist" | ||
"outDir": "dist", | ||
"types": ["node"] | ||
} | ||
} |