Is isCorrect a replacement for isValid?
See original GitHub issueWhile updating to ip-address
v7 I noticed that isValid
is gone.
Is isCorrect
a replacement for that?
const address = new Address4(unknownAddress)
address.isCorrect()
You suggest using a try / catch
but my problem is that my linter complains both when I do this:
try {
new Address4(address)
} catch {
return 'Invalid address'
}
Do not use 'new' for side effects.
and this:
try {
const ipv4Address = new Address4(address)
} catch {
return 'Invalid address'
}
'ipv4Address' is declared but its value is never read. ts(6133)
'ipv4Address' is assigned a value but never used. eslint@typescript-eslint/no-unused-vars
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Check if date is a valid one - Stack Overflow
Was able to find the solution. Since the date I am getting is in ISO format, only providing date to moment will validate...
Read more >[v2] isValid=true on mount, even though initialValues ... - GitHub
Bug report Current Behavior isValid is true once the form mounts, even though ... during mount, so that isValid's initial value is correct....
Read more >Differences in @Valid and @Validated Annotations in Spring
In this quick tutorial, we'll focus on the differences between the @Valid and @Validated annotations in Spring.
Read more >IsValid? Is failing even though setup is correct?
So my issue is I recently had to change some meshes on my main character and delete the old Animation blueprint and make...
Read more >How to verify that strings are in valid email format
Using a regular expression to validate an email is useful to ensure that the structure of an email is correct. However, it isn't...
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 FreeTop 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
Top GitHub Comments
@lekoaf @nrone @jcheng5 I added a static
isValid
method in the just-released 7.1.0; you can use it like this:Same here,
isValid
is mostly what I was using this library for.