diff --git a/spec/observables/merge-spec.ts b/spec/observables/merge-spec.ts index 249b0325a9..1fce9107b7 100644 --- a/spec/observables/merge-spec.ts +++ b/spec/observables/merge-spec.ts @@ -282,4 +282,10 @@ describe('merge(...observables, Scheduler, number)', () => { expect(e1Subscribed).to.be.false; }); + + it('should deem a single array argument to be an ObservableInput', () => { + const array = ['foo', 'bar']; + const expected = '(fb|)'; + expectObservable(merge(array)).toBe(expected, { f: 'foo', b: 'bar' }); + }); }); diff --git a/src/internal/observable/merge.ts b/src/internal/observable/merge.ts index 0b13fc4c05..e4590fd435 100644 --- a/src/internal/observable/merge.ts +++ b/src/internal/observable/merge.ts @@ -2,7 +2,6 @@ import { Observable } from '../Observable'; import { ObservableInput, ObservableInputTuple, SchedulerLike } from '../types'; import { mergeAll } from '../operators/mergeAll'; import { internalFromArray } from './fromArray'; -import { argsOrArgArray } from '../util/argsOrArgArray'; import { innerFrom } from './from'; import { EMPTY } from './empty'; import { popNumber, popScheduler } from '../util/args'; @@ -88,7 +87,7 @@ export function merge( export function merge(...args: (ObservableInput | number | SchedulerLike)[]): Observable { const scheduler = popScheduler(args); const concurrent = popNumber(args, Infinity); - const sources = argsOrArgArray(args) as ObservableInput[]; + const sources = args as ObservableInput[]; return !sources.length ? // No source provided EMPTY