|
1 |
| -import { recursive } from 'ipfs-unixfs-exporter' |
2 |
| -import { CID } from 'multiformats/cid' |
3 |
| -import type { ChmodOptions } from '../index.js' |
4 |
| -import mergeOpts from 'merge-options' |
| 1 | +import * as dagPB from '@ipld/dag-pb' |
5 | 2 | import { logger } from '@libp2p/logger'
|
6 | 3 | import { UnixFS } from 'ipfs-unixfs'
|
7 |
| -import { pipe } from 'it-pipe' |
8 |
| -import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js' |
9 |
| -import * as dagPB from '@ipld/dag-pb' |
10 |
| -import type { PBNode, PBLink } from '@ipld/dag-pb' |
| 4 | +import { recursive } from 'ipfs-unixfs-exporter' |
11 | 5 | import { importer } from 'ipfs-unixfs-importer'
|
12 |
| -import { persist } from './utils/persist.js' |
13 |
| -import type { Blocks } from '@helia/interface/blocks' |
14 | 6 | import last from 'it-last'
|
15 |
| -import { sha256 } from 'multiformats/hashes/sha2' |
16 |
| -import { resolve, updatePathCids } from './utils/resolve.js' |
| 7 | +import { pipe } from 'it-pipe' |
| 8 | +import mergeOpts from 'merge-options' |
| 9 | +import { CID } from 'multiformats/cid' |
17 | 10 | import * as raw from 'multiformats/codecs/raw'
|
| 11 | +import { sha256 } from 'multiformats/hashes/sha2' |
18 | 12 | import { SHARD_SPLIT_THRESHOLD_BYTES } from './utils/constants.js'
|
| 13 | +import { InvalidPBNodeError, NotUnixFSError, UnknownError } from './utils/errors.js' |
| 14 | +import { persist } from './utils/persist.js' |
| 15 | +import { resolve, updatePathCids } from './utils/resolve.js' |
| 16 | +import type { ChmodOptions } from '../index.js' |
| 17 | +import type { Blocks } from '@helia/interface/blocks' |
| 18 | +import type { PBNode, PBLink } from '@ipld/dag-pb' |
19 | 19 |
|
20 | 20 | const mergeOptions = mergeOpts.bind({ ignoreUndefined: true })
|
21 | 21 | const log = logger('helia:unixfs:chmod')
|
@@ -94,14 +94,14 @@ export async function chmod (cid: CID, mode: number, blockstore: Blocks, options
|
94 | 94 | }
|
95 | 95 | }
|
96 | 96 | }),
|
97 |
| - async (nodes) => await last(nodes) |
| 97 | + async (nodes) => last(nodes) |
98 | 98 | )
|
99 | 99 |
|
100 | 100 | if (root == null) {
|
101 | 101 | throw new UnknownError(`Could not chmod ${resolved.cid.toString()}`)
|
102 | 102 | }
|
103 | 103 |
|
104 |
| - return await updatePathCids(root.cid, resolved, blockstore, opts) |
| 104 | + return updatePathCids(root.cid, resolved, blockstore, opts) |
105 | 105 | }
|
106 | 106 |
|
107 | 107 | const block = await blockstore.get(resolved.cid)
|
@@ -133,5 +133,5 @@ export async function chmod (cid: CID, mode: number, blockstore: Blocks, options
|
133 | 133 |
|
134 | 134 | await blockstore.put(updatedCid, updatedBlock)
|
135 | 135 |
|
136 |
| - return await updatePathCids(updatedCid, resolved, blockstore, opts) |
| 136 | + return updatePathCids(updatedCid, resolved, blockstore, opts) |
137 | 137 | }
|
0 commit comments