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

Function getName

packages/core/src/v3/apiClient/core.ts:402–409  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

400}
401
402function getName(value: any): string | undefined {
403 return (
404 getStringFromMaybeBuffer(value.name) ||
405 getStringFromMaybeBuffer(value.filename) ||
406 // For fs.ReadStream
407 getStringFromMaybeBuffer(value.path)?.split(/[\\/]/).pop()
408 );
409}
410
411const getStringFromMaybeBuffer = (x: string | Buffer | unknown): string | undefined => {
412 if (typeof x === "string") return x;

Callers 1

toFileFunction · 0.85

Calls 1

getStringFromMaybeBufferFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…