You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
@@ -169,43 +164,3 @@ function pinFile (pin, opts) {
169
164
}
170
165
}
171
166
}
172
-
173
-
/**
174
-
* @typedef {object} UnixFSEntry
175
-
* @property {string} path
176
-
* @property {CID} cid
177
-
* @property {number} [mode]
178
-
* @property {MTime} [mtime]
179
-
* @property {number} size
180
-
*
181
-
* @typedef {Object} AddAllOptions
182
-
* @property {string} [chunker='size-262144'] - Chunking algorithm used to build
183
-
* ipfs DAGs.
184
-
* @property {0|1} [cidVersion=0] - The CID version to use when storing the data.
185
-
* @property {boolean} [enableShardingExperiment=false] - Allows to create
186
-
* directories with an unlimited number of entries currently size of unixfs
187
-
* directories is limited by the maximum block size. **Note** that this is an
188
-
* experimental feature.
189
-
* @property {string} [hashAlg='sha2-256'] - Multihash hashing algorithm to use.
190
-
* @property {boolean} [onlyHash=false] - If true, will not add blocks to the
191
-
* blockstore.
192
-
* @property {boolean} [pin=true] - Pin this object when adding.
193
-
* @property {(bytes:number, path:string) => void} [progress] - a function that will be called with the number of bytes added as a file is added to ipfs and the path of the file being added
194
-
* @property {boolean} [rawLeaves=false] - If true, DAG leaves will contain raw
195
-
* file data and not be wrapped in a protobuf.
196
-
* @property {number} [shardSplitThreshold=1000] - Directories with more than this
197
-
* number of files will be created as HAMT-sharded directories.
198
-
* @property {boolean} [trickle=false] - If true will use the
// Note this should never happen as `addAll` should yield at least one item
16
+
// but to satisfy type checker we perfom this check and for good measure
17
+
// throw an error in case it does happen.
18
+
if(result==null){
19
+
throwError('Failed to add a file, if you see this please report a bug')
20
+
}
21
+
16
22
returnresult
17
23
}
24
+
18
25
returnadd
19
26
}
20
-
21
-
/**
22
-
* @typedef {object} AddOptions
23
-
* @property {string} [chunker] - chunking algorithm used to build ipfs DAGs (default: `'size-262144'`)
24
-
* @property {number} [cidVersion] - the CID version to use when storing the data (default: `0`)
25
-
* @property {string} [hashAlg] - multihash hashing algorithm to use (default: `'sha2-256'`)
26
-
* @property {boolean} [onlyHash] - If true, will not add blocks to the blockstore (default: `false`)
27
-
* @property {boolean} [pin] - pin this object when adding (default: `true`)
28
-
* @property {(bytes:number, path:string) => void} [progress] - a function that will be called with the number of bytes added as a file is added to ipfs and the path of the file being added
29
-
* @property {boolean} [rawLeaves] - if true, DAG leaves will contain raw file data and not be wrapped in a protobuf (default: `false`)
30
-
* @property {boolean} [trickle] - if true will use the [trickle DAG](https://godoc.org/github.com/ipsn/go-ipfs/gxlibs/github.com/ipfs/go-unixfs/importer/trickle) format for DAG generation (default: `false`)
31
-
* @property {boolean} [wrapWithDirectory] - Adds a wrapping node around the content (default: `false`)
* @property {boolean} [parents=false] - If true, create intermediate directories
146
-
* @property {number} [mode] - An integer that represents the file mode
147
-
* @property {Mtime|Hrtime|Date} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()
146
+
* @property {ToMode} [mode] - An integer that represents the file mode
147
+
* @property {ToMTime} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()
148
148
* @property {boolean} [flush] - If true the changes will be immediately flushed to disk
149
149
* @property {string} [hashAlg='sha2-256'] - The hash algorithm to use for any updated entries
150
-
* @property {0|1} [cidVersion=0] - The CID version to use for any updated entries
150
+
* @property {CIDVersion} [cidVersion=0] - The CID version to use for any updated entries
* @property {UnixTime} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()`
124
+
* @property {ToMTime} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()`
125
125
* @property {boolean} [flush=false] - If true the changes will be immediately flushed to disk
126
126
* @property {string} [hashAlg='sha2-256'] - The hash algorithm to use for any updated entries
127
-
* @property {0|1} [cidVersion] - The CID version to use for any updated entries
127
+
* @property {import('cids').CIDVersion} [cidVersion] - The CID version to use for any updated entries
* @property {boolean} [parents=false] - Create intermediate MFS paths if they do not exist
300
300
* @property {boolean} [truncate=false] - Truncate the file at the MFS path if it would have been larger than the passed content
301
301
* @property {boolean} [rawLeaves=false] - If true, DAG leaves will contain raw file data and not be wrapped in a protobuf
302
-
* @property {number} [mode] - An integer that represents the file mode
303
-
* @property {Mtime|Hrtime|Date} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()
302
+
* @property {import('ipfs-interface/src/files').ToMode} [mode] - An integer that represents the file mode
303
+
* @property {import('ipfs-interface/src/files').ToMTime} [mtime] - A Date object, an object with `{ secs, nsecs }` properties where secs is the number of seconds since (positive) or before (negative) the Unix Epoch began and nsecs is the number of nanoseconds since the last full second, or the output of `process.hrtime()
304
304
* @property {boolean} [flush] - If true the changes will be immediately flushed to disk
305
305
* @property {string} [hashAlg='sha2-256'] - The hash algorithm to use for any updated entries
306
306
* @property {0|1} [cidVersion=0] - The CID version to use for any updated entries
0 commit comments