/** Turns a nested object into a flat list of key-value pairs */
export function flatten(obj) {
    return Object.assign({}, ...(function _flatten(o, prevKey = "") {
        return [].concat(...Object.keys(o).map((_k) => {
            const k = _k;
            return typeof o[k] === "object"
                ? _flatten(o[k], prevKey ? `${prevKey}.${k}` : k)
                : { [prevKey ? `${prevKey}.${k}` : k]: o[k] };
        }));
    })(obj));
}
//# sourceMappingURL=flatten.js.map