"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeIsVisibleFn = serializeIsVisibleFn;
exports.isInstanceBaseProps = isInstanceBaseProps;
function serializeIsVisibleFn(options) {
    return (options ?? []).map((option) => {
        if ('isVisibleExpression' in option && typeof option.isVisibleExpression === 'string') {
            return {
                ...option,
                isVisibleFnType: 'expression',
                isVisibleFn: option.isVisibleExpression,
                isVisible: undefined,
                isVisibleExpression: undefined,
            };
        }
        else if ('isVisible' in option && typeof option.isVisible === 'function') {
            return {
                ...option,
                isVisibleFn: option.isVisible.toString(),
                isVisibleFnType: 'function',
                isVisible: undefined,
                isVisibleExpression: undefined,
            };
        }
        // ignore any existing `isVisibleFn` to avoid code injection
        return {
            ...option,
            isVisible: undefined,
            isVisibleFn: undefined,
            isVisibleFnType: undefined,
            isVisibleExpression: undefined,
        };
    });
}
function isInstanceBaseProps(obj) {
    const obj2 = obj;
    return typeof obj2 === 'object' && typeof obj2.id === 'string' && obj2._isInstanceBaseProps === true;
}
//# sourceMappingURL=base.js.map