openai
Version:
The official TypeScript library for the OpenAI API
12 lines (9 loc) • 339 B
text/typescript
import type { ZodSchema, ZodTypeDef } from 'zod';
export const zodDef = (zodSchema: ZodSchema | ZodTypeDef): ZodTypeDef => {
return '_def' in zodSchema ? zodSchema._def : zodSchema;
};
export function isEmptyObj(obj: Object | null | undefined): boolean {
if (!obj) return true;
for (const _k in obj) return false;
return true;
}