@@ -134,7 +134,9 @@ class IPLDResolver {
134134 * @returns {Iterable.<Promise.<Object>> } - Returns an async iterator with the IPLD Nodes that correspond to the given `cids`.
135135 */
136136 get ( cids ) {
137- if ( ! typical . isIterable ( cids ) || typical . isString ( cids ) ||
137+ if ( ! ( typical . isIterable ( cids ) ||
138+ typeof cids [ Symbol . asyncIterator ] === 'function' ) ||
139+ typical . isString ( cids ) ||
138140 Buffer . isBuffer ( cids ) ) {
139141 throw new Error ( '`cids` must be an iterable of CIDs' )
140142 }
@@ -163,7 +165,9 @@ class IPLDResolver {
163165 * @returns {Iterable.<Promise.<CID>> } - Returns an async iterator with the CIDs of the serialized IPLD Nodes.
164166 */
165167 put ( nodes , format , userOptions ) {
166- if ( ! typical . isIterable ( nodes ) || typical . isString ( nodes ) ||
168+ if ( ! ( typical . isIterable ( nodes ) ||
169+ typeof nodes [ Symbol . asyncIterator ] === 'function' ) ||
170+ typical . isString ( nodes ) ||
167171 Buffer . isBuffer ( nodes ) ) {
168172 throw new Error ( '`nodes` must be an iterable' )
169173 }
@@ -218,7 +222,9 @@ class IPLDResolver {
218222 * @return {void }
219223 */
220224 remove ( cids ) {
221- if ( ! typical . isIterable ( cids ) || typical . isString ( cids ) ||
225+ if ( ! ( typical . isIterable ( cids ) ||
226+ typeof cids [ Symbol . asyncIterator ] === 'function' ) ||
227+ typical . isString ( cids ) ||
222228 Buffer . isBuffer ( cids ) ) {
223229 throw new Error ( '`cids` must be an iterable of CIDs' )
224230 }
0 commit comments