Skip to content

Commit a33acaf

Browse files
committed
Used the helper function for KinesisDynamoDBStreamSchema as well
1 parent 22f1c9f commit a33acaf

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

packages/parser/src/schemas/kinesis.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { fromBase64 } from '@aws-lambda-powertools/commons/utils/base64';
21
import { Base64Encoded } from 'src/helpers/index.js';
32
import { z } from 'zod';
43
import type { KinesisDataStreamEvent } from '../types/schema.js';
@@ -27,13 +26,7 @@ const KinesisDynamoDBStreamSchema = z.object({
2726
Records: z.array(
2827
KinesisDataStreamRecord.extend({
2928
kinesis: KinesisDataStreamRecordPayload.extend({
30-
data: z
31-
.string()
32-
.transform((data) => {
33-
const decoded = decoder.decode(fromBase64(data, 'base64'));
34-
return JSON.parse(decoded);
35-
})
36-
.pipe(DynamoDBStreamToKinesisRecord),
29+
data: Base64Encoded(z.any()).pipe(DynamoDBStreamToKinesisRecord),
3730
}),
3831
})
3932
),

0 commit comments

Comments
 (0)