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

getLayerBaseUrl does not work for string literals #4716

Open
hbruch opened this issue Jan 19, 2023 · 2 comments
Open

getLayerBaseUrl does not work for string literals #4716

hbruch opened this issue Jan 19, 2023 · 2 comments

Comments

@hbruch
Copy link
Contributor

hbruch commented Jan 19, 2023

In line mapLayerUtils.getLayerBaseUrl the check urlOrUrlMap instanceof String returns false for string literals and should be replaced by e.g. typeof urlOrUrlMap === 'string'.

There might be further occurences where such a check might fail.

@vesameskanen
Copy link
Member

grep -r 'instanceof' app
app/util/legUtils.js: typeof legOrMode === 'string' || legOrMode instanceof String
app/util/modeUtils.js: const modesStr = modes instanceof Array ? modes.join(',') : modes;
app/util/mapLayerUtils.js: return urlOrUrlMap instanceof String
app/util/mqttClient.js: if (message instanceof Uint8Array) {

@vesameskanen
Copy link
Member

One check does the both :)

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

No branches or pull requests

2 participants