File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 11import { AutoRouter , type IRequest } from "itty-router" ;
2- import { logMessageTransformer } from "./log_message" ;
3- import { matchedDataTransformer } from "./matched_data" ;
2+ import { parseTransformer } from "./log_message" ;
3+ import { decodeTransformer } from "./matched_data" ;
44
55type Env = {
66 MATCHED_PAYLOAD_PRIVATE_KEY : string ;
2626 await req . body
2727 . pipeThrough ( new DecompressionStream ( "gzip" ) )
2828 . pipeThrough ( new TextDecoderStream ( "utf-8" ) )
29- . pipeThrough ( logMessageTransformer ( ) )
29+ . pipeThrough ( parseTransformer ( ) )
3030 . pipeThrough (
31- matchedDataTransformer (
31+ decodeTransformer (
3232 env . MATCHED_PAYLOAD_PRIVATE_KEY ,
3333 // this is async in case data needs to be sent anywhere
3434 async ( data : string | null ) => {
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export type LogMessage = {
3737 Source : string ;
3838} ;
3939
40- export function logMessageTransformer ( ) {
40+ export function parseTransformer ( ) {
4141 return new TransformNewlineStream ( async ( line : string ) => {
4242 try {
4343 const { Metadata } = JSON . parse ( line ) as LogMessage ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const suite = new CipherSuite({
1313 aead : new Chacha20Poly1305 ( ) ,
1414} ) ;
1515
16- export function matchedDataTransformer (
16+ export function decodeTransformer (
1717 privateKey : string ,
1818 dataProcessor : ( data : string | null ) => void
1919) {
You can’t perform that action at this time.
0 commit comments