Function
optionalString
(args: Record<string, unknown>, key: string)
Source from the content-addressed store, hash-verified
| 66 | } |
| 67 | |
| 68 | function optionalString(args: Record<string, unknown>, key: string): string | undefined { |
| 69 | const value = args[key] |
| 70 | if (value == null) return undefined |
| 71 | if (typeof value !== 'string') throw new Error(`${key} must be a string`) |
| 72 | return value |
| 73 | } |
| 74 | |
| 75 | function requireFolder(args: Record<string, unknown>, key: string): NoteFolder { |
| 76 | const value = requireString(args, key) |
Tested by
no test coverage detected