MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / resolveDefaults

Function resolveDefaults

packages/trigger-sdk/src/v3/retry.ts:568–586  ·  view source on GitHub ↗
(
  obj: TObject | undefined,
  key: K,
  defaults: TValue
)

Source from the content-addressed store, hash-verified

566// If the options object is undefined, it will return the defaults for that property (passed in as the 3rd arg).
567// if the options object is defined, and the property exists, then it will return the defaults if the value of the property is undefined or null
568const resolveDefaults = <
569 TObject extends Record<string, unknown>,
570 K extends keyof TObject,
571 TValue extends TObject[K],
572>(
573 obj: TObject | undefined,
574 key: K,
575 defaults: TValue
576): TValue => {
577 if (!obj) {
578 return defaults;
579 }
580
581 if (obj[key] === undefined || obj[key] === null) {
582 return defaults;
583 }
584
585 return obj[key] as TValue;
586};
587
588const createFetchAttributes = (
589 input: RequestInfo | URL,

Callers 2

retryFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…