-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move lat, long parsing and validations logic into GeoPoint #2290
Move lat, long parsing and validations logic into GeoPoint #2290
Conversation
This logic will be removed from Viewfinder in future commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I approve this PR once we add some input validation checks, i.e. verifying that variables like value
are not only present but also of the expected type (string
).
}); | ||
|
||
describe("Detecting latitude, longitude in string", () => { | ||
it('accepts empty string', () => { | ||
expect(GeoPoint.couldBeLatLong('')).to.be.true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why could an empty string be a lat, long pair? maybe it's just the name of the function that is confusing me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just mean for this function to disqualify strings from being a lat,long pair and not necessarily that they are a lat,long pair. For example, "13" could be a lat,long pair, because it doesn't have any disqualifying characters in it, though it is not a valid lat,long pair.
a137d9e
to
733403b
Compare
Add type safety checks.
733403b
to
6e7892f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one quick change so that parse always returns a response that backbone expects
Co-authored-by: Robyn <[email protected]>
0b1ff8c
into
NCEAS:feature-1796-places-autocomplete
This logic will be removed from Viewfinder in future commit.
#1796