more refactoring

This commit is contained in:
jacob
2024-05-01 18:24:56 -05:00
parent 0488f45677
commit 219eda9bf7
7 changed files with 8 additions and 12 deletions

View File

@@ -1,8 +1,6 @@
import type { Result } from 'ts-results-es'
export * as Id from './id';
export * from './operators';
export * as Files from './module-loading';
export * from './functions';
export { SernError } from './structures/enums';
export { useContainerRaw } from './ioc/base';

View File

@@ -45,7 +45,8 @@ export function callPlugin(args: unknown): OperatorFunction<PluginExecutable, Vo
});
}
export const arrayifySource = <T>(src: T) => (Array.isArray(src) ? (src as unknown[]) : [src]);
export const arrayifySource = <T>(src: T) =>
Array.isArray(src) ? src : [src];
/**
* Checks if the stream of results is all ok.

View File

@@ -14,7 +14,6 @@ import {
pipe
} from 'rxjs';
import {
Id,
callPlugin,
everyPluginOk,
filterMapTo,
@@ -27,6 +26,7 @@ import {
treeSearch,
_Module,
} from '../core/_internal';
import * as Id from '../core/id'
import type { Emitter, ErrorHandling, Logging } from '../core/interfaces';
import { PayloadType } from '../core/structures/enums'
import { Err, Ok, Result } from 'ts-results-es';

View File

@@ -25,9 +25,7 @@ export function messageHandler(
defaultPrefix: string | undefined,
) {
if (!defaultPrefix) {
log?.debug({
message: 'No prefix found. message handler shutting down',
});
log?.debug({ message: 'No prefix found. message handler shutting down' });
return EMPTY;
}
const messageStream$ = sharedEventStream<Message>(client, 'messageCreate');

View File

@@ -1,5 +1,5 @@
import { concatMap, from, interval, of, map, scan, startWith, fromEvent, take } from "rxjs"
import { Files } from "../core/_internal";
import * as Files from "../core/module-loading";
import { PresenceConfig, PresenceResult } from "../core/presences";
import { Services } from "../core/ioc";
import assert from "node:assert";

View File

@@ -1,5 +1,5 @@
import callsites from 'callsites';
import { Files } from './core/_internal';
import * as Files from './core/module-loading';
import { Services } from './core/ioc';
/**

View File

@@ -48,7 +48,7 @@ import type {
UserContextMenuCommandInteraction,
UserSelectMenuInteraction,
} from 'discord.js';
import type { VoidResult } from '../core/_internal';
import { VoidResult } from '../core/_internal';
export type PluginResult = Awaitable<VoidResult>;
@@ -82,8 +82,7 @@ export type CommandArgs<
J extends PluginType = PluginType,
> = CommandArgsMatrix[I][J];
export type EventArgs<
I extends EventType = EventType,
export type EventArgs< I extends EventType = EventType,
J extends PluginType = PluginType,
> = EventArgsMatrix[I][J];