export function serializeParams(params) {
    var options = [];
    var _loop_1 = function (key) {
        if (typeof params[key] === 'object' && params[key] !== undefined && params[key].length !== undefined) {
            // array
            if (params[key].length > 0) {
                params[key].forEach(function (el) { return options.push(key + "=" + serializeValue(el)); }); // array not empty
            }
        }
        else if (params[key] !== undefined) {
            options.push(key + "=" + serializeValue(params[key]));
        }
    };
    for (var key in params) {
        _loop_1(key);
    }
    return options.join('&');
}
function serializeValue(value) {
    return typeof value !== 'object'
        ? encodeURIComponent(value)
        : toString.call(value) === '[object Date]'
            ? value.toISOString()
            : encodeURI(JSON.stringify(value));
}
//# sourceMappingURL=http-param-serializer.js.map