@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
12 lines (9 loc) • 378 B
text/typescript
import { describe, expect, it } from 'vitest';
import { cleanObject } from './object';
describe('cleanObject', () => {
it('should remove null, undefined and empty string fields', () => {
const input = { a: 1, b: null, c: undefined, d: '', e: 0, f: false } as const;
const res = cleanObject({ ...input });
expect(res).toEqual({ a: 1, e: 0, f: false });
});
});