This commit is contained in:
Jacob Nguyen
2024-05-04 12:24:22 -05:00
parent f762033504
commit 08ef80522f
4 changed files with 11 additions and 18 deletions

View File

@@ -1,5 +1,4 @@
import path from 'node:path';
import assert from 'assert';
import { existsSync } from 'fs';

View File

@@ -18,7 +18,6 @@ import {
import type { Emitter, ErrorHandling, Logging } from './interfaces';
import util from 'node:util';
import type { PluginResult } from '../types/core-plugin';
import type { Result } from 'ts-results-es'
import type { VoidResult } from './_internal';
/**
* if {src} is true, mapTo V, else ignore
@@ -70,12 +69,12 @@ export function handleError<C>(crashHandler: ErrorHandling, emitter: Emitter, lo
return caught;
};
}
// Temporary until i get rxjs operators working on ts-results-es
export const filterTap = <K, R>(onErr: (e: R) => void): OperatorFunction<Result<K, R>, K> =>
pipe(concatMap(result => {
if(result.isOk()) {
return of(result.value)
}
onErr(result.error);
return EMPTY
}))
//// Temporary until i get rxjs operators working on ts-results-es
//const filterTap = <K, R>(onErr: (e: R) => void): OperatorFunction<Result<K, R>, K> =>
// pipe(concatMap(result => {
// if(result.isOk()) {
// return of(result.value)
// }
// onErr(result.error);
// return EMPTY
// }))