MCPcopy Create free account
hub / github.com/hashintel/hash / optionalSlugArg

Function optionalSlugArg

apps/hash-api/src/analysis/shared/storage-key.ts:66–74  ·  view source on GitHub ↗
(
  args: Record<string, unknown>,
  key: string,
)

Source from the content-addressed store, hash-verified

64
65/** Read an optional slug argument; returns `undefined` if absent. */
66export const optionalSlugArg = (
67 args: Record<string, unknown>,
68 key: string,
69): string | undefined => {
70 if (args[key] === undefined || args[key] === null) {
71 return undefined;
72 }
73 return requireSlugArg(args, key);
74};

Callers 1

Calls 1

requireSlugArgFunction · 0.85

Tested by

no test coverage detected