Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (options.offset) {
searchParams.set('offset', options.offset)
}
if (options.length) {
searchParams.set('length', options.length)
}
const res = await ky.post('get', {
timeout: options.timeout,
signal: options.signal,
headers: options.headers,
searchParams
})
const extractor = Tar.extract()
for await (const { header, body } of extractor(toIterable(res.body))) {
if (header.type === 'directory') {
yield {
path: header.name
}
} else {
yield {
path: header.name,
content: body
}
}
}
}
})