Debian Codegraph @

node/rxjs/src/internal/util/throwUnobservableError.ts

raw
1 /**
2 * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.
3 * @param input The object that was passed.
4 */
5 export function createInvalidObservableTypeError(input: any) {
6 // TODO: We should create error codes that can be looked up, so this can be less verbose.
7 return new TypeError(
8 `You provided ${
9 input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`
10 } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`
11 );
12 }