{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4905","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4905/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4905/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4905/events","html_url":"https://github.com/Microsoft/TypeScript/issues/4905","id":107607575,"number":4905,"title":"\"design:paramnames\" metadata key","user":{"login":"remojansen","id":10656223,"avatar_url":"https://avatars.githubusercontent.com/u/10656223?v=3","gravatar_id":"","url":"https://api.github.com/users/remojansen","html_url":"https://github.com/remojansen","followers_url":"https://api.github.com/users/remojansen/followers","following_url":"https://api.github.com/users/remojansen/following{/other_user}","gists_url":"https://api.github.com/users/remojansen/gists{/gist_id}","starred_url":"https://api.github.com/users/remojansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remojansen/subscriptions","organizations_url":"https://api.github.com/users/remojansen/orgs","repos_url":"https://api.github.com/users/remojansen/repos","events_url":"https://api.github.com/users/remojansen/events{/privacy}","received_events_url":"https://api.github.com/users/remojansen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/In%20Discussion","name":"In Discussion","color":"556b75"},{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Suggestion","name":"Suggestion","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-21T22:00:45Z","updated_at":"2016-01-01T08:24:52Z","closed_at":null,"body":"From https://github.com/Microsoft/TypeScript/pull/2589\r\n\r\n> A few notes on metadata:\r\n> - Type metadata uses the metadata key \"design:type\".\r\n> - Parameter type metadata uses the metadata key \"design:paramtypes\".\r\n> - Return type metadata uses the metadata key \"design:returntype\".\r\n\r\nCan you please add support for a `\"design:paramnames\"` metadata key? It would return the design-time names of the arguments of a function\r\n\r\nI can convert a function to string at runtime using [Function.prototype.toString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/toString) and then use a couple of Regex to get the parameter names:\r\n\r\n```\r\nSTRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\r\nARGUMENT_NAMES = /([^\\s,]+)/g;\r\n```\r\n\r\nBut when a minifier/compressor is used the param names become `\"a\"`, `\"b\"` ... \r\n\r\nI would like to have a way to access the design-time names of the arguments of a function at run-time even after compression."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/168291658","html_url":"https://github.com/Microsoft/TypeScript/issues/4905#issuecomment-168291658","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/4905","id":168291658,"user":{"login":"Joshua-F","id":924482,"avatar_url":"https://avatars.githubusercontent.com/u/924482?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-F","html_url":"https://github.com/Joshua-F","followers_url":"https://api.github.com/users/Joshua-F/followers","following_url":"https://api.github.com/users/Joshua-F/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-F/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-F/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-F/subscriptions","organizations_url":"https://api.github.com/users/Joshua-F/orgs","repos_url":"https://api.github.com/users/Joshua-F/repos","events_url":"https://api.github.com/users/Joshua-F/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-F/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T08:24:52Z","updated_at":"2016-01-01T08:24:52Z","body":"I would love to see this added."}}