@unikvs/passthrough 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/package.json +18 -22
- package/src/passthrough.ts +31 -36
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/passthrough.d.ts +0 -35
- package/dist/src/passthrough.d.ts.map +0 -1
- package/dist/src/passthrough.js +0 -41
package/README.md
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IMiddleware } from "@unikvs/core";
|
|
2
|
+
//#region ../src/passthrough.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
5
|
+
*/
|
|
6
|
+
declare class PassThrough implements IMiddleware {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
get isOpen(): boolean;
|
|
9
|
+
encode<TData>(c: IMiddleware.EncodeContext<TData>, next: IMiddleware.INext): Promise<void>;
|
|
10
|
+
decode<TData>(c: IMiddleware.DecodeContext<TData>, next: IMiddleware.INext): Promise<void>;
|
|
11
|
+
encodeStream<TChunk>(c: IMiddleware.EncodeStreamContext<TChunk>, next: IMiddleware.INext): Promise<void>;
|
|
12
|
+
decodeStream<TChunk>(c: IMiddleware.DecodeStreamContext<TChunk>, next: IMiddleware.INext): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { PassThrough };
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/passthrough.ts"],"mappings":";;;;;cAKqB,uBAAuB;WAC1B;MAEL;EAIX,OAAoB,OAClB,GAAG,YAAY,cAAc,QAC7B,MAAM,YAAY,QACjB;EAMH,OAAoB,OAClB,GAAG,YAAY,cAAc,QAC7B,MAAM,YAAY,QACjB;EAMH,aAA0B,QACxB,GAAG,YAAY,oBAAoB,SACnC,MAAM,YAAY,QACjB;EAMH,aAA0B,QACxB,GAAG,YAAY,oBAAoB,SACnC,MAAM,YAAY,QACjB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../src/passthrough.ts
|
|
2
|
+
/**
|
|
3
|
+
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
4
|
+
*/
|
|
5
|
+
var PassThrough = class {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.name = "PassThrough";
|
|
8
|
+
}
|
|
9
|
+
get isOpen() {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
async encode(c, next) {
|
|
13
|
+
c.destination = c.source;
|
|
14
|
+
await next();
|
|
15
|
+
}
|
|
16
|
+
async decode(c, next) {
|
|
17
|
+
c.destination = c.source;
|
|
18
|
+
await next();
|
|
19
|
+
}
|
|
20
|
+
async encodeStream(c, next) {
|
|
21
|
+
c.destination = c.source;
|
|
22
|
+
await next();
|
|
23
|
+
}
|
|
24
|
+
async decodeStream(c, next) {
|
|
25
|
+
c.destination = c.source;
|
|
26
|
+
await next();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PassThrough };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/passthrough.ts"],"sourcesContent":["import type { IMiddleware } from \"@unikvs/core\";\n\n/**\n * [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)\n */\nexport default class PassThrough implements IMiddleware {\n public readonly name: string = \"PassThrough\";\n\n public get isOpen(): boolean {\n return true;\n }\n\n public async encode<TData>(\n c: IMiddleware.EncodeContext<TData>,\n next: IMiddleware.INext,\n ): Promise<void> {\n c.destination = c.source;\n\n await next();\n }\n\n public async decode<TData>(\n c: IMiddleware.DecodeContext<TData>,\n next: IMiddleware.INext,\n ): Promise<void> {\n c.destination = c.source;\n\n await next();\n }\n\n public async encodeStream<TChunk>(\n c: IMiddleware.EncodeStreamContext<TChunk>,\n next: IMiddleware.INext,\n ): Promise<void> {\n c.destination = c.source;\n\n await next();\n }\n\n public async decodeStream<TChunk>(\n c: IMiddleware.DecodeStreamContext<TChunk>,\n next: IMiddleware.INext,\n ): Promise<void> {\n c.destination = c.source;\n\n await next();\n }\n}\n"],"mappings":";;;;AAKA,IAAqB,cAArB,MAAwD;;EACtD,KAAgB,OAAe;;CAE/B,IAAW,SAAkB;EAC3B,OAAO;CACT;CAEA,MAAa,OACX,GACA,MACe;EACf,EAAE,cAAc,EAAE;EAElB,MAAM,KAAK;CACb;CAEA,MAAa,OACX,GACA,MACe;EACf,EAAE,cAAc,EAAE;EAElB,MAAM,KAAK;CACb;CAEA,MAAa,aACX,GACA,MACe;EACf,EAAE,cAAc,EAAE;EAElB,MAAM,KAAK;CACb;CAEA,MAAa,aACX,GACA,MACe;EACf,EAAE,cAAc,EAAE;EAElB,MAAM,KAAK;CACb;AACF"}
|
package/package.json
CHANGED
|
@@ -1,48 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unikvs/passthrough",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Transformer plugin that passes all data through without transforming it.",
|
|
5
|
-
"homepage": "https://
|
|
5
|
+
"homepage": "https://tai-kun.github.io/unikvs/",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"author": "tai-kun",
|
|
8
7
|
"repository": {
|
|
9
|
-
"url": "https://github.com/tai-kun/unikvs"
|
|
8
|
+
"url": "https://github.com/tai-kun/unikvs",
|
|
9
|
+
"directory": "packages/passthrough"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
13
|
"src",
|
|
14
14
|
"package.json",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"LICENSE",
|
|
16
|
+
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"type": "module",
|
|
19
19
|
"sideEffects": false,
|
|
20
|
-
"main": "./dist/src/index.js",
|
|
21
|
-
"types": "./dist/src/index.d.ts",
|
|
22
20
|
"exports": {
|
|
23
21
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
25
|
-
"default": "./dist/
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"default": "./dist/index.js"
|
|
26
24
|
}
|
|
27
25
|
},
|
|
28
26
|
"dependencies": {
|
|
29
|
-
"@unikvs/core": "0.0.
|
|
27
|
+
"@unikvs/core": "0.0.13"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@vitest/
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"playwright": "1.63.0",
|
|
39
|
-
"vite": "8.3.0",
|
|
40
|
-
"vitest": "4.1.11"
|
|
30
|
+
"@unikvs/testing": "0.0.0",
|
|
31
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
32
|
+
"@vitest/coverage-istanbul": "5.0.5",
|
|
33
|
+
"@vitest/coverage-v8": "5.0.5",
|
|
34
|
+
"playwright": "1.64.1",
|
|
35
|
+
"vite-plus": "1.3.0"
|
|
41
36
|
},
|
|
42
37
|
"peerDependencies": {
|
|
43
|
-
"@logtape/logtape": "2.0.0"
|
|
38
|
+
"@logtape/logtape": "^2.0.0"
|
|
44
39
|
},
|
|
40
|
+
"readme": "README.md",
|
|
45
41
|
"scripts": {
|
|
46
|
-
"build": "
|
|
42
|
+
"build": "vp -C .config pack"
|
|
47
43
|
}
|
|
48
44
|
}
|
package/src/passthrough.ts
CHANGED
|
@@ -1,53 +1,48 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IMiddleware } from "@unikvs/core";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
5
5
|
*/
|
|
6
|
-
export default class PassThrough implements
|
|
7
|
-
|
|
8
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
9
|
-
*/
|
|
10
|
-
public readonly name: string;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
14
|
-
*/
|
|
15
|
-
public constructor() {
|
|
16
|
-
this.name = "PassThrough";
|
|
17
|
-
}
|
|
6
|
+
export default class PassThrough implements IMiddleware {
|
|
7
|
+
public readonly name: string = "PassThrough";
|
|
18
8
|
|
|
19
|
-
/**
|
|
20
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
21
|
-
*/
|
|
22
9
|
public get isOpen(): boolean {
|
|
23
10
|
return true;
|
|
24
11
|
}
|
|
25
12
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
public async encode<TData>(
|
|
14
|
+
c: IMiddleware.EncodeContext<TData>,
|
|
15
|
+
next: IMiddleware.INext,
|
|
16
|
+
): Promise<void> {
|
|
17
|
+
c.destination = c.source;
|
|
18
|
+
|
|
19
|
+
await next();
|
|
31
20
|
}
|
|
32
21
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
public async decode<TData>(
|
|
23
|
+
c: IMiddleware.DecodeContext<TData>,
|
|
24
|
+
next: IMiddleware.INext,
|
|
25
|
+
): Promise<void> {
|
|
26
|
+
c.destination = c.source;
|
|
27
|
+
|
|
28
|
+
await next();
|
|
38
29
|
}
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
public async encodeStream<TChunk>(
|
|
32
|
+
c: IMiddleware.EncodeStreamContext<TChunk>,
|
|
33
|
+
next: IMiddleware.INext,
|
|
34
|
+
): Promise<void> {
|
|
35
|
+
c.destination = c.source;
|
|
36
|
+
|
|
37
|
+
await next();
|
|
45
38
|
}
|
|
46
39
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
public async decodeStream<TChunk>(
|
|
41
|
+
c: IMiddleware.DecodeStreamContext<TChunk>,
|
|
42
|
+
next: IMiddleware.INext,
|
|
43
|
+
): Promise<void> {
|
|
44
|
+
c.destination = c.source;
|
|
45
|
+
|
|
46
|
+
await next();
|
|
52
47
|
}
|
|
53
48
|
}
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as PassThrough } from "./passthrough.js";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ITransformer } from "@unikvs/core";
|
|
2
|
-
/**
|
|
3
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
4
|
-
*/
|
|
5
|
-
export default class PassThrough implements ITransformer {
|
|
6
|
-
/**
|
|
7
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
8
|
-
*/
|
|
9
|
-
readonly name: string;
|
|
10
|
-
/**
|
|
11
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
12
|
-
*/
|
|
13
|
-
constructor();
|
|
14
|
-
/**
|
|
15
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
16
|
-
*/
|
|
17
|
-
get isOpen(): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
20
|
-
*/
|
|
21
|
-
encode<TData>(args: Pick<ITransformer.EncodeArgs<TData>, "data">): TData;
|
|
22
|
-
/**
|
|
23
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
24
|
-
*/
|
|
25
|
-
decode<TData>(args: Pick<ITransformer.DecodeArgs<TData>, "data">): TData;
|
|
26
|
-
/**
|
|
27
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#streams)
|
|
28
|
-
*/
|
|
29
|
-
getEncodable(): TransformStream<any, any>;
|
|
30
|
-
/**
|
|
31
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#streams)
|
|
32
|
-
*/
|
|
33
|
-
getDecodable(): TransformStream<any, any>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=passthrough.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"passthrough.d.ts","sourceRoot":"","sources":["../../src/passthrough.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,YAAY;IACtD;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,cAEC;IAED;;OAEG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAE9E;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAE9E;IAED;;OAEG;IACI,YAAY,IAAI,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAE/C;IAED;;OAEG;IACI,YAAY,IAAI,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAE/C;CACF"}
|
package/dist/src/passthrough.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
3
|
-
*/
|
|
4
|
-
export default class PassThrough {
|
|
5
|
-
/**
|
|
6
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
7
|
-
*/
|
|
8
|
-
constructor() {
|
|
9
|
-
this.name = "PassThrough";
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
13
|
-
*/
|
|
14
|
-
get isOpen() {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
19
|
-
*/
|
|
20
|
-
encode(args) {
|
|
21
|
-
return args.data;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#usage)
|
|
25
|
-
*/
|
|
26
|
-
decode(args) {
|
|
27
|
-
return args.data;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#streams)
|
|
31
|
-
*/
|
|
32
|
-
getEncodable() {
|
|
33
|
-
return new TransformStream();
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* [API Reference](https://tai-kun.github.io/unikvs/packages/passthrough#streams)
|
|
37
|
-
*/
|
|
38
|
-
getDecodable() {
|
|
39
|
-
return new TransformStream();
|
|
40
|
-
}
|
|
41
|
-
}
|