"design:paramnames" metadata key
See original GitHub issueFrom https://github.com/Microsoft/TypeScript/pull/2589
A few notes on metadata:
- Type metadata uses the metadata key “design:type”.
- Parameter type metadata uses the metadata key “design:paramtypes”.
- Return type metadata uses the metadata key “design:returntype”.
Can you please add support for a "design:paramnames"
metadata key? It would return the design-time names of the arguments of a function
I can convert a function to string at runtime using Function.prototype.toString() and then use a couple of Regex to get the parameter names:
STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
ARGUMENT_NAMES = /([^\s,]+)/g;
But when a minifier/compressor is used the param names become "a"
, "b"
…
I would like to have a way to access the design-time names of the arguments of a function at run-time even after compression.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Class Metadata.Key<T> - gRPC on GitHub
Key for metadata entries. Allows for parsing and serialization of metadata. Valid characters in key names. Only the following ASCII characters are allowed ......
Read more >How to use of method in io.grpc.Metadata$Key - Java - Tabnine
Entry<String, String> entry : headers.entrySet()) { headersAsMetadataBuilder.put( Metadata.Key.of(entry.getKey(), Metadata.ASCII_STRING_MARSHALLER), entry.
Read more >Configuration Metadata - Spring
Keys are logger names, and values correspond to the standard log levels or any custom level. As Spring Boot defines a few logger...
Read more >Configuring the Metadata Schema - DAMsuccess by Webdam
Metadata is the information used to describe an asset and the primary driver of search. It not only enhances searchability, but can also...
Read more >The 14 Best Metadata Management Tools for 2022
Solutions Review has compiled this list of the best Metadata ... and maintain key business terms and link them to physical data assets, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1. At LoopBack, we introduce decorators to annotate method parameters to describe how to map methods to REST APIs. It will be great that we can infer parameter types/names from the design time metadata. For example:
Duplicate https://github.com/Microsoft/TypeScript/issues/12626