mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-15 05:45:20 +00:00
This PR alters the behaviour of the search api (and all apis that depend on it) to return raw source code instead of a base64 encoding. Reasoning: we are decoding it on the client in multiple different places, so it would be beneficial to decode it in a single spot. **Note**: This is a **breaking change** to the API surface. However, since the API surface is still unofficial/unsupported, I will roll this as a patch version change. See #101
10 lines
No EOL
273 B
TypeScript
10 lines
No EOL
273 B
TypeScript
import { ServiceError } from "./types.js";
|
|
|
|
|
|
export const isServiceError = (data: unknown): data is ServiceError => {
|
|
return typeof data === 'object' &&
|
|
data !== null &&
|
|
'statusCode' in data &&
|
|
'errorCode' in data &&
|
|
'message' in data;
|
|
} |