@loaders.gl/i3s 4.3.0-alpha.2 → 4.3.0-alpha.4

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.
@@ -8,9 +8,13 @@ export function getUrlWithoutParams(url) {
8
8
  try {
9
9
  const urlObj = new URL(url);
10
10
  urlWithoutParams = `${urlObj.origin}${urlObj.pathname}`;
11
+ // On Windows `new URL(url)` makes `C:\...` -> `null\...`
12
+ if (urlWithoutParams.startsWith('null')) {
13
+ urlWithoutParams = null;
14
+ }
11
15
  }
12
16
  catch (e) {
13
- // do nothing
17
+ urlWithoutParams = null;
14
18
  }
15
19
  return urlWithoutParams || url;
16
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/i3s",
3
- "version": "4.3.0-alpha.2",
3
+ "version": "4.3.0-alpha.4",
4
4
  "description": "i3s .",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,16 +42,16 @@
42
42
  "build-worker-node": "esbuild src/workers/i3s-content-worker-node.ts --outfile=dist/i3s-content-worker-node.js --platform=node --target=node16 --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
43
43
  },
44
44
  "dependencies": {
45
- "@loaders.gl/compression": "4.3.0-alpha.2",
46
- "@loaders.gl/crypto": "4.3.0-alpha.2",
47
- "@loaders.gl/draco": "4.3.0-alpha.2",
48
- "@loaders.gl/images": "4.3.0-alpha.2",
49
- "@loaders.gl/loader-utils": "4.3.0-alpha.2",
50
- "@loaders.gl/math": "4.3.0-alpha.2",
51
- "@loaders.gl/schema": "4.3.0-alpha.2",
52
- "@loaders.gl/textures": "4.3.0-alpha.2",
53
- "@loaders.gl/tiles": "4.3.0-alpha.2",
54
- "@loaders.gl/zip": "4.3.0-alpha.2",
45
+ "@loaders.gl/compression": "4.3.0-alpha.4",
46
+ "@loaders.gl/crypto": "4.3.0-alpha.4",
47
+ "@loaders.gl/draco": "4.3.0-alpha.4",
48
+ "@loaders.gl/images": "4.3.0-alpha.4",
49
+ "@loaders.gl/loader-utils": "4.3.0-alpha.4",
50
+ "@loaders.gl/math": "4.3.0-alpha.4",
51
+ "@loaders.gl/schema": "4.3.0-alpha.4",
52
+ "@loaders.gl/textures": "4.3.0-alpha.4",
53
+ "@loaders.gl/tiles": "4.3.0-alpha.4",
54
+ "@loaders.gl/zip": "4.3.0-alpha.4",
55
55
  "@math.gl/core": "^4.0.0",
56
56
  "@math.gl/culling": "^4.0.0",
57
57
  "@math.gl/geospatial": "^4.0.0"
@@ -59,5 +59,5 @@
59
59
  "peerDependencies": {
60
60
  "@loaders.gl/core": "^4.0.0"
61
61
  },
62
- "gitHead": "77a3cb538ab7a1fbf74245f25590210451689f5c"
62
+ "gitHead": "4900ac4c4de20366c050b80cef04dc5b52d167af"
63
63
  }
@@ -1,4 +1,4 @@
1
- import {FileProvider} from '@loaders.gl/loader-utils';
1
+ import {FileProviderInterface} from '@loaders.gl/loader-utils';
2
2
  import {
3
3
  parseZipCDFileHeader,
4
4
  CD_HEADER_SIGNATURE,
@@ -16,7 +16,7 @@ import {SLPKArchive} from './slpk-archieve';
16
16
  * @returns slpk file handler
17
17
  */
18
18
  export async function parseSLPKArchive(
19
- fileProvider: FileProvider,
19
+ fileProvider: FileProviderInterface,
20
20
  cb?: (msg: string) => void,
21
21
  fileName?: string
22
22
  ): Promise<SLPKArchive> {
@@ -1,5 +1,5 @@
1
1
  import {MD5Hash} from '@loaders.gl/crypto';
2
- import {FileProvider} from '@loaders.gl/loader-utils';
2
+ import {FileProviderInterface} from '@loaders.gl/loader-utils';
3
3
  import {IndexedArchive, parseZipLocalFileHeader} from '@loaders.gl/zip';
4
4
  import {GZipCompression} from '@loaders.gl/compression';
5
5
 
@@ -56,7 +56,11 @@ export class SLPKArchive extends IndexedArchive {
56
56
  * @param hashTable - pre-loaded hashTable. If presented, getFile will skip reading the hash file
57
57
  * @param fileName - name of the archive. It is used to add to an URL of a loader context
58
58
  */
59
- constructor(fileProvider: FileProvider, hashTable?: Record<string, bigint>, fileName?: string) {
59
+ constructor(
60
+ fileProvider: FileProviderInterface,
61
+ hashTable?: Record<string, bigint>,
62
+ fileName?: string
63
+ ) {
60
64
  super(fileProvider, hashTable, fileName);
61
65
  this.hashTable = hashTable;
62
66
  }
@@ -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
  }