Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4449c82611 | |||
fe31a779e4 | |||
9b96c22d6a | |||
262891ccf3 | |||
0d60b29ff7 | |||
ecca2a9f32 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@api.global/typedrequest",
|
||||
"version": "3.0.22",
|
||||
"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
7278
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -44,4 +44,4 @@ tap.skip.test('test', async (tools) => {
|
||||
await tools.delayFor(5000);
|
||||
})
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
|
@ -106,4 +106,4 @@ tap.test('should end the server', async (toolsArg) => {
|
||||
setTimeout(() => process.exit(0), 100);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@api.global/typedrequest',
|
||||
version: '3.0.22',
|
||||
version: '3.0.25',
|
||||
description: 'A TypeScript library for making typed requests towards APIs, including facilities for handling requests, routing, and virtual stream handling.'
|
||||
}
|
||||
|
@ -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?: (
|
||||
@ -15,7 +15,7 @@ export interface ICommFunctions {
|
||||
* 3. It has a Readable and Writable side.
|
||||
* 4. The Writable side is Readable on the other side and vice versa.
|
||||
*/
|
||||
export class VirtualStream<T = ArrayBufferLike> implements plugins.typedRequestInterfaces.IVirtualStream<T> {
|
||||
export class VirtualStream<T = Uint8Array> implements plugins.typedRequestInterfaces.IVirtualStream<T> {
|
||||
// STATIC
|
||||
public static encodePayloadForNetwork(
|
||||
objectPayload: any,
|
||||
@ -79,7 +79,11 @@ export class VirtualStream<T = ArrayBufferLike> implements plugins.typedRequestI
|
||||
}
|
||||
|
||||
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') {
|
||||
|
Reference in New Issue
Block a user