Skip to content

Commit

Permalink
fix(regex): rely on .exec
Browse files Browse the repository at this point in the history
  • Loading branch information
louisgrasset committed Nov 12, 2023
1 parent 45e3748 commit 8840318
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/bluesky-sender.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ export const blueskySenderService = async (
);

// Save post ID to be able to reference it while posting the next chunk.
const RKEY_REGEX = /\/(?<rkey>\w+)$/;
chunkReferences.push({
cid: createdPost.cid,
uri: createdPost.uri,
rkey: createdPost.uri.match(/\/(?<rkey>\w+)$/)?.groups?.["rkey"] || "",
rkey: RKEY_REGEX.exec(createdPost.uri)?.groups?.["rkey"] || "",
});

// If this is the last chunk, save the all chunks ID to the cache.
Expand Down

0 comments on commit 8840318

Please sign in to comment.