Skip to content

Commit f20a0e1

Browse files
committed
[hygiene] Rename function
1 parent 5717255 commit f20a0e1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/persisters/persister-partykit-server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ const promiseToSetOrDelStorage = (
118118
: storage.put<string | number | boolean>(key, value),
119119
);
120120

121-
const getResponse = (status: number, body: string | null = null) =>
121+
const newResponse = (status: number, body: string | null = null) =>
122122
new Response(body, {status, headers: CORS_HEADERS});
123123

124124
export class TinyBasePartyKitServer implements TinyBasePartyKitServerDecl {
@@ -131,19 +131,19 @@ export class TinyBasePartyKitServer implements TinyBasePartyKitServerDecl {
131131
const text = await request.text();
132132
if (request.method == PUT) {
133133
if (hasStore) {
134-
return getResponse(205);
134+
return newResponse(205);
135135
}
136136
await saveStoreToStorage(this.party.storage, jsonParse(text));
137-
return getResponse(201);
137+
return newResponse(201);
138138
}
139-
return getResponse(
139+
return newResponse(
140140
200,
141141
hasStore
142142
? jsonString(await loadStoreFromStorage(storage))
143143
: EMPTY_STRING,
144144
);
145145
}
146-
return getResponse(404);
146+
return newResponse(404);
147147
}
148148

149149
async onMessage(message: string, client: Connection) {

0 commit comments

Comments
 (0)