index.test.ts
432 Bytes
import { describe, expect, it } from 'vitest';
import { toCamelCaseDeep } from './index';
describe('toCamelCaseDeep', () => {
it('converts snake_case keys recursively', () => {
expect(
toCamelCaseDeep({
staff_uuid: 'u-1',
read_case_list: [{ activity_id: 1, product_type: 0 }],
}),
).toEqual({
staffUuid: 'u-1',
readCaseList: [{ activityId: 1, productType: 0 }],
});
});
});