@loaders.gl/i3s 4.2.1 → 4.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,13 +6,18 @@ import {Node3DIndexDocument, SceneLayer3D} from '../../types';
6
6
  * @returns url without search params
7
7
  */
8
8
  export function getUrlWithoutParams(url: string): string {
9
- let urlWithoutParams;
9
+ let urlWithoutParams: string | null;
10
10
 
11
11
  try {
12
12
  const urlObj = new URL(url);
13
13
  urlWithoutParams = `${urlObj.origin}${urlObj.pathname}`;
14
+
15
+ // On Windows `new URL(url)` makes `C:\...` -> `null\...`
16
+ if (urlWithoutParams.startsWith('null')) {
17
+ urlWithoutParams = null;
18
+ }
14
19
  } catch (e) {
15
- // do nothing
20
+ urlWithoutParams = null;
16
21
  }
17
22
  return urlWithoutParams || url;
18
23
  }