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

More strict type checks #15189

Merged
merged 1 commit into from Sep 28, 2023
Merged

More strict type checks #15189

merged 1 commit into from Sep 28, 2023

Conversation

MoonE
Copy link
Contributor

@MoonE MoonE commented Sep 27, 2023

No description provided.

@github-actions
Copy link

📦 Preview the website for this branch here: https://deploy-preview-15189--ol-site.netlify.app/.

Comment on lines 268 to 269
x = Math.floor(/** @type {number} */ (x) / 2);
y = Math.floor(/** @type {number} */ (y) / 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if these type casts could be avoided when the wrapping if clause is changed from

if (this.zoomFactor_ === 2) {

to

if (x !== undefined && y !== undefined) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works.

@MoonE MoonE merged commit 968ea99 into openlayers:main Sep 28, 2023
8 checks passed
@MoonE MoonE deleted the strict-type-checking branch September 28, 2023 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants