Skip to content

Commit

Permalink
fix: add filename to export response on toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Sep 15, 2024
1 parent 6bf5d7d commit af2441a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kitsonk/kv-toolbox",
"version": "0.19.0-beta.5",
"version": "0.19.0-beta.6",
"exports": {
".": "./toolbox.ts",
"./batched_atomic": "./batched_atomic.ts",
Expand Down
13 changes: 11 additions & 2 deletions toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,16 @@ export class KvToolbox implements Disposable {
*/
export(
selector: Deno.KvListSelector,
options: { close?: boolean; response: true },
options: {
close?: boolean;
response: true;
/**
* If provided, the response will include a header that indicates the file is
* meant to be downloaded (`Content-Disposition`). The extension `.ndjson`
* will be appended to the filename.
*/
filename?: string;
},
): Response;
/**
* Like {@linkcode Deno.Kv} `.list()` method, but returns a
Expand All @@ -316,7 +325,7 @@ export class KvToolbox implements Disposable {
export(
selector: Deno.KvListSelector,
options:
| { close?: boolean; response: true }
| { close?: boolean; response: true; filename?: string }
| (
| ExportEntriesOptionsJSON
| ExportEntriesOptionsBytes
Expand Down

0 comments on commit af2441a

Please sign in to comment.