"use strict";
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.pick = void 0;
/**
 * This is a type save implementation of the Pick<> utility
 * Say for example, you have an object and you want to pick a few properties from that object
 * In typescript, you can define the type very easily using Pick<> but the actual
 * implementation is a bit hard to do, hence this utility.
 *
 * For example:- let's say you have an object like this
 * ```js
 * const obj = {
 *   stringProp: "value1",
 *   numberProp: 2,
 * }
 * ```
 * It's type will be
 * ```ts
 * type obj = {
 *   stringProp: string,
 *   numberProp: number,
 * }
 * ```
 * Now if you want an object with only stringProp, you can simply do
 * ```ts
 * const objWithStringProp = pick<typeof obj, "stringProp">(obj, "stringProp")
 * ```
 * @param object The base object
 * @param keys The keys in the that you want to be picked
 * @returns
 */
function pick(object) {
    var keys = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        keys[_i - 1] = arguments[_i];
    }
    return Object.assign.apply(Object, __spreadArray([{}], keys.map(function (key) {
        var _a;
        return _a = {}, _a[key] = object[key], _a;
    }), false));
}
exports.pick = pick;
//# sourceMappingURL=transformers.js.map