Skip to content

Commit 2ef93cf

Browse files
Sonar fixes (prefer globalThis)
1 parent 39bbe8b commit 2ef93cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/client/javascripts/location-map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function makeTileRequestTransformer(apiPath) {
143143
return {
144144
url: url.replace(
145145
'https://api.os.uk/maps/vector/v1/vts',
146-
`${window.location.origin}${apiPath}`
146+
`${globalThis.location.origin}${apiPath}`
147147
),
148148
headers: {}
149149
}
@@ -276,7 +276,7 @@ function createMap(mapId, initConfig, mapsConfig) {
276276
const logoAltText = 'Ordnance survey logo'
277277

278278
// @ts-expect-error - Defra namespace currently comes from UMD support files
279-
const defra = window.defra
279+
const defra = globalThis.defra
280280

281281
const interactPlugin = defra.interactPlugin({
282282
dataLayers: [],

0 commit comments

Comments
 (0)