Compare commits

...

4 Commits

Author SHA1 Message Date
4449c82611 3.0.25 2024-05-25 02:18:46 +02:00
fe31a779e4 fix(core): update 2024-05-25 02:18:46 +02:00
9b96c22d6a 3.0.24 2024-05-25 02:15:09 +02:00
262891ccf3 fix(core): update 2024-05-25 02:15:08 +02:00
6 changed files with 4579 additions and 2721 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@api.global/typedrequest",
"version": "3.0.23",
"version": "3.0.25",
"private": false,
"description": "A TypeScript library for making typed requests towards APIs, including facilities for handling requests, routing, and virtual stream handling.",
"main": "dist_ts/index.js",
@ -14,14 +14,14 @@
"buildDocs": "tsdoc"
},
"devDependencies": {
"@api.global/typedserver": "^3.0.29",
"@git.zone/tsbuild": "^2.1.72",
"@api.global/typedserver": "^3.0.44",
"@git.zone/tsbuild": "^2.1.80",
"@git.zone/tsbundle": "^2.0.15",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tstest": "^1.0.90",
"@push.rocks/smartenv": "^5.0.12",
"@push.rocks/tapbundle": "^5.0.23",
"@types/node": "^20.12.8"
"@types/node": "^20.12.12"
},
"dependencies": {
"@api.global/typedrequest-interfaces": "^3.0.19",

7278
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -44,4 +44,4 @@ tap.skip.test('test', async (tools) => {
await tools.delayFor(5000);
})
tap.start();
export default tap.start();

View File

@ -106,4 +106,4 @@ tap.test('should end the server', async (toolsArg) => {
setTimeout(() => process.exit(0), 100);
});
tap.start();
export default tap.start();

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedrequest',
version: '3.0.23',
version: '3.0.25',
description: 'A TypeScript library for making typed requests towards APIs, including facilities for handling requests, routing, and virtual stream handling.'
}

View File

@ -1,5 +1,5 @@
import * as plugins from './plugins.js';
import type { TypedRouter } from './typedrequest.classes.typedrouter.js';
import { TypedRouter } from './typedrequest.classes.typedrouter.js';
export interface ICommFunctions {
sendMethod?: (
@ -79,7 +79,11 @@ export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterf
}
public static decodePayloadFromNetwork(objectPayload: any, commFunctions: ICommFunctions): any {
if (plugins.smartbuffer.isBufferLike(objectPayload)) {
if (
plugins.smartbuffer.isBufferLike(objectPayload)
|| objectPayload instanceof TypedRouter
) {
return objectPayload;
}
if (objectPayload !== null && typeof objectPayload === 'object') {