MCPcopy Create free account
hub / github.com/protomaps/PMTiles / constructor

Method constructor

js/src/index.ts:354–374  ·  view source on GitHub ↗
(
    url: string,
    customHeaders: Headers = new Headers(),
    credentials: "same-origin" | "include" | undefined = undefined
  )

Source from the content-addressed store, hash-verified

352 chromeWindowsNoCache: boolean;
353
354 constructor(
355 url: string,
356 customHeaders: Headers = new Headers(),
357 credentials: "same-origin" | "include" | undefined = undefined
358 ) {
359 this.url = url;
360 this.customHeaders = customHeaders;
361 this.credentials = credentials;
362 this.mustReload = false;
363 let userAgent = "";
364 if ("navigator" in globalThis) {
365 //biome-ignore lint: cf workers
366 userAgent = (globalThis as any).navigator?.userAgent ?? "";
367 }
368 const isWindows = userAgent.indexOf("Windows") > -1;
369 const isChromiumBased = /Chrome|Chromium|Edg|OPR|Brave/.test(userAgent);
370 this.chromeWindowsNoCache = false;
371 if (isWindows && isChromiumBased) {
372 this.chromeWindowsNoCache = true;
373 }
374 }
375
376 getKey() {
377 return this.url;

Callers

nothing calls this directly

Calls 1

testMethod · 0.65

Tested by

no test coverage detected