"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPrimitive = isPrimitive;
const PRIMITIVE_TYPE_SET = new Set(['null', 'string', 'number', 'boolean']);
function isPrimitive(data) {
    const t = typeof data;
    if (PRIMITIVE_TYPE_SET.has(t)) {
        return true;
    }
    if (t === 'object') {
        if (Array.isArray(data)) {
            for (const element of data) {
                if (!isPrimitive(element)) {
                    return false;
                }
            }
        }
        for (const key in data) {
            const value = data[key];
            if (!isPrimitive(value)) {
                return false;
            }
        }
        return true;
    }
    if (t === 'function' && data.__bundle) {
        return true;
    }
    return false;
}
//# sourceMappingURL=primitive.js.map