mirror of
https://github.com/sern-handler/handler
synced 2026-06-27 18:22:14 +00:00
fix text compile
This commit is contained in:
@@ -13,6 +13,7 @@ export const parseCallsite = (fpath: string) => {
|
||||
return { name: pathobj.name,
|
||||
absPath : path.posix.format(pathobj) }
|
||||
}
|
||||
|
||||
export const shouldHandle = (pth: string, filenam: string) => {
|
||||
const file_name = filenam+path.extname(pth);
|
||||
let newPath = path.join(path.dirname(pth), file_name)
|
||||
@@ -22,7 +23,6 @@ export const shouldHandle = (pth: string, filenam: string) => {
|
||||
}
|
||||
|
||||
|
||||
export type ModuleResult<T> = Promise<ImportPayload<T>>;
|
||||
|
||||
/**
|
||||
* Import any module based on the absolute path.
|
||||
|
||||
@@ -51,14 +51,13 @@ export const arrayifySource = map(src => (Array.isArray(src) ? (src as unknown[]
|
||||
/**
|
||||
* Checks if the stream of results is all ok.
|
||||
*/
|
||||
export const everyPluginOk: OperatorFunction<VoidResult, boolean> = pipe(
|
||||
every(result => result.isOk()),
|
||||
defaultIfEmpty(true),
|
||||
);
|
||||
export const everyPluginOk: OperatorFunction<VoidResult, boolean> =
|
||||
pipe(every(result => result.isOk()),
|
||||
defaultIfEmpty(true));
|
||||
|
||||
export const sharedEventStream = <T>(e: Emitter, eventName: string) =>
|
||||
(fromEvent(e, eventName) as Observable<T>).pipe(share());
|
||||
|
||||
export const sharedEventStream = <T>(e: Emitter, eventName: string) => {
|
||||
return (fromEvent(e, eventName) as Observable<T>).pipe(share());
|
||||
};
|
||||
|
||||
export function handleError<C>(crashHandler: ErrorHandling, emitter: Emitter, logging?: Logging) {
|
||||
return (pload: unknown, caught: Observable<C>) => {
|
||||
@@ -80,5 +79,3 @@ export const filterTap = <K, R>(onErr: (e: R) => void): OperatorFunction<Result<
|
||||
onErr(result.error);
|
||||
return EMPTY
|
||||
}))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user