ipfs-unixfs-exporter
Advanced tools
Comparing version
import { CID } from 'multiformats/cid'; | ||
import type { UnixFS } from 'ipfs-unixfs'; | ||
import type { PBNode } from '@ipld/dag-pb'; | ||
import type { Blockstore } from 'interface-blockstore'; | ||
import type { Blockstore as InterfaceBlockstore } from 'interface-blockstore'; | ||
import type { Bucket } from 'hamt-sharding'; | ||
@@ -71,2 +71,6 @@ export interface ExporterOptions { | ||
} | ||
export interface BlockstoreOptions { | ||
signal?: AbortSignal; | ||
} | ||
export type Blockstore = Pick<InterfaceBlockstore, 'has' | 'put' | 'get'>; | ||
export declare function walkPath(path: string | CID, blockstore: Blockstore, options?: ExporterOptions): AsyncGenerator<UnixFSEntry, void, any>; | ||
@@ -73,0 +77,0 @@ export declare function exporter(path: string | CID, blockstore: Blockstore, options?: ExporterOptions): Promise<UnixFSEntry>; |
import type { UnixfsV1Resolver } from '../../../index.js'; | ||
/** | ||
* @typedef {import('interface-blockstore').Blockstore} Blockstore | ||
* @typedef {import('../../../types').ExporterOptions} ExporterOptions | ||
* @typedef {import('../../../types').Resolve} Resolve | ||
* @typedef {import('../../../types').UnixfsV1DirectoryContent} UnixfsV1DirectoryContent | ||
* @typedef {import('../../../types').UnixfsV1Resolver} UnixfsV1Resolver | ||
* @typedef {import('@ipld/dag-pb').PBNode} PBNode | ||
*/ | ||
declare const hamtShardedDirectoryContent: UnixfsV1Resolver; | ||
export default hamtShardedDirectoryContent; | ||
//# sourceMappingURL=hamt-sharded-directory.d.ts.map |
@@ -5,10 +5,2 @@ import parallel from 'it-parallel'; | ||
import { decode } from '@ipld/dag-pb'; | ||
/** | ||
* @typedef {import('interface-blockstore').Blockstore} Blockstore | ||
* @typedef {import('../../../types').ExporterOptions} ExporterOptions | ||
* @typedef {import('../../../types').Resolve} Resolve | ||
* @typedef {import('../../../types').UnixfsV1DirectoryContent} UnixfsV1DirectoryContent | ||
* @typedef {import('../../../types').UnixfsV1Resolver} UnixfsV1Resolver | ||
* @typedef {import('@ipld/dag-pb').PBNode} PBNode | ||
*/ | ||
const hamtShardedDirectoryContent = (cid, node, unixfs, path, resolve, depth, blockstore) => { | ||
@@ -15,0 +7,0 @@ function yieldHamtDirectoryContent(options = {}) { |
import { PBNode } from '@ipld/dag-pb'; | ||
import type { Blockstore } from 'interface-blockstore'; | ||
import type { ExporterOptions, ShardTraversalContext } from '../index.js'; | ||
import type { ExporterOptions, ShardTraversalContext, Blockstore } from '../index.js'; | ||
import type { CID } from 'multiformats/cid'; | ||
@@ -5,0 +4,0 @@ declare const findShardCid: (node: PBNode, name: string, blockstore: Blockstore, context?: ShardTraversalContext, options?: ExporterOptions) => Promise<CID | undefined>; |
{ | ||
"BlockstoreOptions": "https://ipfs.github.io/js-ipfs-unixfs/interfaces/ipfs_unixfs_exporter.BlockstoreOptions.html", | ||
"Exportable": "https://ipfs.github.io/js-ipfs-unixfs/interfaces/ipfs_unixfs_exporter.Exportable.html", | ||
@@ -15,2 +16,3 @@ "ExporterOptions": "https://ipfs.github.io/js-ipfs-unixfs/interfaces/ipfs_unixfs_exporter.ExporterOptions.html", | ||
"UnixfsV1Resolver": "https://ipfs.github.io/js-ipfs-unixfs/interfaces/ipfs_unixfs_exporter.UnixfsV1Resolver.html", | ||
"Blockstore": "https://ipfs.github.io/js-ipfs-unixfs/types/ipfs_unixfs_exporter.Blockstore.html", | ||
"UnixFSEntry": "https://ipfs.github.io/js-ipfs-unixfs/types/ipfs_unixfs_exporter.UnixFSEntry.html", | ||
@@ -17,0 +19,0 @@ "UnixfsV1Content": "https://ipfs.github.io/js-ipfs-unixfs/types/ipfs_unixfs_exporter.UnixfsV1Content.html", |
{ | ||
"name": "ipfs-unixfs-exporter", | ||
"version": "12.0.1", | ||
"version": "12.0.2", | ||
"description": "JavaScript implementation of the UnixFs exporter used by IPFS", | ||
@@ -134,3 +134,3 @@ "license": "Apache-2.0 OR MIT", | ||
"lint": "aegir lint", | ||
"dep-check": "aegir dep-check -i interface-blockstore", | ||
"dep-check": "aegir dep-check", | ||
"release": "aegir release" | ||
@@ -144,3 +144,3 @@ }, | ||
"hamt-sharding": "^3.0.0", | ||
"interface-blockstore": "^4.0.0", | ||
"interface-blockstore": "^4.0.1", | ||
"ipfs-unixfs": "^11.0.0", | ||
@@ -147,0 +147,0 @@ "it-filter": "^2.0.0", |
@@ -7,3 +7,3 @@ import errCode from 'err-code' | ||
import type { PBNode } from '@ipld/dag-pb' | ||
import type { Blockstore } from 'interface-blockstore' | ||
import type { Blockstore as InterfaceBlockstore } from 'interface-blockstore' | ||
import type { Bucket } from 'hamt-sharding' | ||
@@ -83,2 +83,8 @@ | ||
export interface BlockstoreOptions { | ||
signal?: AbortSignal | ||
} | ||
export type Blockstore = Pick<InterfaceBlockstore, 'has' | 'put' | 'get'> | ||
const toPathComponents = (path: string = ''): string[] => { | ||
@@ -85,0 +91,0 @@ // split on / unless escaped with \ |
@@ -12,4 +12,3 @@ import extractDataFromBlock from '../../../utils/extract-data-from-block.js' | ||
import PQueue from 'p-queue' | ||
import type { Blockstore } from 'interface-blockstore' | ||
import type { ExporterOptions, UnixfsV1FileContent, UnixfsV1Resolver } from '../../../index.js' | ||
import type { ExporterOptions, UnixfsV1FileContent, UnixfsV1Resolver, Blockstore } from '../../../index.js' | ||
@@ -16,0 +15,0 @@ async function walkDAG (blockstore: Blockstore, node: dagPb.PBNode | Uint8Array, queue: Pushable<Uint8Array>, streamPosition: bigint, start: bigint, end: bigint, walkQueue: PQueue, options: ExporterOptions): Promise<void> { |
@@ -5,14 +5,4 @@ import parallel from 'it-parallel' | ||
import { decode, PBNode } from '@ipld/dag-pb' | ||
import type { Blockstore } from 'interface-blockstore' | ||
import type { ExporterOptions, Resolve, UnixfsV1DirectoryContent, UnixfsV1Resolver } from '../../../index.js' | ||
import type { ExporterOptions, Resolve, UnixfsV1DirectoryContent, UnixfsV1Resolver, Blockstore } from '../../../index.js' | ||
/** | ||
* @typedef {import('interface-blockstore').Blockstore} Blockstore | ||
* @typedef {import('../../../types').ExporterOptions} ExporterOptions | ||
* @typedef {import('../../../types').Resolve} Resolve | ||
* @typedef {import('../../../types').UnixfsV1DirectoryContent} UnixfsV1DirectoryContent | ||
* @typedef {import('../../../types').UnixfsV1Resolver} UnixfsV1Resolver | ||
* @typedef {import('@ipld/dag-pb').PBNode} PBNode | ||
*/ | ||
const hamtShardedDirectoryContent: UnixfsV1Resolver = (cid, node, unixfs, path, resolve, depth, blockstore) => { | ||
@@ -19,0 +9,0 @@ function yieldHamtDirectoryContent (options: ExporterOptions = {}): UnixfsV1DirectoryContent { |
@@ -5,4 +5,3 @@ | ||
import { murmur3128 } from '@multiformats/murmur3' | ||
import type { Blockstore } from 'interface-blockstore' | ||
import type { ExporterOptions, ShardTraversalContext } from '../index.js' | ||
import type { ExporterOptions, ShardTraversalContext, Blockstore } from '../index.js' | ||
import type { CID } from 'multiformats/cid' | ||
@@ -9,0 +8,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
204193
-0.4%1971
-0.9%Updated