import iterate from '../../fn/loop/iterate.js';
export default function transformResult(obj, fields) {
    if (!obj) {
        return undefined;
    }
    if (fields?.length) {
        const res = {};
        iterate(obj, (v, n) => {
            if (fields.includes(n)) {
                res[n] = v;
            }
        });
        return res;
    }
    return obj;
}
