import { iterateFields } from './iterateFields';
const buildStateFromSchema = async (args) => {
    const { fieldSchema, data: fullData = {}, user, id, operation, locale, t, } = args;
    if (fieldSchema) {
        const state = {};
        await iterateFields({
            state,
            fields: fieldSchema,
            id,
            locale,
            operation,
            path: '',
            user,
            data: fullData,
            fullData,
            parentPassesCondition: true,
            t,
        });
        return state;
    }
    return {};
};
export default buildStateFromSchema;
