refactor(shared): simplify normalize SDK null guards
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -7,7 +7,7 @@ export function normalizeSDKResponse<TData>(
|
||||
fallback: TData,
|
||||
options?: NormalizeSDKResponseOptions,
|
||||
): TData {
|
||||
if (response === null || response === undefined) {
|
||||
if (response == null) {
|
||||
return fallback
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export function normalizeSDKResponse<TData>(
|
||||
|
||||
if (typeof response === "object" && "data" in response) {
|
||||
const data = (response as { data?: unknown }).data
|
||||
if (data !== null && data !== undefined) {
|
||||
if (data != null) {
|
||||
return data as TData
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user