"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSerializableProperties = getSerializableProperties;
const client_1 = require("@apollo/client");
const utilities_1 = require("@apollo/client/utilities");
function isKnownClassInstance(value) {
    return [client_1.ApolloClient, client_1.ObservableQuery].some((c) => value instanceof c);
}
function getSerializableProperties(obj) {
    if (Array.isArray(obj)) {
        return obj.map((item) => getSerializableProperties(item));
    }
    if ((0, utilities_1.isPlainObject)(obj)) {
        return Object.entries(obj).reduce((memo, [key, value]) => {
            if (typeof value === "function" || isKnownClassInstance(value)) {
                return memo;
            }
            return { ...memo, [key]: value };
        }, {});
    }
    return obj;
}
//# sourceMappingURL=getSerializableProperties.cjs.map
