# Code coverage report for RxJS/dist/cjs/operators/merge-static.js

## Statements: 92% (23 / 25) Branches: 78.57% (11 / 14) Functions: 100% (2 / 2) Lines: 91.67% (22 / 24) Ignored: none

All files » RxJS/dist/cjs/operators/ » merge-static.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41

    1
    1

    2

    1

    1

    1

    1

    1

    1
    17
    17

    17
    38

    17
    17
    2
    2

    15
    1

    17

    17

    1'use strict';

    exports.__esModule = true;
    exports['default'] = merge;

    function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

    var _observablesArrayObservable = require('../observables/ArrayObservable');

    var _observablesArrayObservable2 = _interopRequireDefault(_observablesArrayObservable);

    var _mergeAllSupport = require('./mergeAll-support');

    var _schedulersImmediate = require('../schedulers/immediate');

    var _schedulersImmediate2 = _interopRequireDefault(_schedulersImmediate);

    function merge() {
        var concurrent = Number.POSITIVE_INFINITY;
        var scheduler = _schedulersImmediate2['default'];

        for (var _len = arguments.length, observables = Array(_len), _key = 0; _key < _len; _key++) {
            observables[_key] = arguments[_key];
        }

        var last = observables[observables.length - 1];
        if (typeof last.schedule === 'function') {
            scheduler = observables.pop();
            Iif (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
                concurrent = observables.pop();
            }
        } else if (typeof last === 'number') {
            concurrent = observables.pop();
        }
        Iif (observables.length === 1) {
            return observables[0];
        }
        return new _observablesArrayObservable2['default'](observables, scheduler).lift(new _mergeAllSupport.MergeAllOperator(concurrent));
    }

    module.exports = exports['default'];