fix(virtualstream): Expose transport localData to handlers via TypedTools; improve VirtualStream payload encode/decode to preserve built-ins and handle nested arrays/objects
This commit is contained in:
@@ -2,6 +2,12 @@ import { TypedResponseError } from './classes.typedresponseerror.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
export class TypedTools {
|
||||
/**
|
||||
* Local data passed from the transport layer.
|
||||
* This can contain connection-specific context like the WebSocket peer.
|
||||
*/
|
||||
public localData: Record<string, any> = {};
|
||||
|
||||
public async passGuards<T = any>(guardsArg: plugins.smartguard.Guard<T>[], dataArg: T) {
|
||||
const guardSet = new plugins.smartguard.GuardSet<T>(guardsArg);
|
||||
const guardResult = await guardSet.allGuardsPass(dataArg);
|
||||
|
||||
Reference in New Issue
Block a user