( cg: CodeGraph, projectRoot: string, id: string, options: TrailsOptions )
| 374 | } |
| 375 | |
| 376 | export function removeTrail( |
| 377 | cg: CodeGraph, |
| 378 | projectRoot: string, |
| 379 | id: string, |
| 380 | options: TrailsOptions |
| 381 | ): WireTrails { |
| 382 | if (options.readOnly) throw readOnlyRefusal(options.readOnlyReason); |
| 383 | if (!deleteStoredTrail(projectRoot, id)) { |
| 384 | throw notFound(`There is no saved trail called "${id}".`); |
| 385 | } |
| 386 | return { ...buildTrails(cg, projectRoot, options), deleted: id }; |
| 387 | } |
| 388 | |
| 389 | function readOnlyRefusal(reason: string | null): ApiError { |
| 390 | return new ApiError( |
no test coverage detected