Closed yutak23 closed 1 year ago
I use this library in TypeScript (thank you for developing it).
When the following implementation, the type definitions of Date and class fields and methods are also converted to camelCase.
class Point { x: number; y: number; addPoint(point: Point): Point { return ...; } constructor(x: number, y: number) { ... } } const point = new Point(0, 10); const result = camelcaseKeys({ foo_Baz: point, foo_bar: new Date() }, { deep: true });
// type structure of `result` const result: { fooBaz: { x: number; y: number; addPoint: (point: Point) => Point; }; fooBar: { toString: () => string; toDateString: () => string; toTimeString: () => string; toLocaleString: { (): string; (locales?: string | string[] | undefined, options?: Intl.DateTimeFormatOptions | undefined): string; (locales?: Intl.LocalesArgument, options?: Intl.DateTimeFormatOptions | undefined): string; }; ... 39 more ...; [Symbol.toPrimitive]: { ...; }; }; }
I think the expected value is below.
const result: { fooBaz: Point; fooBar: Date }
I use this library in TypeScript (thank you for developing it).
When the following implementation, the type definitions of Date and class fields and methods are also converted to camelCase.
I think the expected value is below.