Skip to content

Commit

Permalink
chore: update deps and fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Jul 9, 2021
1 parent 25d5323 commit da56416
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
7 changes: 3 additions & 4 deletions packages/ipfs-unixfs-exporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"clean": "rimraf ./dist",
"lint": "aegir ts -p check && aegir lint",
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
"depcheck": "aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i ipfs-core-types -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore"
"depcheck": "aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore"
},
"repository": {
"type": "git",
Expand All @@ -36,12 +36,11 @@
"@types/mocha": "^8.2.1",
"@types/sinon": "^10.0.0",
"abort-controller": "^3.0.0",
"aegir": "^33.1.0",
"aegir": "^34.0.0",
"copy": "^0.3.2",
"crypto-browserify": "^3.12.0",
"detect-node": "^2.0.4",
"events": "^3.3.0",
"ipfs-core-types": "^0.5.2",
"ipfs-unixfs-importer": "^7.0.3",
"it-all": "^1.0.5",
"it-buffer-stream": "^2.0.0",
Expand All @@ -61,7 +60,7 @@
"@ipld/dag-pb": "^2.1.0",
"err-code": "^3.0.1",
"hamt-sharding": "^2.0.0",
"interface-blockstore": "^0.2.1",
"interface-blockstore": "^1.0.0",
"ipfs-unixfs": "^4.0.3",
"it-last": "^1.0.5",
"multiformats": "^9.0.4",
Expand Down
8 changes: 4 additions & 4 deletions packages/ipfs-unixfs-exporter/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ExporterOptions {
}

interface Exportable<T> {
type: 'file' | 'directory' | 'object' | 'raw' | 'identity',
type: 'file' | 'directory' | 'object' | 'raw' | 'identity'
name: string
path: string
cid: CID
Expand Down Expand Up @@ -61,10 +61,10 @@ interface ResolveResult {
next?: NextResult
}

type Resolve = (cid: CID, name: string, path: string, toResolve: string[], depth: number, blockstore: Blockstore, options: ExporterOptions) => Promise<ResolveResult>
type Resolver = (cid: CID, name: string, path: string, toResolve: string[], resolve: Resolve, depth: number, blockstore: Blockstore, options: ExporterOptions) => Promise<ResolveResult>
interface Resolve { (cid: CID, name: string, path: string, toResolve: string[], depth: number, blockstore: Blockstore, options: ExporterOptions): Promise<ResolveResult> }
interface Resolver { (cid: CID, name: string, path: string, toResolve: string[], resolve: Resolve, depth: number, blockstore: Blockstore, options: ExporterOptions): Promise<ResolveResult> }

type UnixfsV1FileContent = AsyncIterable<Uint8Array> | Iterable<Uint8Array>
type UnixfsV1DirectoryContent = AsyncIterable<UnixFSEntry> | Iterable<UnixFSEntry>
type UnixfsV1Content = UnixfsV1FileContent | UnixfsV1DirectoryContent
type UnixfsV1Resolver = (cid: CID, node: PBNode, unixfs: UnixFS, path: string, resolve: Resolve, depth: number, blockstore: Blockstore) => (options: ExporterOptions) => UnixfsV1Content
interface UnixfsV1Resolver { (cid: CID, node: PBNode, unixfs: UnixFS, path: string, resolve: Resolve, depth: number, blockstore: Blockstore): (options: ExporterOptions) => UnixfsV1Content }
4 changes: 2 additions & 2 deletions packages/ipfs-unixfs-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
"devDependencies": {
"@types/mocha": "^8.2.1",
"aegir": "^33.1.0",
"aegir": "^34.0.0",
"assert": "^2.0.0",
"copy": "^0.3.2",
"crypto-browserify": "^3.12.0",
Expand All @@ -50,7 +50,7 @@
"bl": "^5.0.0",
"err-code": "^3.0.1",
"hamt-sharding": "^2.0.0",
"interface-blockstore": "^0.2.1",
"interface-blockstore": "^1.0.0",
"ipfs-unixfs": "^4.0.3",
"it-all": "^1.0.5",
"it-batch": "^1.0.8",
Expand Down
34 changes: 17 additions & 17 deletions packages/ipfs-unixfs-importer/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ interface InProgressImportResult extends ImportResult {
}

type ChunkerType = 'fixed' | 'rabin'
type ProgressHandler = (chunkSize: number, path?: string) => void
type HamtHashFn = (value: Uint8Array) => Promise<Uint8Array>
type Chunker = (source: AsyncIterable<Uint8Array>, options: ImporterOptions) => AsyncIterable<Uint8Array>
type DAGBuilder = (source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate>, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<() => Promise<InProgressImportResult>>
type TreeBuilder = (source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<ImportResult>
type BufferImporter = (file: File, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<() => Promise<InProgressImportResult>>
type ChunkValidator = (source: AsyncIterable<Uint8Array>, options: ImporterOptions) => AsyncIterable<Uint8Array>
type UnixFSV1DagBuilder<T> = (item: T, blockstore: Blockstore, options: ImporterOptions) => Promise<InProgressImportResult>
type Reducer = (leaves: InProgressImportResult[]) => Promise<InProgressImportResult>
interface ProgressHandler { (chunkSize: number, path?: string): void }
interface HamtHashFn { (value: Uint8Array): Promise<Uint8Array> }
interface Chunker { (source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array> }
interface DAGBuilder { (source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>> }
interface TreeBuilder { (source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<ImportResult> }
interface BufferImporter { (file: File, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>> }
interface ChunkValidator { (source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array> }
interface UnixFSV1DagBuilder<T> { (item: T, blockstore: Blockstore, options: ImporterOptions): Promise<InProgressImportResult> }
interface Reducer { (leaves: InProgressImportResult[]): Promise<InProgressImportResult> }

type FileDAGBuilder = (source: AsyncIterable<InProgressImportResult> | Iterable<InProgressImportResult>, reducer: Reducer, options: ImporterOptions) => Promise<InProgressImportResult>
interface FileDAGBuilder { (source: AsyncIterable<InProgressImportResult> | Iterable<InProgressImportResult>, reducer: Reducer, options: ImporterOptions): Promise<InProgressImportResult> }

interface UserImporterOptions {
strategy?: 'balanced' | 'flat' | 'trickle'
Expand Down Expand Up @@ -115,14 +115,14 @@ interface ImporterOptions {
}

export interface TrickleDagNode {
children: InProgressImportResult[],
depth: number,
maxDepth: number,
maxChildren: number,
data?: InProgressImportResult[],
children: InProgressImportResult[]
depth: number
maxDepth: number
maxChildren: number
data?: InProgressImportResult[]
parent?: TrickleDagNode
cid?: CID,
size?: number,
cid?: CID
size?: number
unixfs?: UnixFS
}

Expand Down
7 changes: 5 additions & 2 deletions packages/ipfs-unixfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
"devDependencies": {
"@types/mocha": "^8.2.1",
"aegir": "^33.1.0",
"aegir": "^34.0.0",
"copy": "^0.3.2",
"mkdirp": "^1.0.4",
"npm-run-all": "^4.1.5",
Expand All @@ -55,6 +55,9 @@
"dist"
],
"eslintConfig": {
"extends": "ipfs"
"extends": "ipfs",
"ignorePatterns": [
"src/unixfs.d.ts"
]
}
}

0 comments on commit da56416

Please sign in to comment.