"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortObjectComparator = exports.getKeys = exports.omit = exports.pick = void 0;
function pick(object, keys) {
    const result = {};
    for (const key of keys) {
        if (Object.prototype.hasOwnProperty.call(object, key)) {
            result[key] = object[key];
        }
    }
    return result;
}
exports.pick = pick;
function omit(object, keys) {
    const result = {};
    const keysSet = new Set(keys);
    for (const [key, value] of Object.entries(object)) {
        if (keysSet.has(key))
            continue;
        result[key] = value;
    }
    return result;
}
exports.omit = omit;
function getKeys(object, keys) {
    return Object.keys(object).filter(k => keys.includes(k));
}
exports.getKeys = getKeys;
function sortObjectComparator(key, order) {
    return (a, b) => {
        if (a[key] < b[key]) {
            return order === 'asc' ? -1 : 1;
        }
        if (a[key] > b[key]) {
            return order === 'asc' ? 1 : -1;
        }
        return 0;
    };
}
exports.sortObjectComparator = sortObjectComparator;
//# sourceMappingURL=object.js.map