diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
| commit | d55b767039605256c736166a942a9138e3eacfd7 (patch) | |
| tree | 947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/util | |
| parent | 864ce67d89c77d8ef9c3361f80d619853abcf91c (diff) | |
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/util')
36 files changed, 0 insertions, 739 deletions
diff --git a/node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts b/node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts deleted file mode 100644 index 9a89d76..0000000 --- a/node_modules/rxjs/src/internal/util/ArgumentOutOfRangeError.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface ArgumentOutOfRangeError extends Error {} - -export interface ArgumentOutOfRangeErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (): ArgumentOutOfRangeError; -} - -/** - * An error thrown when an element was queried at a certain index of an - * Observable, but no such index or position exists in that sequence. - * - * @see {@link elementAt} - * @see {@link take} - * @see {@link takeLast} - */ -export const ArgumentOutOfRangeError: ArgumentOutOfRangeErrorCtor = createErrorClass( - (_super) => - function ArgumentOutOfRangeErrorImpl(this: any) { - _super(this); - this.name = 'ArgumentOutOfRangeError'; - this.message = 'argument out of range'; - } -); diff --git a/node_modules/rxjs/src/internal/util/EmptyError.ts b/node_modules/rxjs/src/internal/util/EmptyError.ts deleted file mode 100644 index eb2c5e3..0000000 --- a/node_modules/rxjs/src/internal/util/EmptyError.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface EmptyError extends Error {} - -export interface EmptyErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (): EmptyError; -} - -/** - * An error thrown when an Observable or a sequence was queried but has no - * elements. - * - * @see {@link first} - * @see {@link last} - * @see {@link single} - * @see {@link firstValueFrom} - * @see {@link lastValueFrom} - */ -export const EmptyError: EmptyErrorCtor = createErrorClass( - (_super) => - function EmptyErrorImpl(this: any) { - _super(this); - this.name = 'EmptyError'; - this.message = 'no elements in sequence'; - } -); diff --git a/node_modules/rxjs/src/internal/util/Immediate.ts b/node_modules/rxjs/src/internal/util/Immediate.ts deleted file mode 100644 index f01f546..0000000 --- a/node_modules/rxjs/src/internal/util/Immediate.ts +++ /dev/null @@ -1,45 +0,0 @@ -let nextHandle = 1; -// The promise needs to be created lazily otherwise it won't be patched by Zones -let resolved: Promise<any>; -const activeHandles: { [key: number]: any } = {}; - -/** - * Finds the handle in the list of active handles, and removes it. - * Returns `true` if found, `false` otherwise. Used both to clear - * Immediate scheduled tasks, and to identify if a task should be scheduled. - */ -function findAndClearHandle(handle: number): boolean { - if (handle in activeHandles) { - delete activeHandles[handle]; - return true; - } - return false; -} - -/** - * Helper functions to schedule and unschedule microtasks. - */ -export const Immediate = { - setImmediate(cb: () => void): number { - const handle = nextHandle++; - activeHandles[handle] = true; - if (!resolved) { - resolved = Promise.resolve(); - } - resolved.then(() => findAndClearHandle(handle) && cb()); - return handle; - }, - - clearImmediate(handle: number): void { - findAndClearHandle(handle); - }, -}; - -/** - * Used for internal testing purposes only. Do not export from library. - */ -export const TestTools = { - pending() { - return Object.keys(activeHandles).length; - } -}; diff --git a/node_modules/rxjs/src/internal/util/NotFoundError.ts b/node_modules/rxjs/src/internal/util/NotFoundError.ts deleted file mode 100644 index ecd213f..0000000 --- a/node_modules/rxjs/src/internal/util/NotFoundError.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface NotFoundError extends Error {} - -export interface NotFoundErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (message: string): NotFoundError; -} - -/** - * An error thrown when a value or values are missing from an - * observable sequence. - * - * @see {@link operators/single} - */ -export const NotFoundError: NotFoundErrorCtor = createErrorClass( - (_super) => - function NotFoundErrorImpl(this: any, message: string) { - _super(this); - this.name = 'NotFoundError'; - this.message = message; - } -); diff --git a/node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts b/node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts deleted file mode 100644 index 5e833f9..0000000 --- a/node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface ObjectUnsubscribedError extends Error {} - -export interface ObjectUnsubscribedErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (): ObjectUnsubscribedError; -} - -/** - * An error thrown when an action is invalid because the object has been - * unsubscribed. - * - * @see {@link Subject} - * @see {@link BehaviorSubject} - * - * @class ObjectUnsubscribedError - */ -export const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass( - (_super) => - function ObjectUnsubscribedErrorImpl(this: any) { - _super(this); - this.name = 'ObjectUnsubscribedError'; - this.message = 'object unsubscribed'; - } -); diff --git a/node_modules/rxjs/src/internal/util/SequenceError.ts b/node_modules/rxjs/src/internal/util/SequenceError.ts deleted file mode 100644 index 06483d0..0000000 --- a/node_modules/rxjs/src/internal/util/SequenceError.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface SequenceError extends Error {} - -export interface SequenceErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (message: string): SequenceError; -} - -/** - * An error thrown when something is wrong with the sequence of - * values arriving on the observable. - * - * @see {@link operators/single} - */ -export const SequenceError: SequenceErrorCtor = createErrorClass( - (_super) => - function SequenceErrorImpl(this: any, message: string) { - _super(this); - this.name = 'SequenceError'; - this.message = message; - } -); diff --git a/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts b/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts deleted file mode 100644 index cd7d09f..0000000 --- a/node_modules/rxjs/src/internal/util/UnsubscriptionError.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { createErrorClass } from './createErrorClass'; - -export interface UnsubscriptionError extends Error { - readonly errors: any[]; -} - -export interface UnsubscriptionErrorCtor { - /** - * @deprecated Internal implementation detail. Do not construct error instances. - * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269 - */ - new (errors: any[]): UnsubscriptionError; -} - -/** - * An error thrown when one or more errors have occurred during the - * `unsubscribe` of a {@link Subscription}. - */ -export const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass( - (_super) => - function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) { - _super(this); - this.message = errors - ? `${errors.length} errors occurred during unsubscription: -${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` - : ''; - this.name = 'UnsubscriptionError'; - this.errors = errors; - } -); diff --git a/node_modules/rxjs/src/internal/util/applyMixins.ts b/node_modules/rxjs/src/internal/util/applyMixins.ts deleted file mode 100644 index 7c1ed24..0000000 --- a/node_modules/rxjs/src/internal/util/applyMixins.ts +++ /dev/null @@ -1,10 +0,0 @@ -export function applyMixins(derivedCtor: any, baseCtors: any[]) { - for (let i = 0, len = baseCtors.length; i < len; i++) { - const baseCtor = baseCtors[i]; - const propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype); - for (let j = 0, len2 = propertyKeys.length; j < len2; j++) { - const name = propertyKeys[j]; - derivedCtor.prototype[name] = baseCtor.prototype[name]; - } - } -}
\ No newline at end of file diff --git a/node_modules/rxjs/src/internal/util/args.ts b/node_modules/rxjs/src/internal/util/args.ts deleted file mode 100644 index 0ce104b..0000000 --- a/node_modules/rxjs/src/internal/util/args.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SchedulerLike } from '../types'; -import { isFunction } from './isFunction'; -import { isScheduler } from './isScheduler'; - -function last<T>(arr: T[]): T | undefined { - return arr[arr.length - 1]; -} - -export function popResultSelector(args: any[]): ((...args: unknown[]) => unknown) | undefined { - return isFunction(last(args)) ? args.pop() : undefined; -} - -export function popScheduler(args: any[]): SchedulerLike | undefined { - return isScheduler(last(args)) ? args.pop() : undefined; -} - -export function popNumber(args: any[], defaultValue: number): number { - return typeof last(args) === 'number' ? args.pop()! : defaultValue; -} diff --git a/node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts b/node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts deleted file mode 100644 index 483bef9..0000000 --- a/node_modules/rxjs/src/internal/util/argsArgArrayOrObject.ts +++ /dev/null @@ -1,30 +0,0 @@ -const { isArray } = Array; -const { getPrototypeOf, prototype: objectProto, keys: getKeys } = Object; - -/** - * Used in functions where either a list of arguments, a single array of arguments, or a - * dictionary of arguments can be returned. Returns an object with an `args` property with - * the arguments in an array, if it is a dictionary, it will also return the `keys` in another - * property. - */ -export function argsArgArrayOrObject<T, O extends Record<string, T>>(args: T[] | [O] | [T[]]): { args: T[]; keys: string[] | null } { - if (args.length === 1) { - const first = args[0]; - if (isArray(first)) { - return { args: first, keys: null }; - } - if (isPOJO(first)) { - const keys = getKeys(first); - return { - args: keys.map((key) => first[key]), - keys, - }; - } - } - - return { args: args as T[], keys: null }; -} - -function isPOJO(obj: any): obj is object { - return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto; -} diff --git a/node_modules/rxjs/src/internal/util/argsOrArgArray.ts b/node_modules/rxjs/src/internal/util/argsOrArgArray.ts deleted file mode 100644 index b0096ce..0000000 --- a/node_modules/rxjs/src/internal/util/argsOrArgArray.ts +++ /dev/null @@ -1,9 +0,0 @@ -const { isArray } = Array; - -/** - * Used in operators and functions that accept either a list of arguments, or an array of arguments - * as a single argument. - */ -export function argsOrArgArray<T>(args: (T | T[])[]): T[] { - return args.length === 1 && isArray(args[0]) ? args[0] : (args as T[]); -} diff --git a/node_modules/rxjs/src/internal/util/arrRemove.ts b/node_modules/rxjs/src/internal/util/arrRemove.ts deleted file mode 100644 index 51a76cd..0000000 --- a/node_modules/rxjs/src/internal/util/arrRemove.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Removes an item from an array, mutating it. - * @param arr The array to remove the item from - * @param item The item to remove - */ -export function arrRemove<T>(arr: T[] | undefined | null, item: T) { - if (arr) { - const index = arr.indexOf(item); - 0 <= index && arr.splice(index, 1); - } -} diff --git a/node_modules/rxjs/src/internal/util/createErrorClass.ts b/node_modules/rxjs/src/internal/util/createErrorClass.ts deleted file mode 100644 index e354fd3..0000000 --- a/node_modules/rxjs/src/internal/util/createErrorClass.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Used to create Error subclasses until the community moves away from ES5. - * - * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors - * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123 - * - * @param createImpl A factory function to create the actual constructor implementation. The returned - * function should be a named function that calls `_super` internally. - */ -export function createErrorClass<T>(createImpl: (_super: any) => any): T { - const _super = (instance: any) => { - Error.call(instance); - instance.stack = new Error().stack; - }; - - const ctorFunc = createImpl(_super); - ctorFunc.prototype = Object.create(Error.prototype); - ctorFunc.prototype.constructor = ctorFunc; - return ctorFunc; -} diff --git a/node_modules/rxjs/src/internal/util/createObject.ts b/node_modules/rxjs/src/internal/util/createObject.ts deleted file mode 100644 index 0f79f92..0000000 --- a/node_modules/rxjs/src/internal/util/createObject.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function createObject(keys: string[], values: any[]) { - return keys.reduce((result, key, i) => ((result[key] = values[i]), result), {} as any); -} diff --git a/node_modules/rxjs/src/internal/util/errorContext.ts b/node_modules/rxjs/src/internal/util/errorContext.ts deleted file mode 100644 index 6c4ffb1..0000000 --- a/node_modules/rxjs/src/internal/util/errorContext.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { config } from '../config'; - -let context: { errorThrown: boolean; error: any } | null = null; - -/** - * Handles dealing with errors for super-gross mode. Creates a context, in which - * any synchronously thrown errors will be passed to {@link captureError}. Which - * will record the error such that it will be rethrown after the call back is complete. - * TODO: Remove in v8 - * @param cb An immediately executed function. - */ -export function errorContext(cb: () => void) { - if (config.useDeprecatedSynchronousErrorHandling) { - const isRoot = !context; - if (isRoot) { - context = { errorThrown: false, error: null }; - } - cb(); - if (isRoot) { - const { errorThrown, error } = context!; - context = null; - if (errorThrown) { - throw error; - } - } - } else { - // This is the general non-deprecated path for everyone that - // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling) - cb(); - } -} - -/** - * Captures errors only in super-gross mode. - * @param err the error to capture - */ -export function captureError(err: any) { - if (config.useDeprecatedSynchronousErrorHandling && context) { - context.errorThrown = true; - context.error = err; - } -} diff --git a/node_modules/rxjs/src/internal/util/executeSchedule.ts b/node_modules/rxjs/src/internal/util/executeSchedule.ts deleted file mode 100644 index 1bcb990..0000000 --- a/node_modules/rxjs/src/internal/util/executeSchedule.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { Subscription } from '../Subscription'; -import { SchedulerAction, SchedulerLike } from '../types'; - -export function executeSchedule( - parentSubscription: Subscription, - scheduler: SchedulerLike, - work: () => void, - delay: number, - repeat: true -): void; -export function executeSchedule( - parentSubscription: Subscription, - scheduler: SchedulerLike, - work: () => void, - delay?: number, - repeat?: false -): Subscription; - -export function executeSchedule( - parentSubscription: Subscription, - scheduler: SchedulerLike, - work: () => void, - delay = 0, - repeat = false -): Subscription | void { - const scheduleSubscription = scheduler.schedule(function (this: SchedulerAction<any>) { - work(); - if (repeat) { - parentSubscription.add(this.schedule(null, delay)); - } else { - this.unsubscribe(); - } - }, delay); - - parentSubscription.add(scheduleSubscription); - - if (!repeat) { - // Because user-land scheduler implementations are unlikely to properly reuse - // Actions for repeat scheduling, we can't trust that the returned subscription - // will control repeat subscription scenarios. So we're trying to avoid using them - // incorrectly within this library. - return scheduleSubscription; - } -} diff --git a/node_modules/rxjs/src/internal/util/identity.ts b/node_modules/rxjs/src/internal/util/identity.ts deleted file mode 100644 index 0b07958..0000000 --- a/node_modules/rxjs/src/internal/util/identity.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * This function takes one parameter and just returns it. Simply put, - * this is like `<T>(x: T): T => x`. - * - * ## Examples - * - * This is useful in some cases when using things like `mergeMap` - * - * ```ts - * import { interval, take, map, range, mergeMap, identity } from 'rxjs'; - * - * const source$ = interval(1000).pipe(take(5)); - * - * const result$ = source$.pipe( - * map(i => range(i)), - * mergeMap(identity) // same as mergeMap(x => x) - * ); - * - * result$.subscribe({ - * next: console.log - * }); - * ``` - * - * Or when you want to selectively apply an operator - * - * ```ts - * import { interval, take, identity } from 'rxjs'; - * - * const shouldLimit = () => Math.random() < 0.5; - * - * const source$ = interval(1000); - * - * const result$ = source$.pipe(shouldLimit() ? take(5) : identity); - * - * result$.subscribe({ - * next: console.log - * }); - * ``` - * - * @param x Any value that is returned by this function - * @returns The value passed as the first parameter to this function - */ -export function identity<T>(x: T): T { - return x; -} diff --git a/node_modules/rxjs/src/internal/util/isArrayLike.ts b/node_modules/rxjs/src/internal/util/isArrayLike.ts deleted file mode 100644 index 6f634d4..0000000 --- a/node_modules/rxjs/src/internal/util/isArrayLike.ts +++ /dev/null @@ -1 +0,0 @@ -export const isArrayLike = (<T>(x: any): x is ArrayLike<T> => x && typeof x.length === 'number' && typeof x !== 'function');
\ No newline at end of file diff --git a/node_modules/rxjs/src/internal/util/isAsyncIterable.ts b/node_modules/rxjs/src/internal/util/isAsyncIterable.ts deleted file mode 100644 index d419dc3..0000000 --- a/node_modules/rxjs/src/internal/util/isAsyncIterable.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { isFunction } from './isFunction'; - -export function isAsyncIterable<T>(obj: any): obj is AsyncIterable<T> { - return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]); -} diff --git a/node_modules/rxjs/src/internal/util/isDate.ts b/node_modules/rxjs/src/internal/util/isDate.ts deleted file mode 100644 index ed09ffb..0000000 --- a/node_modules/rxjs/src/internal/util/isDate.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Checks to see if a value is not only a `Date` object, - * but a *valid* `Date` object that can be converted to a - * number. For example, `new Date('blah')` is indeed an - * `instanceof Date`, however it cannot be converted to a - * number. - */ -export function isValidDate(value: any): value is Date { - return value instanceof Date && !isNaN(value as any); -} diff --git a/node_modules/rxjs/src/internal/util/isFunction.ts b/node_modules/rxjs/src/internal/util/isFunction.ts deleted file mode 100644 index 2715f07..0000000 --- a/node_modules/rxjs/src/internal/util/isFunction.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Returns true if the object is a function. - * @param value The value to check - */ -export function isFunction(value: any): value is (...args: any[]) => any { - return typeof value === 'function'; -} diff --git a/node_modules/rxjs/src/internal/util/isInteropObservable.ts b/node_modules/rxjs/src/internal/util/isInteropObservable.ts deleted file mode 100644 index e709b8a..0000000 --- a/node_modules/rxjs/src/internal/util/isInteropObservable.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { InteropObservable } from '../types'; -import { observable as Symbol_observable } from '../symbol/observable'; -import { isFunction } from './isFunction'; - -/** Identifies an input as being Observable (but not necessary an Rx Observable) */ -export function isInteropObservable(input: any): input is InteropObservable<any> { - return isFunction(input[Symbol_observable]); -} diff --git a/node_modules/rxjs/src/internal/util/isIterable.ts b/node_modules/rxjs/src/internal/util/isIterable.ts deleted file mode 100644 index 9b492b3..0000000 --- a/node_modules/rxjs/src/internal/util/isIterable.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { iterator as Symbol_iterator } from '../symbol/iterator'; -import { isFunction } from './isFunction'; - -/** Identifies an input as being an Iterable */ -export function isIterable(input: any): input is Iterable<any> { - return isFunction(input?.[Symbol_iterator]); -} diff --git a/node_modules/rxjs/src/internal/util/isObservable.ts b/node_modules/rxjs/src/internal/util/isObservable.ts deleted file mode 100644 index 8df8f32..0000000 --- a/node_modules/rxjs/src/internal/util/isObservable.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** prettier */ -import { Observable } from '../Observable'; -import { isFunction } from './isFunction'; - -/** - * Tests to see if the object is an RxJS {@link Observable} - * @param obj the object to test - */ -export function isObservable(obj: any): obj is Observable<unknown> { - // The !! is to ensure that this publicly exposed function returns - // `false` if something like `null` or `0` is passed. - return !!obj && (obj instanceof Observable || (isFunction(obj.lift) && isFunction(obj.subscribe))); -} diff --git a/node_modules/rxjs/src/internal/util/isPromise.ts b/node_modules/rxjs/src/internal/util/isPromise.ts deleted file mode 100644 index 0baef64..0000000 --- a/node_modules/rxjs/src/internal/util/isPromise.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { isFunction } from "./isFunction"; - -/** - * Tests to see if the object is "thennable". - * @param value the object to test - */ -export function isPromise(value: any): value is PromiseLike<any> { - return isFunction(value?.then); -} diff --git a/node_modules/rxjs/src/internal/util/isReadableStreamLike.ts b/node_modules/rxjs/src/internal/util/isReadableStreamLike.ts deleted file mode 100644 index 87b9c15..0000000 --- a/node_modules/rxjs/src/internal/util/isReadableStreamLike.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ReadableStreamLike } from '../types'; -import { isFunction } from './isFunction'; - -export async function* readableStreamLikeToAsyncGenerator<T>(readableStream: ReadableStreamLike<T>): AsyncGenerator<T> { - const reader = readableStream.getReader(); - try { - while (true) { - const { value, done } = await reader.read(); - if (done) { - return; - } - yield value!; - } - } finally { - reader.releaseLock(); - } -} - -export function isReadableStreamLike<T>(obj: any): obj is ReadableStreamLike<T> { - // We don't want to use instanceof checks because they would return - // false for instances from another Realm, like an <iframe>. - return isFunction(obj?.getReader); -} diff --git a/node_modules/rxjs/src/internal/util/isScheduler.ts b/node_modules/rxjs/src/internal/util/isScheduler.ts deleted file mode 100644 index f81ee08..0000000 --- a/node_modules/rxjs/src/internal/util/isScheduler.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SchedulerLike } from '../types'; -import { isFunction } from './isFunction'; - -export function isScheduler(value: any): value is SchedulerLike { - return value && isFunction(value.schedule); -} diff --git a/node_modules/rxjs/src/internal/util/lift.ts b/node_modules/rxjs/src/internal/util/lift.ts deleted file mode 100644 index e841ec3..0000000 --- a/node_modules/rxjs/src/internal/util/lift.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Observable } from '../Observable'; -import { Subscriber } from '../Subscriber'; -import { OperatorFunction } from '../types'; -import { isFunction } from './isFunction'; - -/** - * Used to determine if an object is an Observable with a lift function. - */ -export function hasLift(source: any): source is { lift: InstanceType<typeof Observable>['lift'] } { - return isFunction(source?.lift); -} - -/** - * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way. - * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription. - */ -export function operate<T, R>( - init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void -): OperatorFunction<T, R> { - return (source: Observable<T>) => { - if (hasLift(source)) { - return source.lift(function (this: Subscriber<R>, liftedSource: Observable<T>) { - try { - return init(liftedSource, this); - } catch (err) { - this.error(err); - } - }); - } - throw new TypeError('Unable to lift unknown Observable type'); - }; -} diff --git a/node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts b/node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts deleted file mode 100644 index ded1420..0000000 --- a/node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { OperatorFunction } from "../types"; -import { map } from "../operators/map"; - -const { isArray } = Array; - -function callOrApply<T, R>(fn: ((...values: T[]) => R), args: T|T[]): R { - return isArray(args) ? fn(...args) : fn(args); -} - -/** - * Used in several -- mostly deprecated -- situations where we need to - * apply a list of arguments or a single argument to a result selector. - */ -export function mapOneOrManyArgs<T, R>(fn: ((...values: T[]) => R)): OperatorFunction<T|T[], R> { - return map(args => callOrApply(fn, args)) -}
\ No newline at end of file diff --git a/node_modules/rxjs/src/internal/util/noop.ts b/node_modules/rxjs/src/internal/util/noop.ts deleted file mode 100644 index fc857f2..0000000 --- a/node_modules/rxjs/src/internal/util/noop.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* tslint:disable:no-empty */ -export function noop() { } diff --git a/node_modules/rxjs/src/internal/util/not.ts b/node_modules/rxjs/src/internal/util/not.ts deleted file mode 100644 index 5e5d7e2..0000000 --- a/node_modules/rxjs/src/internal/util/not.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function not<T>(pred: (value: T, index: number) => boolean, thisArg: any): (value: T, index: number) => boolean { - return (value: T, index: number) => !pred.call(thisArg, value, index); -}
\ No newline at end of file diff --git a/node_modules/rxjs/src/internal/util/pipe.ts b/node_modules/rxjs/src/internal/util/pipe.ts deleted file mode 100644 index ff69acc..0000000 --- a/node_modules/rxjs/src/internal/util/pipe.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { identity } from './identity'; -import { UnaryFunction } from '../types'; - -export function pipe(): typeof identity; -export function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>; -export function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>; -export function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>; -export function pipe<T, A, B, C, D>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D> -): UnaryFunction<T, D>; -export function pipe<T, A, B, C, D, E>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E> -): UnaryFunction<T, E>; -export function pipe<T, A, B, C, D, E, F>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E>, - fn6: UnaryFunction<E, F> -): UnaryFunction<T, F>; -export function pipe<T, A, B, C, D, E, F, G>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E>, - fn6: UnaryFunction<E, F>, - fn7: UnaryFunction<F, G> -): UnaryFunction<T, G>; -export function pipe<T, A, B, C, D, E, F, G, H>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E>, - fn6: UnaryFunction<E, F>, - fn7: UnaryFunction<F, G>, - fn8: UnaryFunction<G, H> -): UnaryFunction<T, H>; -export function pipe<T, A, B, C, D, E, F, G, H, I>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E>, - fn6: UnaryFunction<E, F>, - fn7: UnaryFunction<F, G>, - fn8: UnaryFunction<G, H>, - fn9: UnaryFunction<H, I> -): UnaryFunction<T, I>; -export function pipe<T, A, B, C, D, E, F, G, H, I>( - fn1: UnaryFunction<T, A>, - fn2: UnaryFunction<A, B>, - fn3: UnaryFunction<B, C>, - fn4: UnaryFunction<C, D>, - fn5: UnaryFunction<D, E>, - fn6: UnaryFunction<E, F>, - fn7: UnaryFunction<F, G>, - fn8: UnaryFunction<G, H>, - fn9: UnaryFunction<H, I>, - ...fns: UnaryFunction<any, any>[] -): UnaryFunction<T, unknown>; - -/** - * pipe() can be called on one or more functions, each of which can take one argument ("UnaryFunction") - * and uses it to return a value. - * It returns a function that takes one argument, passes it to the first UnaryFunction, and then - * passes the result to the next one, passes that result to the next one, and so on. - */ -export function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> { - return pipeFromArray(fns); -} - -/** @internal */ -export function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> { - if (fns.length === 0) { - return identity as UnaryFunction<any, any>; - } - - if (fns.length === 1) { - return fns[0]; - } - - return function piped(input: T): R { - return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any); - }; -} diff --git a/node_modules/rxjs/src/internal/util/reportUnhandledError.ts b/node_modules/rxjs/src/internal/util/reportUnhandledError.ts deleted file mode 100644 index d996956..0000000 --- a/node_modules/rxjs/src/internal/util/reportUnhandledError.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { config } from '../config'; -import { timeoutProvider } from '../scheduler/timeoutProvider'; - -/** - * Handles an error on another job either with the user-configured {@link onUnhandledError}, - * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc. - * - * This should be called whenever there is an error that is out-of-band with the subscription - * or when an error hits a terminal boundary of the subscription and no error handler was provided. - * - * @param err the error to report - */ -export function reportUnhandledError(err: any) { - timeoutProvider.setTimeout(() => { - const { onUnhandledError } = config; - if (onUnhandledError) { - // Execute the user-configured error handler. - onUnhandledError(err); - } else { - // Throw so it is picked up by the runtime's uncaught error mechanism. - throw err; - } - }); -} diff --git a/node_modules/rxjs/src/internal/util/subscribeToArray.ts b/node_modules/rxjs/src/internal/util/subscribeToArray.ts deleted file mode 100644 index 0ca5294..0000000 --- a/node_modules/rxjs/src/internal/util/subscribeToArray.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Subscriber } from '../Subscriber'; - -/** - * Subscribes to an ArrayLike with a subscriber - * @param array The array or array-like to subscribe to - */ -export const subscribeToArray = <T>(array: ArrayLike<T>) => (subscriber: Subscriber<T>) => { - for (let i = 0, len = array.length; i < len && !subscriber.closed; i++) { - subscriber.next(array[i]); - } - subscriber.complete(); -}; diff --git a/node_modules/rxjs/src/internal/util/throwUnobservableError.ts b/node_modules/rxjs/src/internal/util/throwUnobservableError.ts deleted file mode 100644 index 6a5e88b..0000000 --- a/node_modules/rxjs/src/internal/util/throwUnobservableError.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 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.` - ); -} diff --git a/node_modules/rxjs/src/internal/util/workarounds.ts b/node_modules/rxjs/src/internal/util/workarounds.ts deleted file mode 100644 index 00c01b8..0000000 --- a/node_modules/rxjs/src/internal/util/workarounds.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Instead of using any - or another less-than-ideal type - to workaround a -// TypeScript problem or bug, create a type alias and use that instead. -// Wherever possible, use a TypeScript issue number in the type - something -// like TS_18757 - or use a descriptive name and leave a detailed comment -// alongside the type alias. - -export {} |
