mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
fdsfD
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import path from 'node:path';
|
||||
import assert from 'assert';
|
||||
import { existsSync } from 'fs';
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
// }))
|
||||
|
||||
@@ -20,11 +20,7 @@ const parseConfig = async (conf: Promise<PresenceResult>) => {
|
||||
return of(s).pipe(take(1));
|
||||
})
|
||||
};
|
||||
interface PresenceModule {
|
||||
module: PresenceConfig<(keyof Dependencies)[]>
|
||||
}
|
||||
export const presenceHandler = (path: string, setPresence: SetPresence) => {
|
||||
|
||||
|
||||
// const presence = Files
|
||||
// .importModule<PresenceModule>(path)
|
||||
// .then(({ module }) => {
|
||||
@@ -40,4 +36,4 @@ export const presenceHandler = (path: string, setPresence: SetPresence) => {
|
||||
// concatMap(fn => parseConfig(fn())),
|
||||
// // subscribe to the observable parseConfig yields, and set the presence.
|
||||
// concatMap(conf => conf.pipe(map(setPresence))));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import callsites from 'callsites';
|
||||
import * as Files from './core/module-loading';
|
||||
import { Services } from './core/ioc';
|
||||
import type { DependencyList } from './types/ioc';
|
||||
|
||||
interface Wrapper {
|
||||
commands?: string;
|
||||
defaultPrefix?: string;
|
||||
|
||||
Reference in New Issue
Block a user