export function flatten(data, prefix = '', skipList = [], keyTransformation = (input) => input) {
    let result = {};
    for (const key in data) {
        if (!prefix && skipList.includes(key))
            continue;
        if (typeof data[key] === 'object' && data[key] !== null) {
            const flattened = flatten(data[key], `${prefix}_${key}`, skipList, keyTransformation);
            result = { ...result, ...flattened };
        }
        else {
            result[keyTransformation(`${prefix}_${key}`.replace(/^_/, ''))] = data[key];
        }
    }
    return result;
}
//# sourceMappingURL=flatten.js.map