( args: Record<string, unknown>, key: string, )
| 64 | |
| 65 | /** Read an optional slug argument; returns `undefined` if absent. */ |
| 66 | export 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 | }; |
no test coverage detected