@defer/client
Advanced tools
Comparing version 1.13.0-alpha-20231011122331-29dc712 to 1.13.0-alpha-20231011122715-7677af5
@@ -189,30 +189,11 @@ "use strict"; | ||
function delay(fn, delay) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, delay }; | ||
return wrapped; | ||
return assignOptions(fn, { delay }); | ||
} | ||
exports.delay = delay; | ||
function addMetadata(fn, metadata) { | ||
const gatheredMetadata = { ...fn.__execOptions?.metadata, ...metadata }; | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, metadata: gatheredMetadata }; | ||
return wrapped; | ||
return assignOptions(fn, { metadata }); | ||
} | ||
exports.addMetadata = addMetadata; | ||
function discardAfter(fn, value) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, discardAfter: value }; | ||
return wrapped; | ||
return assignOptions(fn, { discardAfter: value }); | ||
} | ||
@@ -219,0 +200,0 @@ exports.discardAfter = discardAfter; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = "1.13.0-alpha-20231011122331-29dc712"; | ||
exports.default = "1.13.0-alpha-20231011122715-7677af5"; |
@@ -158,28 +158,9 @@ import parseDuration from "parse-duration"; | ||
export function delay(fn, delay) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, delay }; | ||
return wrapped; | ||
return assignOptions(fn, { delay }); | ||
} | ||
export function addMetadata(fn, metadata) { | ||
const gatheredMetadata = { ...fn.__execOptions?.metadata, ...metadata }; | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, metadata: gatheredMetadata }; | ||
return wrapped; | ||
return assignOptions(fn, { metadata }); | ||
} | ||
export function discardAfter(fn, value) { | ||
const wrapped = async function (...args) { | ||
return enqueue(wrapped, ...args); | ||
}; | ||
wrapped.__fn = fn.__fn; | ||
wrapped.__metadata = fn.__metadata; | ||
wrapped.__execOptions = { ...fn.__execOptions, discardAfter: value }; | ||
return wrapped; | ||
return assignOptions(fn, { discardAfter: value }); | ||
} | ||
@@ -186,0 +167,0 @@ export function assignOptions(fn, options) { |
@@ -1,1 +0,1 @@ | ||
export default "1.13.0-alpha-20231011122331-29dc712"; | ||
export default "1.13.0-alpha-20231011122715-7677af5"; |
{ | ||
"name": "@defer/client", | ||
"version": "1.13.0-alpha-20231011122331-29dc712", | ||
"version": "1.13.0-alpha-20231011122715-7677af5", | ||
"description": "Zero infrastructure NodeJS background jobs", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -1,2 +0,2 @@ | ||
declare const _default: "1.13.0-alpha-20231011122331-29dc712"; | ||
declare const _default: "1.13.0-alpha-20231011122715-7677af5"; | ||
export default _default; |
Sorry, the diff of this file is not supported yet
65745
1425