diff --git a/src/core/_internal.ts b/src/core/_internal.ts index a946f20..fa9d4b5 100644 --- a/src/core/_internal.ts +++ b/src/core/_internal.ts @@ -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'; diff --git a/src/core/operators.ts b/src/core/operators.ts index 572a375..ec4b1a8 100644 --- a/src/core/operators.ts +++ b/src/core/operators.ts @@ -45,7 +45,8 @@ export function callPlugin(args: unknown): OperatorFunction(src: T) => (Array.isArray(src) ? (src as unknown[]) : [src]); +export const arrayifySource = (src: T) => + Array.isArray(src) ? src : [src]; /** * Checks if the stream of results is all ok. diff --git a/src/handlers/event-utils.ts b/src/handlers/event-utils.ts index 2d0ca68..c0887c0 100644 --- a/src/handlers/event-utils.ts +++ b/src/handlers/event-utils.ts @@ -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'; diff --git a/src/handlers/message-event.ts b/src/handlers/message-event.ts index 1dbbddc..1b45c59 100644 --- a/src/handlers/message-event.ts +++ b/src/handlers/message-event.ts @@ -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(client, 'messageCreate'); diff --git a/src/handlers/presence.ts b/src/handlers/presence.ts index f5caa89..4565da3 100644 --- a/src/handlers/presence.ts +++ b/src/handlers/presence.ts @@ -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"; diff --git a/src/sern.ts b/src/sern.ts index 68f2dbb..ee518d1 100644 --- a/src/sern.ts +++ b/src/sern.ts @@ -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'; /** diff --git a/src/types/core-plugin.ts b/src/types/core-plugin.ts index 6f1621e..5cff96f 100644 --- a/src/types/core-plugin.ts +++ b/src/types/core-plugin.ts @@ -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; @@ -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];