Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Feb 5, 2024
1 parent e03963c commit 4d2dc69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getUserId(event) {
// Re-use an existing user ID if one exists
if (event?.cookies?.find((c) => c.startsWith(`${USER_ID_COOKIE_NAME}=`))) {
const reqCookie = event.cookies.find((c) =>
c.startsWith(`${USER_ID_COOKIE_NAME}=`)
c.startsWith(`${USER_ID_COOKIE_NAME}=`),
);
const reqCookieValue = reqCookie.split("=", 2)[1];
return reqCookieValue;
Expand All @@ -59,7 +59,7 @@ function getSessionId(event, userId) {
// Re-use an existing session ID if one exists
if (event?.cookies?.find((c) => c.startsWith(`${SESSION_COOKIE_NAME}=`))) {
const reqCookie = event.cookies.find((c) =>
c.startsWith(`${SESSION_COOKIE_NAME}=`)
c.startsWith(`${SESSION_COOKIE_NAME}=`),
);
const reqCookieValue = reqCookie.split("=", 2)[1];
return reqCookieValue;
Expand Down Expand Up @@ -109,7 +109,7 @@ export const handler = async (event) => {
StreamName: process.env.ACTION_LOG_STREAM_NAME,
PartitionKey: createHash("md5").update(logCsv).digest("hex"),
Data: Buffer.from(logCsv),
})
}),
);

return {
Expand Down
2 changes: 1 addition & 1 deletion src/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const handler = async (event, context) => {
console.log(JSON.stringify(event));

const logLines = event?.Records?.map((r) =>
Buffer.from(r.kinesis.data, "base64").toString("ascii")
Buffer.from(r.kinesis.data, "base64").toString("ascii"),
);

if (logLines?.length) {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2023",
"target": "es2022",
"allowJs": true,
"checkJs": true,
"noEmit": true
Expand Down

0 comments on commit 4d2dc69

Please sign in to comment.