File tree Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 7
7
"cotar" : " ./bin/cotar"
8
8
},
9
9
"dependencies" : {
10
- "@chunkd/source-file" : " ^4.5.1 " ,
10
+ "@chunkd/source-file" : " ^7.2.2 " ,
11
11
"@cotar/core" : " ^4.0.0" ,
12
12
"@oclif/command" : " ^1.8.0" ,
13
13
"binparse" : " ^1.1.0" ,
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ For example `@cotar/core` can fetch a 1KB file from a 100GB tar file with only 1
12
12
To fetch a single tile, the index has to be loaded into memory then the cotar object provides a ` get(fileName) ` interface to access any file inside the tar
13
13
``` typescript
14
14
import { Cotar , CotarIndexBinary } from ' @cotar/core' ;
15
- import { SourceAwsS3 } from ' @chunkd/source-aws '
15
+ import { fsa } from ' @chunkd/fs '
16
16
17
- const source = SourceAwsS3 . fromUri (' s3://linz-basemaps/topographic.tar' );
17
+ const source = fsa . source (' s3://linz-basemaps/topographic.tar' );
18
18
const cotar = Cotar .fromTar (source );
19
19
20
20
// Fetch a gzipped PBF file from a tar
Original file line number Diff line number Diff line change 5
5
"types" : " build/src/index.d.ts" ,
6
6
"license" : " MIT" ,
7
7
"dependencies" : {
8
- "@chunkd/core" : " ^4.5.1 " ,
8
+ "@chunkd/core" : " ^7.2.2 " ,
9
9
"@sindresorhus/fnv1a" : " ^2.0.1" ,
10
10
"binparse" : " ^1.1.0"
11
11
},
18
18
" *.png"
19
19
],
20
20
"devDependencies" : {
21
- "@chunkd/source-file" : " ^4.5.1 " ,
22
- "@types/node" : " ^16.4 .1"
21
+ "@chunkd/source-file" : " ^7.2.2 " ,
22
+ "@types/node" : " ^15.12 .1"
23
23
}
24
24
}
Original file line number Diff line number Diff line change 1
- import { ChunkSource , LogType } from '@chunkd/core' ;
1
+ import { LogType , ChunkSource } from '@chunkd/core' ;
2
2
import fnv1a from '@sindresorhus/fnv1a' ;
3
3
import { bp , StrutInfer } from 'binparse' ;
4
4
import { CotarIndexRecord } from '../cotar' ;
@@ -77,13 +77,13 @@ export class CotarIndex {
77
77
while ( true ) {
78
78
const offset = this . sourceOffset + index * IndexRecordSize + IndexHeaderSize ;
79
79
await this . source . loadBytes ( offset , IndexRecordSize , logger ) ;
80
- startHash = this . source . bigUint64 ( offset ) ;
80
+ startHash = this . source . getBigUint64 ( offset ) ;
81
81
82
82
// Found the file
83
83
if ( startHash === hash ) {
84
- const fileOffset = this . source . bigUint64 ( offset + 8 ) ;
85
- const fileSize = this . source . bigUint64 ( offset + 16 ) ;
86
- return { offset : toNumber ( fileOffset ) , size : toNumber ( fileSize ) } ;
84
+ const fileOffset = this . source . getUint64 ( offset + 8 ) ;
85
+ const fileSize = this . source . getUint64 ( offset + 16 ) ;
86
+ return { offset : fileOffset , size : fileSize } ;
87
87
}
88
88
// Found a gap in the hash table (file doesnt exist)
89
89
if ( startHash === Big0 ) return null ;
Original file line number Diff line number Diff line change 30
30
chalk "^2.0.0"
31
31
js-tokens "^4.0.0"
32
32
33
- " @chunkd/core@^4.5.1 " :
34
- version "4.5.1 "
35
- resolved "https://registry.yarnpkg.com/@chunkd/core/-/core-4.5.1 .tgz#179d0f0e035a9af7c56ec4d88c01e9f4bc9b7a32 "
36
- integrity sha512-8gZGvWD8yYWysvbrLla1uubYvgm+PQrzEdHSK8gMwtgJTULg3GOVpIUzFTFmxDdR2CjwKhdb1BD69NZbVoVI/Q ==
33
+ " @chunkd/core@^7.2.2 " :
34
+ version "7.2.2 "
35
+ resolved "https://registry.yarnpkg.com/@chunkd/core/-/core-7.2.2 .tgz#fc561df415f5f07ddec92f79b472803be753b439 "
36
+ integrity sha512-OhPXkl4UvQDy2CCGj6rKKDuxwY4OyAmsCtsJ84dQXcgTOER9aVf6DR++ydPc2OfMwcBNmE8ZFpgEW9OUM07wNA ==
37
37
38
- " @chunkd/source-file@^4.5.1 " :
39
- version "4.5.1 "
40
- resolved "https://registry.yarnpkg.com/@chunkd/source-file/-/source-file-4.5.1 .tgz#c5971adad64b21c1c5b9f74790f0fb33c9b54a78 "
41
- integrity sha512-LBv6rFgyDpUboJoCZZRwzzpRPcw2oNGm97LKRhOQl9Fu4QX4bGS1UEn82sddbu2nA278+pi4yKwvsGavDcBgXQ ==
38
+ " @chunkd/source-file@^7.2.2 " :
39
+ version "7.2.2 "
40
+ resolved "https://registry.yarnpkg.com/@chunkd/source-file/-/source-file-7.2.2 .tgz#c05c255b52f316aab95a7e930b2665dac2042253 "
41
+ integrity sha512-OznggHr3BVvuDwqxErA34jHWkDqMF8kqJ1l6K3mkR9jTSPd7LSKaiaxJZhIHp0G1SBOaS8gZ7WEXON5mcC7wMw ==
42
42
dependencies :
43
- " @chunkd/core" " ^4.5.1 "
43
+ " @chunkd/core" " ^7.2.2 "
44
44
45
45
" @eslint/eslintrc@^0.4.3 " :
46
46
version "0.4.3"
You can’t perform that action at this time.
0 commit comments