import { iterateFields } from './iterateFields.js';
const buildStateFromSchema = async (args)=>{
    const { id, data: fullData = {}, fieldSchema, operation, preferences, req } = args;
    if (fieldSchema) {
        const state = {};
        await iterateFields({
            id,
            data: fullData,
            errorPaths: new Set(),
            fields: fieldSchema,
            fullData,
            operation,
            parentPassesCondition: true,
            path: '',
            preferences,
            req,
            state
        });
        return state;
    }
    return {};
};
export default buildStateFromSchema;

//# sourceMappingURL=index.js.map