True when a thrown error is a repo-not-found miss from either layer.
(cause: unknown)
| 280 | |
| 281 | /** True when a thrown error is a repo-not-found miss from either layer. */ |
| 282 | function isNotFound(cause: unknown): boolean { |
| 283 | if (cause instanceof ArtifactError) return cause.code === "ENOTFOUND"; |
| 284 | // The binding raises its own ArtifactsError with code NOT_FOUND. |
| 285 | return ( |
| 286 | typeof cause === "object" && |
| 287 | cause !== null && |
| 288 | "code" in cause && |
| 289 | (cause as { code?: unknown }).code === "NOT_FOUND" |
| 290 | ); |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Fold a git token into a remote URL as basic-auth, yielding a |