Comments (4)
This feels kind of stage. @Retro64 is this a common practice ? Doesn't anyone with a good TS experience could validate ?
from node-http-status.
Minimum example, why this might be dangerous:
import * as HttpStatus from 'http-status';
const foo = (bar: string) =>
console.log(bar.toLowerCase);
const test = HttpStatus[777];
foo(test);
Compiles properly, as test is typed as string, fails at runtime, as test is no string. Indicating it might be undefined leads to a warning it might not be defined during compile time.
from node-http-status.
OK, I get it, thank you. Please prepare a PR.
from node-http-status.
PR is open: #44
from node-http-status.
Related Issues (20)
- add 424 status HOT 1
- Failed to work with typescript: "Cannot find module 'http-status'" HOT 2
- Typo: MOVED_PERMAMENTLY HOT 2
- Support for unofficial codes? HOT 3
- Github description links to 404 page HOT 1
- Wrong keys for 305_MESSAGE and 305_NAME HOT 1
- Double 420 HOT 1
- Error TS2714 with TypeScript definition file HOT 6
- Typescript dynamic show status name HOT 2
- Status 502 Missing Message and Code HOT 1
- intl HOT 1
- Expose status code series? HOT 1
- doc bug: s/_CODE/_NAME/ HOT 1
- Modify interface typing HOT 6
- HTTP 425 Too Early HOT 1
- Unable to properly infer numeric keys in TypeScript type with mixed key types HOT 4
- literate version of the source code HOT 4
- 300 message bug at npm package release HOT 1
- 300 message bug at npm package release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-http-status.