aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/util/throwUnobservableError.ts
blob: 6a5e88b8e3f23c63b9ca2806e438206257167186 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/**
 * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.
 * @param input The object that was passed.
 */
export function createInvalidObservableTypeError(input: any) {
  // TODO: We should create error codes that can be looked up, so this can be less verbose.
  return new TypeError(
    `You provided ${
      input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`
    } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`
  );
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage