import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
const transformVariableValue = (value, deps)=>{
    const { targetCollectionField } = deps;
    if (null == value) return value;
    if (!targetCollectionField) return value;
    if ('chinaRegion' === targetCollectionField.interface) {
        if (Array.isArray(value)) return value.map((item)=>{
            __WEBPACK_EXTERNAL_MODULE_lodash__["default"].isObject(item);
            item = {
                ...item
            };
            Object.keys(item).forEach((key)=>{
                if (__WEBPACK_EXTERNAL_MODULE_lodash__["default"].isObjectLike(item[key])) delete item[key];
            });
            return item;
        });
    }
    if ([
        'hasMany',
        'belongsToMany'
    ].includes(targetCollectionField.type)) {
        if (!Array.isArray(value)) return [
            value
        ];
        return value;
    }
    targetCollectionField.interface;
    return value;
};
export { transformVariableValue };
