question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

parse params and

See original GitHub issue

is there a way to specify that Params and Query be injected as a number instead of a string?

@Get("validate/:code?")
codes(@Param("code") code : number) {
	return ValidationService.validate(number); // error: currently gets passed as a string
}

I know I can use parseInt(code) but i am wondering if there is a more elegant way of specifying to the injector to return the param as a number.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

How do I parse a URL query parameters, in Javascript?
2 Answers 2 · 7. Each item should be url decoded using decodeURIComponent() · 2. Both the parameter name and value must be...
Read more >
Free Online Url Parser / Query String Splitter
This free online tool lets you parse complex urls into parts and splits the query string into a readable format.
Read more >
How to Get URL Parameters with JavaScript - SitePoint
In this article, we'll show you how to parse and manipulate URL parameters using JavaScript. Getting a URL Parameter. In modern browsers, this ......
Read more >
Don't ever write your own function to parse URL parameters
Don't ever write your own function to parse URL parameters. A line of code that reads `parse('foo=bar');. Published on Apr 11, 2021 by...
Read more >
Dynamically Parse URL Query String Parameters into an ...
Dynamically Parse URL Query String Parameters into an Object with JavaScript Code ... We do our best to ensure that the code in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found