Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit dead1d3

Browse files
author
Alan Shaw
committed
fix: allow stream option to be passed
1 parent 9993217 commit dead1d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/files/ls.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = configure(({ ky }) => {
1717

1818
const searchParams = new URLSearchParams(options.searchParams)
1919
searchParams.set('arg', CID.isCID(path) ? `/ipfs/${path}` : path)
20-
searchParams.set('stream', true)
20+
searchParams.set('stream', options.stream == null ? true : options.stream)
2121
if (options.cidBase) searchParams.set('cid-base', options.cidBase)
2222
searchParams.set('long', options.long == null ? true : options.long)
2323

@@ -34,9 +34,9 @@ module.exports = configure(({ ky }) => {
3434
for (const entry of result.Entries || []) {
3535
yield toCoreInterface(toCamelWithMetadata(entry))
3636
}
37-
return
37+
} else {
38+
yield toCoreInterface(toCamelWithMetadata(result))
3839
}
39-
yield toCoreInterface(toCamelWithMetadata(result))
4040
}
4141
}
4242
})

src/name/resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = configure(({ ky }) => {
1010

1111
const searchParams = new URLSearchParams(options.searchParams)
1212
searchParams.set('arg', path)
13-
searchParams.set('stream', true)
13+
searchParams.set('stream', options.stream == null ? true : options.stream)
1414
if (options.dhtRecordCount != null) searchParams.set('dht-record-count', options.dhtRecordCount)
1515
if (options.dhtTimeout != null) searchParams.set('dht-timeout', options.dhtTimeout)
1616
if (options.noCache != null) searchParams.set('nocache', options.noCache)

0 commit comments

Comments
 (0)