UNPKG

@buka/nestjs-config

Version:
18 lines (17 loc) 513 B
/* eslint-disable @typescript-eslint/no-explicit-any */ import { toCamelCase } from './to-camel-case.js'; function anyToCamelCase(value) { if (typeof value !== 'object') return value; if (Array.isArray(value)) { return value.map((v) => anyToCamelCase(v)); } const result = {}; for (const key in value) { result[toCamelCase(key)] = anyToCamelCase(value[key]); } return result; } export function objectKeysToCamelCase(value) { return anyToCamelCase(value); }