Skip to content
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

Fix correct waypoints type to be nullish #112

Merged
merged 1 commit into from
Jan 17, 2022
Merged

Fix correct waypoints type to be nullish #112

merged 1 commit into from
Jan 17, 2022

Conversation

hishtadlut
Copy link
Contributor

I was getting build errors saying

Property 'waypoints' is missing in type '{ origin: MarkerOptions; destination: MarkerOptions; }' but required in type '{ origin: 
MarkerOptions; destination: MarkerOptions; waypoints: MarkerOptions; }'.

After checking the docs and the types of the library I found a mismatch.

Library types:

markerOptions: {
      origin: google.maps.MarkerOptions;
      destination: google.maps.MarkerOptions;
      waypoints: google.maps.MarkerOptions;
};

While in the docs

waypoints[] (optional) specifies an array of DirectionsWaypoints. Waypoints alter a route by routing it through the specified location(s). A waypoint is specified as an object literal with fields shown below:

so I just added a question mark to the type.

so now it is:

markerOptions: {
      origin: google.maps.MarkerOptions;
      destination: google.maps.MarkerOptions;
      waypoints**?**: google.maps.MarkerOptions;
};

@explooosion explooosion added the bug Indicates an unexpected problem or unintended behavior label Jan 17, 2022
@explooosion
Copy link
Owner

Thank you for everything !

@explooosion explooosion self-requested a review January 17, 2022 11:20
@explooosion explooosion merged commit c2d23cb into explooosion:master Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants