Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / util / canReportError.ts
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/util/canReportError.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/util/canReportError.ts
new file mode 100644 (file)
index 0000000..deed48e
--- /dev/null
@@ -0,0 +1,22 @@
+import { Subscriber } from '../Subscriber';
+import { Subject } from '../Subject';
+
+/**
+ * Determines whether the ErrorObserver is closed or stopped or has a
+ * destination that is closed or stopped - in which case errors will
+ * need to be reported via a different mechanism.
+ * @param observer the observer
+ */
+export function canReportError(observer: Subscriber<any> | Subject<any>): boolean {
+  while (observer) {
+    const { closed, destination, isStopped } = observer as any;
+    if (closed || isStopped) {
+      return false;
+    } else if (destination && destination instanceof Subscriber) {
+      observer = destination;
+    } else {
+      observer = null;
+    }
+  }
+  return true;
+}