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.

Difference between isCorrent and isValid

See original GitHub issue

The semantics of isCorrect and isValid in Address4 and Address6 are not obvious and should be part of the documentation.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
beaugundersoncommented, Mar 8, 2018

isValid() returns true if the address is valid, meaning it parses successfully/does not contain errors

isCorrect() should probably be renamed to avoid confusion; isPreferredForm() probably better captures the meaning…

an address like ffff:000f:: is valid but not “correct” or the “preferred form” because it contains leading zeroes, in this example (the “preferred form” would be ffff:f::)

more information on IPv6 preferred form here: https://tools.ietf.org/html/rfc5952#page-10

similarly for IPv4 an address like 192.168.000.001 is valid but not correct/preferred (192.168.0.1 would be the correct/preferred form)

make more sense?

0reactions
ataliscommented, Mar 8, 2018

Thanks! Makes perfect sense!

Read more comments on GitHub >

github_iconTop Results From Across the Web

UsernameToken.IsCurrent Property (Microsoft.Web.Services3 ...
The IsCurrent and IsExpired properties both indicate whether a security token is valid. The difference, is that a security token with an IsCurrent...
Read more >
Issues · beaugunderson/ip-address - GitHub
a library for parsing and manipulating IPv4 and IPv6 addresses in JavaScript - Issues ... Difference between isCorrent and isValid. #68 opened on...
Read more >
Docs - Moment.js
Note: Moments are created at evaluation time, so moment().diff(moment()) may not ... isValid(); // true moment('It is 2012-05-25', 'YYYY-MM-DD', true).
Read more >
Difference between date-fns' isValid and luxon's isValid
The invoked date string variable with new Date() in date-fns it returns false but in luxon it return true. I shared my code...
Read more >
Class MultipleChoiceItem | Apps Script - Google Developers
createChoice(value, isCorrect), Choice, Creates a new choice. ... response, String, a valid answer for this multiple-choice item ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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