File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,15 @@ export class Storage extends BaseStorage implements IStorageInstance {
7171 }
7272
7373 async set ( key : string , value , options : Options = { } ) {
74- const { previousVersion } = options ;
74+ const { previousVersion, ttl } = options ;
7575
7676 const result = await this . storageFetch < SetResponse > ( key , {
7777 method : 'POST' ,
7878 body : {
7979 // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
8080 value,
8181 ...previousVersion && { previous_version : previousVersion } ,
82+ ...ttl && { ttl } ,
8283 } ,
8384 } , options ) ;
8485
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export enum Period {
1111
1212export type Options = {
1313 shared ?: boolean ,
14- previousVersion ?: string
14+ previousVersion ?: string ,
15+ ttl ?: number
1516}
1617
1718export type CounterOptions = {
You can’t perform that action at this time.
0 commit comments