export function objectHas(object, path) {
    let _path = path;
    if (typeof path === 'string') {
        _path = path.split('.');
    }
    return _path.every((key) => {
        if (typeof object != 'object' || object === null || !(key in object))
            return false;
        object = object[key];
        return true;
    });
}
export function objectSet(object, path, value) {
    let _path = path;
    if (typeof path === 'string') {
        _path = path.split('.');
    }
    const limit = _path.length - 1;
    for (let i = 0; i < limit; ++i) {
        const key = _path[i];
        object = object[key] ?? (object[key] = {});
    }
    const key = _path[limit];
    object[key] = value;
}
export function mapObject(obj, fn) {
    return Object.fromEntries(Object.entries(obj).map(([key, val]) => {
        return [key, fn(val, key)];
    }));
}
//# sourceMappingURL=object.js.map