fix(websockets): fp-ts wrong methods
MODIFY
packages/core/src/+internal/utils/any.util.ts
packages/core/src/+internal/utils/any.util.ts
export const isNonNullable = <T>(value: T): value is NonNullable<T> =>
value !== undefined && value !== null;
+
+export const isNullable = <T>(value: T) =>
+ !isNonNullable(value);

MODIFY
packages/middleware-io/src/io.reporter.ts
packages/middleware-io/src/io.reporter.ts
@@ -17,7 +17,7 @@ const getPath = (context: t.Context) =>
const getExpectedType = (context: t.ContextEntry[]) =>
getLast(context)
.map(c => c.type.name)
- .valueOr('any');
+ .getOrElse('any');
const getErrorMessage = (value: any, context: t.Context): ReporterResult => ({
path: getPath(context),

MODIFY
packages/websockets/src/error/ws-error.provider.ts
packages/websockets/src/error/ws-error.provider.ts
+import { isNullable } from '@marblejs/core/dist/+internal/utils';
import { EventTransformer } from '../transformer/transformer.inteface';
import { WsErrorEffect } from '../effects/ws-effects.interface';
import { error$ as defaultError$ } from './ws-error.effect';
@@ -6,6 +7,6 @@ export const provideErrorEffect = (
errorEffect: WsErrorEffect<any, any, any> | undefined,
eventTransformer: EventTransformer<any, any> | undefined,
) =>
- !errorEffect && eventTransformer === undefined
+ !errorEffect && isNullable(eventTransformer)
? defaultError$
: errorEffect;

fix(websockets): fp-ts wrong methods