You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current API does not validate method arguments, coerce types, or make any defensive copies on input or output. This can lead to delayed failures; for example,
a div might be used for the map container rather than an svg
a string might be used for the map zoom rather than a number
the tile size might be set as a number rather than {x: number, y: number}
the lat or lon attributes of map.center() might be modified directly
Protecting against all types of errant usage might present an undue burden on the library implementors, but we should be able to protect against the more obvious mistakes and make the library more robust. The code size and runtime performance costs will hopefully be outweighed by the benefits of a easier debugging / more predictable failure modes.
Once all input types are appropriately coerced we should also be able to avoid the type-coercing equality operators; i.e., use === and !== instead of == and !=.
The text was updated successfully, but these errors were encountered:
The current API does not validate method arguments, coerce types, or make any defensive copies on input or output. This can lead to delayed failures; for example,
div
might be used for the map container rather than ansvg
string
might be used for the map zoom rather than anumber
number
rather than{x: number, y: number}
lat
orlon
attributes ofmap.center()
might be modified directlyProtecting against all types of errant usage might present an undue burden on the library implementors, but we should be able to protect against the more obvious mistakes and make the library more robust. The code size and runtime performance costs will hopefully be outweighed by the benefits of a easier debugging / more predictable failure modes.
Once all input types are appropriately coerced we should also be able to avoid the type-coercing equality operators; i.e., use
===
and!==
instead of==
and!=
.The text was updated successfully, but these errors were encountered: